我試圖創造一個內聯元素的視覺效果,this is what I want靈活的邊界內聯元素寬度
但使用內聯元素我無法弄清楚如何使這一紅線以上職稱靈活,這是我到目前爲止:https://jsfiddle.net/1oLzzw6t/
<div><span class="info-w option1"><span class="info"><span>Batman vs Superman – O Coringa e o Charada quase apareceram no filme!</span></span></span></div>
<div><span class="info-w option2"><span class="info"><span>Batman vs Superman – O Coringa e o Charada quase apareceram no filme!</span></span></span></div>
body{
padding: 5%;
background: black;
}
.info-w{
padding-right: 10%;
position: relative;
z-index: 1;
.info{
float: left;
font-family: Helvetica;
font-size: 24px;
line-height: 1.2;
font-weight: bold;
color: black;
>span{
display: inline;
background: #FFF;
position: relative;
}
}
&.option1{
.info{
>span{
border-top: 3px solid red;
}
}
}
&.option2{
.info{
box-shadow: 0 -3px 0 red;
}
}
}
有人可以幫助我嗎?
爲什麼在火狐瀏覽器和火狐瀏覽器開發者中這不適用於我? – xpy