要求,a大小填充占整个div1,a中文字上下左右居中,a中文字多少不确定?
不知如何解决?
<div class="div1">
<a herf="xxxx">hehehehehh</a>
</div>
.div1{
width:300px;
height:80px;
}
.div1 a{
}
要求,a大小填充占整个div1,a中文字上下左右居中,a中文字多少不确定?
不知如何解决?
<div class="div1">
<a herf="xxxx">hehehehehh</a>
</div>
.div1{
width:300px;
height:80px;
}
.div1 a{
}
translate -50%
.div1{
width: 300px;
height: 400px;
background-color: #eee;
position: relative
}
.div1 a{
position: absolute;
top: 50%;
left: 50%;
transform: translate3d(-50%, -50%, 0)
}
10 回答11.3k 阅读
5 回答4.9k 阅读✓ 已解决
4 回答3.2k 阅读✓ 已解决
2 回答2.8k 阅读✓ 已解决
3 回答5.2k 阅读✓ 已解决
5 回答2k 阅读
1 回答3.4k 阅读✓ 已解决
注意兼容性,推荐直接用 table 标签写