HTML Tutorial: CSS Role
In this tutorial, you will learn basic Cascading Style Sheets (CSS) operations. CSS role uses a separate language from the HTML. It enables you to consistently apply styles of elements on all pages of your own site. Therefore, all paragraphs, lists, and headings appear the same on each page of your site.
++++++++++++++
If You want to buy cheap web hosting then visit http://listtop.pw and select the cheapest hosting. it can be suitable for all your needs.
Top 200 best traffic exchange sites http://listtop.pw/surf
Listtop.pw
Listtop.pw
Listtop.pw
+++++++++++++++
THREE WAYS TO APPLY CSS IN HTML
Inline
This style is taking straight in the HTML tags. It uses the ‘style’ attribute. It will appear like this: <p style=”color: blue”>text</p>. This will make a specific paragraph in color blue.
Internal
This refers to styles used for an entire page. Inside the page’s head element, the styles for the page is surrounded by ‘style’ tags.
External
This is used for all the pages of your website.
STYLES ON HEADINGS
Locate the title tag on line 5. Type this: <style type=”text/css”>
Press the enter key three times and then type </style>
Below the opening <style> tag type: h1 { , press the enter key and then the tab key to place the cursor below the bracket.
Below h1 { type: color:blue; press the enter key again to the next line, and type the right curly bracket: }
The heading is now color blue once you check the browser.
MAKING AN EXTERNAL STYLE SHEET
In the document, look for the rules you made within the <style> tags and select them. Select only the style rules instead of the tags.
Go to Edit, cut, and then go to the style.css file. Paste the rules on the external style sheet document, and then save to your style sheet.
Go back to the index.html page and go to Files. Add the <link> tag and point it to the .css document. The HTML page will have no style if you don’t link to the external styles.
Put the cursor after the closing </style> tag and then press the enter key to start a new line.
View the HTML page in your browser to check it.
CSS role is really not easy. You need to be careful in encoding the different characters or else everything will look wrong on the page. But once you get the hang of it, nothing could go wrong.