84669 personnes étudient
152542 personnes étudient
20005 personnes étudient
5487 personnes étudient
7821 personnes étudient
359900 personnes étudient
3350 personnes étudient
180660 personnes étudient
48569 personnes étudient
18603 personnes étudient
40936 personnes étudient
1549 personnes étudient
1183 personnes étudient
32909 personnes étudient
demo在这https://jsfiddle.net/f2m02kz2/文字外围的背景必须是正方形,使用table-cell的话就变成长方形?文字在不同屏幕下变化,而且要在不同的屏幕下居中?不知该如何实现?
走同样的路,发现不同的人生
1.使用css3的box、flex布局2.使用table-cell,
css3
box
flex
table-cell
<p class="search_box"> <a href="" title="搜索" class="search_02" > <p class="pp">搜索<br />问题</p> </a> </p>
.search_box{ width:100%; display:table; height: 200px; } .search_box>a{ display:table-cell; background: red; height:0; text-align:center; font-size:1.5rem; text-decoration: none; vertical-align: middle; } .pp { vertical-align: middle; padding: 0; margin: 0 auto; background: blue; width: 25%; color: #fff; }
建议使用多个p标签来代替,多行文字的垂直居中可以试试vertical
可以看一下flex
1.使用
css3
的box
、flex
布局2.使用
table-cell
,建议使用多个p标签来代替
,多行文字的垂直居中可以试试vertical
可以看一下flex