How to draw a line in a story

Printer-friendly version

Forums: 

Taxonomy upgrade extras: 

Do NOT draw a line using massive repeats of characters because this will make your display too wide for some viewers.

The easy way to draw a line to separate parts of a post is with the HR tag: <hr />

You can include parameters inside the tag like: <hr align="center" width="50%" />

The above will create a line that is centered and half as wide as as the display area.

Hugs,
Erin

Horizontal Rules

Erin is quite right: horizontal rules are an easy way to separate parts of a webpage or post.


By default, horizontal rules are 100% of the screen wide, and centered.


With horizontal rules, there are a number of different attributes you can modify:

  • The width attribute is used to control the length of a horizontal rule. You can specify the value in pixels, or as a percentage of the screen width:

    <hr width="250" />

    <hr width="30%" />


  • The size attribute determines the vertical thickness of the horizontal rule. This is in pixels:


    <hr size="5" />


    Comment: Appears to have no effect here.

  • By default, horizontal rules are centered. Use the align attribute to change this:


    <hr width="25%" align="left" />

    <hr width="25%" align="right" />

  • The line’s colour can be changed using the color attribute:

    <hr color="red" />

    <hr color="#0000ff" />

  • On webpages, horizontal rules are displayed as a three dimensional line. This can be changed to a solid two dimensional line using the noshade attribute:

    <hr size="10" align="right" width="50%" color="green" noshade />


    Comment: Gives a solid grey line here, ignoring any color attribute.

Parameter Settings

It's important to test things.

Not all of those work in my antique browser (color, weight & shade). The width & alignment work fine. (IE6 - I told you it was an antique).