1
我有一些HTML和CSS代碼像下面優先的內嵌樣式和內部樣式
<html>
<head>
<style type="text/css">
img.normal
{
height:auto;
}
img.big
{
height:120px;
}
p.ex
{
height:100px;
width:100px;
}
</style>
</head>
<body>
<img class="normal" src="logocss.gif" width="95" height="84" /><br />
<img class="big" src="logocss.gif" width="95" height="84" />
<p class="ex">The height and width of this paragraph is 100px.</p>
<p>This is some text in a paragraph. This is some text in a paragraph.
This is some text in a paragraph. This is some text in a paragraph.
This is some text in a paragraph. This is some text in a paragraph.</p>
</body>
</html>
我記得三個樣式的優先級是直列>內部>外部。但上面的代碼中,圖片名爲'big',內聯樣式的高度爲84px,寬度爲95,爲什麼內部樣式會影響結果樣式?任何人都可以幫忙?
謝謝!它運作良好! – James 2012-03-09 08:09:19