Results 1 to 3 of 3

Thread: Horizontal Rule

  1. #1
    Join Date
    Apr 2005
    Posts
    49
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Horizontal Rule

    How do I use my own graphic as the horizontal rule, and how do i refer to it in the style?



    Quiztoon

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    It would be easier just to use the image:

    Code:
    <img src="my_rule.gif" width="200" height="3">
    You could style it as display:block; to avoid having to add <br> elements around it, if that is the effect that you want. Or, you could use a division or other block level element and use your image as its background. This would be particularly useful if your image were one that could be repeated to produce any length 'rule'. That could be styled like so:

    Code:
    .myrule {
    width:100%;
    height:3px;
    background:url('my_rule.gif') center black repeat;
    text-align:center;
    }
    
    .myrule img {
    height:3px;
    }
    with markup like so:

    Code:
    <div class="myrule"><img src="my_rule.gif></div>
    Ideally, my_rule.gif's actual height would match the desired height of the 'rule'.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Apr 2005
    Posts
    49
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thanks for that, will give it a try

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •