Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Ezn
    Ezn is offline
    New Coder
    Join Date
    Aug 2006
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CSS justifying spans across fixed-width div

    Content | Comprehension | Cool Stuff | Differentiated Instruction | About GRS

    This text navigation above goes in a DIV that is 720px wide. Want to put each item in a span and then have the div justify the spans evenly across the 720px div.

    Each item should be in a span because I need a normal space between words in two-word items and bigger spaces between the spans and the verticle bars. Need no line breaks.

    .subnav div {
    width: 720px;
    height:22px;
    border: 0px;
    margin: 0px auto;
    text-align:justify;
    vertical-align: middle;
    }
    <div class="subnav">
    <span class="subdiv">Content</span> |
    <span class="subdiv">Comprehension</span> |
    <span class="subdiv">Cool Stuff</span> |
    <span class="subdiv">Differentiated Instruction</span> |
    <span class="subdiv">About GRS</span>
    </div>

    Having trouble vertical-aligning to middle also.

    Is this possible? Any tips or hints? Thanks!

  • #2
    Senior Coder
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    2,636
    Thanks
    0
    Thanked 0 Times in 0 Posts
    A much better (and semantic) option would be to use a list.

    http://css.maxdesign.com.au/listamatic/horizontal33.htm

    Lots of other types of menus listed on there also which should show you how you could achieve this.


  •  

    Posting Permissions

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