CSS External Sheets

External Sheets
To help you manage an influential style sheet to all pages in your web. You can use an external style sheet. To get started you can type into an empty file:
DIV {font-family: Arial} . Redfont {color: red}
Then save the name "style1.css" (you can type another file name according to what you want but make sure extensionnya is .css). 
To create a link to a style sheet, you add tags <LINK> in the head section of your html.
<link rel="stylesheet" type="text/css" name="name" href="URL">
  • rel = "stylesheet" is the attribute to look for a stylesheet.
  • type = "text/css" tells the browser that the document type is a cascading style sheet.
  • name = "" attributes that allow you to give the name of the style sheet.
  • href = "" attribute that shows where you save the style sheet.
Now open the HTML file that you want to add the style to it. Go to HEAD section of the page (between <HEAD> and </ HEAD>). Type an HTML tag to link to a new style sheet you created earlier: (Check the file in the same folder)
<HEAD> <link rel="stylesheet" type="text/css" name="style1" href="style1.css"> </ HEAD>

You must add the LINK tag on every page that you want to use style sheets in it. If you do not add the effects of style sheets will not work properly.


Post a Comment