IT Admin

CSS, How to Use Header Styles

by admin on Aug.14, 2009, under Tutorials

Header styles also can be used to style the <p> element. The CSS rules can be placed in the head of the document using the style element. Like inline styles, header styles, header styles should be avoided where possible because the styles are added to the HTML markup rather than in external CSS files.

There are cases where header styles might be the preferred option in specific instances, such as a CSS rule that is specific to one page within a large website. Rather than add this rule to an overall CSS file, a header style may be used.

The type=”text/css” attribute must be specified within the style element in order for browsers to recognize the file type.

<title>CSS Tutorial</title>
<style type=”test/css” media=”screen”>

p {
font-family: arial, helvetica, sans-serif;
margin: 1em;
padding: 1em;
background-color: gray;
width: 10em;
}

</style>
</head>



  • Share/Bookmark
No comments for this entry yet...

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...