CSS styles

CSS styles: inline style, internal style, external style

New 03-three.html file:

    使用CSS样式,样式优先级,CSS选择器  

段落文本(p):使用内联样式

一级标题(h1):使用内部样式表

二级标题(h2):使用外部样式表

Create a new 03-three.css file:

h2{ color:green; background-color:gray }

Run 03-three.html and the display will be as follows:

微信图片_20180314161821.png

The priority of inline styles is the highest. Internal styles and external styles depend on which one is loaded last. The one loaded later will generally take effect.

But after adding !important, the priority becomes the highest


Continuing Learning
||
submit Reset Code
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!