Computing Magazine

Cascading Stylesheets

Posted on the 20 January 2014 by Savio Menezes
Which style will be used for an html element when different stylesheets use same css property but have different values? Say suppose external stylesheet defines that paragraph’s (<p>) color should be red, internal stylesheet defines that paragraph’s color should be blue and inline style defines color of that paragraph should be green. In which color will paragraph be displayed? The answer is green.
When this type of situation occurs then stylesheet with highest priority will be used. The priority of stylesheet is as follows: 1.   Inline style 2.   Internal stylesheet 3.   External stylesheet


Back to Featured Articles on Logo Paperblog

Magazines