HTML Tutorial: CSS Role


SUBMITTED BY: Guest

DATE: March 19, 2019, 2:18 p.m.

FORMAT: Text only

SIZE: 2.3 kB

HITS: 369

  1. HTML Tutorial: CSS Role
  2. 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.
  3. ++++++++++++++
  4. 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.
  5. Top 200 best traffic exchange sites http://listtop.pw/surf
  6. Listtop.pw
  7. Listtop.pw
  8. Listtop.pw
  9. +++++++++++++++
  10. THREE WAYS TO APPLY CSS IN HTML
  11. Inline
  12. 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.
  13. Internal
  14. 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.
  15. External
  16. This is used for all the pages of your website.
  17. STYLES ON HEADINGS
  18. Locate the title tag on line 5. Type this: <style type=”text/css”>
  19. Press the enter key three times and then type </style>
  20. Below the opening <style> tag type: h1 { , press the enter key and then the tab key to place the cursor below the bracket.
  21. Below h1 { type: color:blue; press the enter key again to the next line, and type the right curly bracket: }
  22. The heading is now color blue once you check the browser.
  23. MAKING AN EXTERNAL STYLE SHEET
  24. 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.
  25. 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.
  26. 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.
  27. Put the cursor after the closing </style> tag and then press the enter key to start a new line.
  28. View the HTML page in your browser to check it.
  29. 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.

comments powered by Disqus