1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Div or table?

Discussion in 'CSS' started by cj1223, Sep 20, 2006.

  1. #1
    This apply to a navigation box, Would it be beter to use a div. with <hr/> and absolute positioning in bettween each link or a common table. I would rather use divs but i hear it isnt good to give a div absolute positioning, usaly if i dont give absolute it doesnt position right.
     
    cj1223, Sep 20, 2006 IP
  2. cj1223

    cj1223 Well-Known Member

    Messages:
    287
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    108
    #2
    i seem to always want to use absolute positioning in a div to position somthing but if its not good i dont want to do it. Im still trying to get css and all of its abilities. i try to use class now if i need to absolute pos. somthing but im not even sure if thats correct
     
    cj1223, Sep 20, 2006 IP
  3. Mano70

    Mano70 Peon

    Messages:
    42
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    No need to use absolute positioning. I would stay away from that.

    Why would you use <hr /> between each link? If this is a menu you should use a unordered list, because a menu is a list (of links). Using unordered list is more semantically correct.
    <ul>
    <li><a href="#">link 1</a></li>
    <li><a href="#">link 2</a></li>
    </ul>

    And then you style the ul, you don't have to put a class on each and every li or a if your menu isn't exceptional complicated.
     
    Mano70, Sep 20, 2006 IP
  4. cj1223

    cj1223 Well-Known Member

    Messages:
    287
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    108
    #4
    Cool thanks i never realized that, Should the unorderd list be in a div, I definaly dont want to use a table. before i just realized about an unorderd list i used to just compile the links into a div and and add <hr/> after each link to give it the table effect. Im still kinda new and I suck at useing css the proper way all the time. None of my sites can pass the css anylasis or what ever you call it.
     
    cj1223, Sep 20, 2006 IP
  5. Mano70

    Mano70 Peon

    Messages:
    42
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Mano70, Sep 21, 2006 IP
  6. cj1223

    cj1223 Well-Known Member

    Messages:
    287
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    108
    #6
    i did one of the unorderd list today for the first time and i think an <hr/> would look better after each link, i like the line after each link effect, is there a diffrent way i should use enstead of <hr/>?
     
    cj1223, Sep 21, 2006 IP
  7. SoKickIt

    SoKickIt Active Member

    Messages:
    305
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    70
    #7
    
    <ul class="menu">
    <li><a href="#">link 1</a></li>
    <li><a href="#">link 2</a></li>
    </ul>
    
    HTML:

    CSS:

    
    .menu li {
    border-bottom: #000 1px solid;
    }
    
    Code (markup):
     
    SoKickIt, Sep 21, 2006 IP
  8. thejared

    thejared Peon

    Messages:
    382
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #8
    I mostly use tables for my sites.
     
    thejared, Sep 21, 2006 IP
  9. rosiee007

    rosiee007 Notable Member

    Messages:
    3,352
    Likes Received:
    179
    Best Answers:
    0
    Trophy Points:
    230
    #9
    An unordered list can give a really good navigation. See this site for an example. And theres no need to put the unordered list in a table
     
    rosiee007, Sep 21, 2006 IP
  10. Pat Gael

    Pat Gael Banned

    Messages:
    1,331
    Likes Received:
    68
    Best Answers:
    0
    Trophy Points:
    0
    #10
    If you are only looking for developing a navigational menu, I would opt for my favorite resource: www.css.maxdesign.com.au/listamatic

    All type of vertical and horizontal CSS menus to choose from.
     
    Pat Gael, Sep 21, 2006 IP
  11. cj1223

    cj1223 Well-Known Member

    Messages:
    287
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    108
    #11
    cool thanks for the help, i understand now,and no more domb navigation menus:)
     
    cj1223, Sep 21, 2006 IP
  12. Lightning-Software

    Lightning-Software Well-Known Member

    Messages:
    204
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    110
    #12
    Sometimes I style a table for navigation and sometimes a unordered list. They both seem to work good. I usually style like this for link, visited, hover and pass a php variable if i want active pages to stay highlighted,

    display: block; padding: 0px; margin: 0px; background-color: #7b7b7b; font: 14px Verdana; color: #f7c52c; text-decoration: none; font-weight: bold;
     
    Lightning-Software, Sep 27, 2006 IP
  13. x3sphere

    x3sphere Member

    Messages:
    55
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    43
    #13
    I always use divs, only use tables for tabular data..
     
    x3sphere, Sep 27, 2006 IP