Skip navigation
Currently Being Moderated

css style rule question

May 1, 2009 10:37 AM

Hi,

I would like to make a <h1> and <h2> style rule to obtain the effect voor my headers as can be seen here: http://www.ecstechnics.com/modules/page.phtml?dimensionid=17&pageid=23

 

The main header style rule (<h1>) I can make easily I think: just apply the correct font style and that is it.

 

But for the <h2> header, I need a colored line that extends the width of my liquid main content container, except if it is interfered by a floating image. Example on the same site: http://www.ecstechnics.com/modules/page.phtml?dimensionid=24&pageid=37

The line extends for a certain width (preferably that of my liquid container, if not a fixed width), but if an image or other object interferes, I would like it to shorten correspondingly.

 

Is that possible? Any hints please?

 

Thank you!!

Erik

 
Replies
  • Currently Being Moderated
    May 1, 2009 10:37 AM   in reply to Erik Arckens

    I think that's a "border-bottom".

     

    Randy

     
    |
    Mark as:
  • Currently Being Moderated
    May 1, 2009 10:53 AM   in reply to Erik Arckens

    You could use something like this...

     

    h2 {
        font-size: 18px;
        font-weight: normal;
        color: #666;
        margin-bottom: 2px;
        border-bottom-width: 1px;
        border-bottom-style: solid;
        border-bottom-color: #B90000;
    }

     

     

    Lawrence   *Adobe Community Expert*
    www.Cartweaver.com
    Complete Shopping Cart Application for
    Dreamweaver, available in ASP, PHP and CF

     
    |
    Mark as:
  • Currently Being Moderated
    May 1, 2009 10:55 AM   in reply to Erik Arckens

    CSS:

     

    .short {

         border-bottom: 1px solid red;

         width: 400px;

    }


    .wide {

         border-bottom: 1px solid red;

         width: 100%

    }

     

    HTML:

     

    <h2 class="short">This is short</h2>
    <h2 class="wide">This is wide</h2>

     

     

    Does this help?

     

    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics |  Print | Media Specialists
    www.alt-web.com/
    www.twitter.com/altweb

     
    |
    Mark as:
  • Currently Being Moderated
    May 1, 2009 1:39 PM   in reply to Erik Arckens

    From what I read, there is no way for the line under the header to automatically adjust according to the available space...

     

    Not necessarily. The H1 and H2 tags are block-level tags which automatically expand/shrink to fill the space available, so I think all you need is the border-bottom.

     

    You should open the page that you want to emulate in a browser and then use View > Page Source (in Firefox) to see how they did it.

     

    HTH,

    Randy

     
    |
    Mark as:
  • Currently Being Moderated
    May 2, 2009 9:35 AM   in reply to Erik Arckens

    You could add a margin. This example assumes the floated image is 400px wide and give it 20px gutter space.

     

    .short {

      border-bottom: 1px solid red;

      width: 400px;

      margin: 0 0 0 420px;
    }

     

    To have the bottom border extend all the way to the right of its container, just delete the width property.

     

     

    --
    Mark A. Boyd
    Keep-On-Learnin' :-)

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points