css - 关于伪类背景问题
PHPz
PHPz 2017-04-17 14:33:11
0
3
990

在伪类里,添加一个background:URL()的图片,无法显示,但是在规定高度之后,可以正常显示。
具体问题就是模仿bootcss网站,在上面的大背景图中,他是after伪类,没有添加高度就显示了出来。想知道他是怎么做到的。

PHPz
PHPz

学习是最好的投资!

Antworte allen(3)
Peter_Zhu

在伪类里用绝对定位

position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
刘奇

你是说http://www.bootcss.com/这个网址吗,它给了 padding 啊

大家讲道理
:after{content:'';display:block;width:100%;height:300px;background:url(IMG);background-size:cover;}
Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!