www.webdeveloper.com
Results 1 to 4 of 4

Thread: header 2 help

  1. #1
    Join Date
    Mar 2004
    Location
    none
    Posts
    58

    header 2 help

    h2 tag...how can i get multiple of them in the CSS.

    I need one for the navigation at the right which i have prefectly placed and now i need it for my middle div which the teal bar is bigger than the one in the navigation menu.

    can i do it like this?

    h2#navAlpha{
    }

    and

    h2.content{
    }

    it didnt seem to work for me when i tried it, thanks

    http://marlinsclubhouse.net/index.html

  2. #2
    Join Date
    Jul 2004
    Location
    Sendai, Japan
    Posts
    1,273

  3. #3
    Join Date
    Nov 2003
    Location
    Jerryville, Tejas
    Posts
    11,715
    To elaborate on what BonRouge said, here are some representative CSS selectors and examples of the HTML where they would apply.
    Code:
    CSS: h2#navalpha {}
    HTML: <h2 id="navalpha">yada</h2>
    
    CSS: #navalpha h2 {}
    HTML: <div id="navalpha"><h2>yada</h2></div>
    
    CSS: h2.content {}
    HTML: <h2 class="content">yada</h2>
    
    CSS: .content h2 {}
    HTML: <div class="content"><h2>yada</h2></div>
    So what you need to do is pull the width: out of h2 {} and put an appropriate one into each of the "contained" h2s.

    #navAlpha h2 { width: 142px }
    .content h2 { width: 99% }
    #navBeta h2 { width: 182px }

    Note: these were hacked in FF and not checked with IE.
    Last edited by ray326; 04-06-2005 at 11:04 PM.
    "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." Brian W. Kernighan

  4. #4
    Join Date
    Jul 2004
    Location
    Sendai, Japan
    Posts
    1,273

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles