COIS 3420H Lecture 3: WEEK 3 LEC NOTES
WEEK 3 LEC NOTES
COIS 3420
Monday, January 21, 2019
CSS INTRO
CSS = Cascading Style Sheets
• CSS is used to add presentational features to your HTML
Why CSS
• Improved development practices
• Maintenance
• Search engine ranking
• Accessibility
• Page Size
External Style Sheets
• The recommended method for including CSS in an HTML document is to link to one or more CSS files
using the link element in the head of the HTML document
• rel – relationship of the linked file
• href – path to file to link
Advantages/Disadvantages
Note: Although you can include multiple stylesheets, this doesn’t mean that every page should have its
own
Embedded Style Sheets
• with embedded CSS the styles for an HTML document are located in the documents head inside a
style element
• type – tells the browser the type for the element’s contents
• must be included in the head element
• Embedded Style sheets overwrite external style sheets
Inline CSS
• Inline CSS can be added to individual HTML elements as the value of the style attribute
• Bad practice overall
• However, useful in very specific situations