is there any way to add a heading to my unordered lists in css?

Discussion in 'CSS' started by whiteblue1942, Feb 18, 2008.

  1. #1
    if so can someone tell me the declaration?
     
    whiteblue1942, Feb 18, 2008 IP
  2. Marfig

    Marfig Peon

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Can you please be more specific?
     
    Marfig, Feb 18, 2008 IP
  3. whiteblue1942

    whiteblue1942 Peon

    Messages:
    573
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    0
    #3
    haha nevermind im an idiot i forgot there was a <h1> tag
     
    whiteblue1942, Feb 18, 2008 IP
  4. Ascendancy

    Ascendancy Active Member

    Messages:
    1,721
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    90
    #4
    Couldn't you just put a heading tag into your ul? Then style it from there with a class or something.
     
    Ascendancy, Feb 18, 2008 IP
  5. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #5
    First off, H1 is meant to be the title of the page. If you want to add a heading to a list, do this instead, then style the element and the menu to taste:

    
    <div id="menu">
    	<b>Site Navigation</b>
    	<ul>
    		<li><a href="#">Menu Link</a></li>
    		<li><a href="#">Menu Link</a></li>
    		<li><a href="#">Menu Link</a></li>
    		<li><a href="#">Menu Link</a></li>
    		<li><a href="#">Menu Link</a></li>
    		<li><a href="#">Menu Link</a></li>
    	</ul>
    </div>
    
    Code (markup):
     
    Dan Schulz, Feb 18, 2008 IP
  6. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #6
    Uhm Dan, if it's a heading, it should be a header tag, not bold tags. As such a H2 or lower would be appropriate.

    Though yes, a H1 is indeed inappropriate.
     
    deathshadow, Feb 19, 2008 IP
  7. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I don't know what the rest of his code looks like so I went with the B element to identify the block as a menu rather than waste a heading on it when I don't know what the semantic structure of his site even looks like.

    Though to be perfectly honest, this is one of those times when I wish IE supported generated content. So for the time being, consider it a placeholder.
     
    Dan Schulz, Feb 19, 2008 IP
  8. Maujor

    Maujor Peon

    Messages:
    30
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #8
    How about to get rid of the DIV?

    <h or b>Site Navigation</h or b>
    	<ul  id="menu">
    		<li><a href="#">Menu Link</a></li>
    		<li><a href="#">Menu Link</a></li>
    		<li><a href="#">Menu Link</a></li>
    		<li><a href="#">Menu Link</a></li>
    		<li><a href="#">Menu Link</a></li>
    		<li><a href="#">Menu Link</a></li>
    	</ul>
    
    Code (markup):
     
    Maujor, Feb 19, 2008 IP
  9. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #9
    That's even better, as you don't need the div... but we didn't know what you were using it for. Stu Nichols uses a div around his menus and I still haven't gotten them apart yet.
     
    Stomme poes, Feb 19, 2008 IP
  10. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Because the content is semantically related, and there's always the possibility that the menu title and menu may have to be floated. In this case, using a DIV to contain the pair just makes the most sense and uses the least amount of code necessary without sacrificing the design.

    If there wasn't a need for the title, and/or if Internet Explorer 6/7 supported generated content (apparently IE 8 will if you "opt in" for IE 8 standards mode - since the Acid2 test relies on generated content among other things) then the DIV wouldn't even be necessary.

    But until then this is the best we've got. :(
     
    Dan Schulz, Feb 19, 2008 IP
  11. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Could you elaborate what you mean by generated content? We generate content with forms and this displays so far okay... I'm guessing then that you mean something else... what?
     
    Stomme poes, Feb 19, 2008 IP
  12. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Dan Schulz, Feb 19, 2008 IP