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 67683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T19:17:54+00:00 2026-05-10T19:17:54+00:00

My HTML is as follows: <ul id=nav> <li><a href=./>Home</a></li> <li><a href=/About>About</a></li> <li><a href=/Contact>Contact</a></li> </ul>

  • 0

My HTML is as follows:

<ul id='nav'>     <li><a href='./'>Home</a></li>     <li><a href='/About'>About</a></li>     <li><a href='/Contact'>Contact</a></li> </ul> 

And my css:

#nav {     display: inline; } 

However the whitespace between the li’s shows up. I can remove the whitespace by collapsing them like so:

<ul id='nav'>     <li><a href='./'>Home</a></li><li><a href='/About'>About</a></li><li><a href='/Contact'>Contact</a></li> </ul> 

But this is being maintained largely by hand and I was wondering if there was a cleaner way of doing it.

  • 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. 2026-05-10T19:17:54+00:00Added an answer on May 10, 2026 at 7:17 pm

    Several options here, first I’ll give you my normal practice when creating inline lists:

    <ul id='navigation'>   <li><a href='#' title=''>Home</a></li>   <li><a href='#' title=''>Home</a></li>   <li><a href='#' title=''>Home</a></li> </ul> 

    Then the CSS to make it function as you intend:

    #navigation li    {     display: inline;     list-style: none;   } #navigation li a, #navigation li a:link, #navigation li a:visited   {     display: block;     padding: 2px 5px 2px 5px;     float: left;     margin: 0 5px 0 0;   } 

    Obviously I left out the hover and active sets, but this creates a nice block level navigation, and is a very common method for doing this while still keeping with standards. /* remember to tweak to your liking, add color to the background, et cetera */

    If you would like to keep it just with text and just inline, no block elements I believe you’d want to add:

       margin: 0 5px 0 0; /* that's, top 0, right 5px, bottom 0, left 0 */ 

    Realizing you would like to REMOVE the whitespace, just adjust the margins/padding accordingly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 66k
  • Answers 66k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Upon further research, I realized that I had no Installer… May 11, 2026 at 11:34 am
  • added an answer Give this a shot! one | <span style='padding-left: 20px; background:… May 11, 2026 at 11:34 am
  • added an answer Given a string input, convert to integer, divide by 100.0… May 11, 2026 at 11:34 am

Related Questions

My HTML is as follows: <ul id=nav> <li><a href=./>Home</a></li> <li><a href=/About>About</a></li> <li><a href=/Contact>Contact</a></li> </ul>
My HTML is all marked up, ready to make it rain CSS. The problem
I have found that my HTML is, to be honest, very clunky. Small, simple
My HTML has cell = document.createElement(td); cell.appendChild(document.createTextNode(contents)); cell.setAttribute('width', '100'); The following syntax is not
One of my biggest typographical frustrations about HTML is the way that it mangles
I am include a huge javascript file(500K) in my HTML. Is there a smart
I want to show first element that is hidden by jquery. my html code
I have a problem in integrating PHP and JQuery: My main file is MyFile.html
My question is related to HTML, and PURE html. I am working on a
This question is a follow up to my previous question about getting the HTML

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.