html - Relating the use of multiple type of style sheets in a single web page -



html - Relating the use of multiple type of style sheets in a single web page -

i'am in process of learning css. well, problem have read in css tutorial precedance of different types of style sheets when used simultaneously in single webpage follows:

1.browser default

2.external style sheet

3.internal style sheet (in head section)

4.inline style (inside html element)

where number 4 has highest priority. so, inline style (inside html element) has highest priority, means override style defined within tag, or in external style sheet, or in browser (a default value).

but in illustration have tried:

<html> <head> <style type="text/css"> img{height:auto;} </style> </head> <body> <img src="logocss.gif" width="95" height="100" /><br /> </body> </html>

the problem here internal style overriding inline style , changes made height in inline format not changing image height.

the element doesn't have inline style (which supplied style attribute, not height or width attribute). presentational html attributes.

css overrides presentational html attributes.

html css

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -