Page 117 - CA 165 ver 1.0 Class 10
P. 117

LINK STYLE SHEET
                 There are three ways of inserting or linking a style sheet:

                   External Style Sheet
                   Internal Style Sheet

                   Inline Style
                 External Style Sheet

                 By using ‘External Style Sheet’, look of an entire website can be changed by updating just one CSS file. To
                 do so, a web page must include a reference to the external style sheet file within a <LINK> tag inside the
                 <HEAD> tag. Syntax to use <LINK> tag in the web page:

                   <HEAD>

                   <LINK REL=“stylesheet” TYPE=“text/css” HREF=“name of style sheet”>
                   </HEAD>
                 Let us create a web page using external stylesheet. Perform the following steps to do so:
                 Step 1:  Type the following code and save the file with .css extension.


























                 Step 2:   Use the preceding CSS file in your web page with the help of HREF attribute of the <LINK> tag.

                                                         externalcss



















                                                                              CSS file “mystyle.css” is linked here.




                                                                                        Cascading Style Sheets   115
   112   113   114   115   116   117   118   119   120   121   122