HTML5 and CSS3 All-in-One For Dummies
Book image
Explore Book Buy On Amazon

A style can be defined directly in the HTML5 body. Here is an example of this type of code. A local style is also sometimes called an element-level style because it modifies a particular instance of an element on the page.

image0.jpg
<!DOCTYPE html>
<html lang = "en-US">
 <head>
 <meta charset = "UTF-8">
 <title>localStyles.html</title>
 </head>
 <body>
 <h1>Local Styles</h1>
 <p style = "border: 2em #FF00FF groove">
  This paragraph has a locally-defined border
 </p>
 <p style = "font-family: sans-serif;
    font-size: 1.2em;
    font-style: italic">
  This paragraph has a series of font and text rules applied.
 </p>
 </body>

As you look over this code, a couple things should become evident:

  • No

About This Article

This article is from the book:

About the book author:

Andy Harris taught himself programming because it was fun. Today he teaches computer science, game development, and web programming at the university level; is a technology consultant for the state of Indiana; has helped people with disabilities to form their own web development companies; and works with families who wish to teach computing at home.

This article can be found in the category: