我是一个初学者并且非常困惑,作为一个 div 标签,当我使用border-radius: 50% 给出相同的宽度和高度时,它总是变成圆形.但是如果我想制作一个圆形按钮,使用标签 a,它不会那样工作.这是我尝试使圆形边框按钮可点击的时候.
I'm a beginner and very confused, as a div tag when I give the same width and height with border-radius: 50% it always becomes circle. but with the tag a in case I want to make a circle button, It doesnt work that way. This is when I try to make a circle border button clickable.
.btn {
height: 300px;
width: 300px;
border-radius: 50%;
border: 1px solid red;
}
<a class="btn" href="#"><i class="ion-ios-arrow-down"></i></a>
对于 div 标签,已经有浏览器给出的默认属性 display:block.对于锚标记,浏览器没有显示属性.您需要为其添加显示属性.这就是使用 display:block 或 display:inline-block 的原因.它会起作用的.
For div tag there is already default property display:block given by browser. For anchor tag there is not display property given by browser. You need to add display property to it. That's why use display:block or display:inline-block. It will work.
.btn {
display:block;
height: 300px;
width: 300px;
border-radius: 50%;
border: 1px solid red;
}
<a class="btn" href="#"><i class="ion-ios-arrow-down"></i></a>
这篇关于圆形按钮 css的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
ionic - 如何在 ion-header 中对长字符串进行自动换行ionic - How to wordwrap a long string in ion-header(ionic - 如何在 ion-header 中对长字符串进行自动换行)
如何在角度2中动态更改css类名How to change the css class name dynamically in angular 2(如何在角度2中动态更改css类名)
使用模态和样式的 Ionic 2 登录弹出窗口Ionic 2 login popup using Modal and styling(使用模态和样式的 Ionic 2 登录弹出窗口)
如何在ionic 3中进行水平滚动how to do horizontal scroll in ionic 3(如何在ionic 3中进行水平滚动)
与另一个离子卡重叠的虚拟滚动 ion-img 标签Virtual scroll ion-img tag overlapping to another ion card(与另一个离子卡重叠的虚拟滚动 ion-img 标签)
如何删除输入类型中的默认颜色?How to remove default color in input type?(如何删除输入类型中的默认颜色?)