我想将加号放置在圆圈中间的下方。现在,我尝试使用top,left属性。那仅适用于一台设备。当我在智能手机上查看页面时,所有内容都会丢失。因此,我需要一个不使用顶部和左侧的方法位置,并且移动圆不会影响加号(它将保持在中心)。
我的代码:
<html>
<body>
<div id="button"><div id="plus">+</div></div>
</body>
<style>
#button
{
position : relative;
width : 100px;
height : 100px;
border-radius : 100%;
background-color : red;
}
#plus
{
display : inline-block;
position : absolute;
width : 50%;
height : 50%;
margin : auto;
left : 5px;
font-family : sans-serif;
font-size : 40px;
color : black;
vertical-align : middle;
text-alignment : center;
}
</style>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句