Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us















Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


HR

The HR attributes of align, noshade, size and width have been deprecated in favor of style sheets.

Deprecated Examples:

The deprecated attributes specified the following values:

align = left|center|right

  • left: the rule is rendered flush left.
  • center: the rule is centered.
  • right: the rule is rendered flush right.

These attributes may now be specified using Style Sheets. The following example displays both the deprecated method and the CSS method.

<HR 	align	= right
	width	= "200"
	size	= "10"
	noshade
	>


Notice in the CSS example (below), a color may now be specified for the Horizontal Rule. Another difference is that the size attribute has been clarified by being termed the height attribute. The alignment is now specified as a distance from the left edge rather than simply justifying the line right, centered, or left.

CSS Example:

<STYLE TYPE="text/css">

HR {color: red;
	width:200;
	height: 10px;
	margin-left: 370px;
	}
</STYLE>


The use of the width property, coupled with the margin-left property gives us greater flexibility in placing the line on on the page. Suppose you didn't want the line completely moved over to the right, and didn't want it centered, but rather somewhere in between. By adjusting the margin-left value, you could achieve this effect.

<STYLE TYPE="text/css">

HR {color: red;
	width:200px;
	height: 5px;
	margin-left: 250px;
	}
</STYLE>


At the time of writing, the latest version of this browser rendered the preceding examples well, while the latest version of this browser did not.

Technically, HR is a block element and as such, we should be able to use float: right to align the rule, but it is not dependable, allowing the rule to justify left in some browsers.

ADDITIONAL RESOURCES

Breaks
HTML 4.01 Tags


Up to => Home / Authoring / HTML / 4 / Tags




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers