Quick References
      ADO
      ASP
      CSS2
      HTML
      JavaScript
      Jet SQL
      VBScript
      WML
      WMLScript
      WSH
      XHTML
      XML DOM
      XSLT

Features
      Knowledge Base
      Tutorials

Partners
     ZVON.ORG
     XML
     Planet Source Code
     VisualBuilder
     Web Design
     Your HTML Source
     XML/XSLT Forums
     ASPAlliance
     Scripts
     
     Programmers Heaven
     Tek-Tips Forums
     Developer Fusion
     Code Project









ATTRIBUTE:  style

style="string"
 
The style attribute is used to assign style sheet properties to the specific element containing the attribute.
 
Do not confuse this attribute with the style tag which is used to create document-level style sheet rules. It is referred to as document-level because the style rules will apply to the entire HTML page. In contrast, the style attribute behaves similarly to an inline style rule and only effects a small portion the HTML document.
 
There are four attributes common to most tags: class, id, style, and title.
 
In this example, the text enclosed by the span tags will be brown, size 24px and in Times font.
 
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>DevGuru XHTML style Attribute Example</title>
</head>
<body>
<span style="color: brown; font-size: 24px; font-family: times;">
When in the course of human events...
</span>
</body>
</html>

 
Output:
When in the course of human events...
 


 


Copyright 1999-2005 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information