Pages

Friday, May 2, 2014

html - style attribute

Understanding the HTML style attribute will provide you with a preview into the Cascading Style Sheet (CSS) world. In fact, the code we'll be using with style is indeed CSS code known as Internal CSS. CSS styling brings a whole new dimension to a website and offers endless customization of HTML elements and web page design.

When the style attribute was introduced into the HTML language along with CSS, a number of HTML attributes and tags became obsolete. Manipulation of the fonts and color of HTML elements is now accomplished through CSS styling, instead of stacking bulky formatting tags one inside the other.


 

HTML Style: Inline CSS:

<p id="contentParagraph" style="color: #0900C4;">

Here we've changed the font color of this paragraph to blue.

</p>

HTML Styling:

Here we've changed the font color of this paragraph to blue.
In the HTML Font lesson, we achieved similar results, but the code used to do so was cumbersome and inefficient.

No comments:

Post a Comment