+ -
当前位置:首页 → 问答吧 → html初哥求教

html初哥求教

时间:2014-05-29

来源:互联网

<head>
<style>
p {color:red}
</style>
</head>

<body>
<p style="color:blue"> xxxxxxxxxxxx </p>
</body>

why最后paragraph display出黎是蓝色
想知browser读html的模式
有无ching明我up咩

作者: vinclavv   发布时间: 2014-05-29

由第一行读到最尾个行
若果需要P 那个CSS 优先, 可加 !important
有任何疑问都可在讨论区发问或直接联络我!

作者: DevMark   发布时间: 2014-05-29

引用:原帖由 vinclavv 於 2014-4-21 09:58 PM 发表


p {color:red}




xxxxxxxxxxxx


why最后paragraph display出黎是蓝色
想知browser读html的模式
有无ching明我up咩
css style 系有分先后次序。

inline style (即系你 blue 个部份) 系优先的。
所以唔会睇你 Internal Styles (head 个部份)

重有其他的。

可以系 google search 下 css inline style priority。

作者: pc_chai   发布时间: 2014-05-29

google html css w3c and learn it

作者: webeeco   发布时间: 2014-05-29