這是HTML:爲什麼鏈接重疊文本?
<div>
<p>
We bring you the latest in entertainment & information services, right on your phone. From the latest of Bollywood to the futuristic applications, get it all here!
<a href="#">View All</a>
</p>
</div>
這是CSS ....
div{width: 350px;}
a{
padding: 30px;
background: red;
margin: 20px;
border-radius: 12px;
background: red;
color: #fff;
font: bold 12px Arial, Helvetica, sans-serif;
text-decoration: none;
}
我知道這可以通過在.a
使用display: inline-block;
來解決。但我想知道爲什麼這是重疊的文字?它不應該超越文本嗎?
DEMO2現在a
是p的塊水平內。
還可以看看這個DEMO。 Img也是一個內聯元素。爲什麼這不重疊,這應該也是重疊的,對嗎?
嘗試浮動:左;或位置:絕對; – 2013-04-25 05:03:23