WEEK: 7
Active: October 7th - October 13th
Work Due: October 14th @ 11:59PM

Adding CSS to HTML

Inline Styles

There are three ways in which we can add CSS to an HTML page.

  1. Inline
  2. Embedded
  3. External

Inline styles are applied directly to the tag as another attribute. Below is an example.

<a href="http://www.ebay.com" style="text-decoration:none">Ebay</a>

This style removes the underline from the link to eBay. It is important to note that style only applies to this particular tag and no other tags on this page. We will return to this point later.

What do we need to consider when we use inline styles? If we use inline styles and we want that style on another page, we will need to duplicate the style on that page too. Not bad unless we have many pages with multiple tags that need to be changed.

Click here for this section’s Video


Previous section:
Next section: