• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 33. Styling for HTML Elements > The Order of Precedence in Styling, fro...

The Order of Precedence in Styling, from Elements

Generally there are four different ways to apply a styling property to an element. The first way, which almost always takes precedent (see Listing 33.9), is the style attribute of the element itself. This is always a CSS declaration block, but without the brackets. You can use this to override just about any other styling in place. Listing 33.4 shows this particular technique.

Listing 33.4. Styling an Element Directly

<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head><title></title></head>
<body>
<p style="text-indent: 15px;">Indented Text.</p>
<p>Non-indented text.</p>
<!-- Results:
 Indented Text.
Non-indented text.
-->
</body>
</html>


					  


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint