Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7552131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T10:40:57+00:00 2026-05-30T10:40:57+00:00

I am very picky and want to create a menu going across the page

  • 0

I am very picky and want to create a menu going across the page with spans and divs (well, I have navs and spans as I am trying in html5, but it isn’t necessary so I have simplified my question!). What it boils down to is basically this.

I have this code:


< html>
  < head>
    < title>Test< /title>
    < style>
      body * { border: 1px solid black; background-color: #999999; }
      span { float:left; display: block; width: 33.33%; margin: 5px; }
      .page { margin: 10px; background-color: #0000ff; }
      .menu { margin: 5px; background-color: #00ffff; }
    < /style>
  < /head>
< body>
  < div class='page'>
    < div class='menu'>
      < span>one< /span>
      < span>two< /span>
      < span>three< /span>
    < /div>
  < /div>
< /body>
< /html>


And I want to make it so that my spans all fit inside the blue div. perfectly.

I used to have a table which displayed this perfectly, but trying to write my code neater. Any advice? 🙂

Many thanks in advance!

Bob

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T10:40:58+00:00Added an answer on May 30, 2026 at 10:40 am

    What I ended up with was basically a combination of a few of them, but the actual answer I was after was to basically set all the borders/margins/padding of what used to be my span tags to 0 then use my anchor tags as block elements to add borders/margins etc to. Hopefully will work in all browsers and is a neat solution.

    Thanks to you all for your help – couldn’t have gotten to this without you! 😀

    Real-World js fiddle

    HTML:

      <nav>
        <ul>
          <li style='width: 33.3%;'><a href='default.aspx'>One</a></li>
          <li style='width: 33.3%;'><a href='page2.aspx'>Two</a></li>
          <li style='width: 33.3%;'><a href='page3.aspx'>Three</a></li>
        </ul>
      </nav>
    

    CSS:

    nav {
        display: block;
        background-color: #000000;
        border: solid 1px #ff0000;
        margin: 10px;
        padding: 5px;
        overflow: hidden;
    }
    nav>ul {
        width: 100%;
        float: left;
        margin: 0px;
        padding: 0px;
    }
    nav li {
        display: block;
        float: left;
        border-width: 0px;
        margin: 0px;
        padding: 0px;
    }
    nav a {
        display: block;
        border: solid 1px #ff0000;
        background-color: #ffffff;
        margin: 1px;
        padding: 3px;
        text-align: center;
    }​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a simply login page. I want validation on that page
We have a nested menu within our page where drag and drop is enabled
Very simple + silly question: Does clojure provide multi maps? I currently have something
Very simple question... I have an array of pixels, how do I display them
Very new to python and can't understand why this isn't working. I have a
very often I like to have my movieclip code inside the movieclip (on a
So, I want to create car racing for my RPG game's players. Player can
I really want to create a stunning-looking GUI desktop application that looks like, for
I have made an application which calls the phone's contact list but i want
I have installed Maven 3.0.4 and now want to run already created java project

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.