Explore 100's Of Free Video Tutorials

Keep Learning, Keep Coding & Keep Sharing

CSS

CSS External Styles

Notes:

External Style Sheet:
External Style Sheet is basically a .CSS file containing list of declaration blocks.
This .CSS file is linked to various web pages to apply common styles.

To link html and css files together we use link tag.
attributes:
href: href stands for Hyperlink reference
type: indicates the content in the reference file.
rel: rel indicates relationship, is style-sheet

Note:
link tag should be placed within the head tag.

Advantage:
We can implement consistency throughout the website.
Reduces code redundancy. Reduces website size.

Limitations:
If we make any changes in the CSS file, then every other linked html page will get affected. So, we need to handle it carefully.

Interview Questions:

1. Which HTML tag is used to link external style sheet and html document together?
a. link tag
b. style tag
c. style attribute
d. @media
Answer: a