Page 81 - Trackpad_V5_Book 6
P. 81
EXTERNAL CSS
External CSS allows us to define the style for many webpages by using a single CSS file. An external
style sheet is a separate file that can be written in any text editor. It does not contain any HTML
code and is saved with .css as the extension. You need to include a reference to the external style
sheet file within the <LINK> element inside the <HEAD> element. Syntax to include the reference of
the external stylesheet is:
<HEAD>
<LINK REL=“STYLESHEET” TYPE=“TEXT/CSS” HREF=“NAME OF STYLE SHEET”>
</HEAD>
Where the HREF attribute contains the path of the stylesheet.
USE OF INLINE CSS WITH HTML5 TAGS
You know the inline CSS and its basic syntax. Let us learn more about them.
Syntax to set multiple properties:
<TAGNAME STYLE = “PROPERTY1:VALUE; PROPERTY2:VALUE; PROPERTY3:VALUE;”>
The background colour of the webpage is set to CYAN with all other specified properties displayed
on the webpage.
Tick ( ) if you know this.
▶ Inline CSS allows us to add styles directly to an HTML tag by using the style attribute.
▶ Internal CSS allows us to define the style for a single HTML page.
21 st #Initiative
Century
Self Reflection Skills #Collaboration
Aditya has learnt how to create HTML documents and open them in a web browser. He showed a few of
Self Reflection
the pages that he had created to his friend Divyanshu, who suggested that he should use CSS to style his
webpages to make them more attractive. Aditya has never heard about CSS. Should he admit the fact and
ask for help from his friend? Elaborate.
Hashtag
#Hyper Text: Text that can be linked to another text or document
#Attribute: An Attribute defines some extra features or properties of an HTML tag
Learn HTML5 and CSS3 79

