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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:14:41+00:00 2026-06-04T07:14:41+00:00

OK. Thank you for giving me your precious time to look over this problem.

  • 0

OK. Thank you for giving me your precious time to look over this problem.

Basically, I have a “div” which I use at the top of the screen for my navigation bar. It’s a simple navigation bar, just a 80% wide “div” with some text that changes color on hover.

The problem that I’m having is; the text automatically starts at the top of the “div” and I’d like to center it. I’ve tried margins, paddings, floats, “div’s” inside “div’s” etc. etc.

I will post the code here for the navigation bar and if you happen to know how to fix it can you please let me know?

Thanks

HTML CODE:

<div class="header">
            <ul>
                <li><a href="#">Home</a></li>
                <li><a href="#">Repairs</a></li>
                <li><a href="#">Tune up/ Viruses</a></li>
                <li><a href="#">System Builds</a></li>
                <li><a href="#">Cables</a></li>
                <li><a href="#">Contact us</a></li>
                <li><a href="#">Find us</a></li>
                <li><a href="#">Links</a></li>
               <!-- <li><a href="/"><img src="facebook.png"></a></li>   -->
            </ul>
    </div>

CSS CODE:

.header ul { margin:0px;}
        div.header
        {
            width: 80%;
            height: 40px;
            margin-top: none;
            margin-bottom: none;
            margin-left: auto;
            margin-right: auto;
            border-top: none;
            border-left: none;
            border-right: none;
            border-bottom: none;
            background-color:  #575757;
        }
        li
        {
            display: inline;
            font-family: 'open sans,' arial;
            padding-right: 10px;
            padding-top: 10px;
            margin-left: 10px;
            font-size: 20px;
        }
        li a 
        {
            text-decoration: none;
            color: white;
        }
        li a:hover
        {
            color: #00ccff;
        }
  • 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-06-04T07:14:42+00:00Added an answer on June 4, 2026 at 7:14 am

    You can use a bunch of things to vertically center an element.

    The best one for one line elements (elements with just one line of text, for example) is line-height

    Set the line-height to be equal the height of its parent:

    li { line-height: 40px; }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

thank you for taking the time and interest reading this and hopefully helping me
Here's the problem. In my app, I have 5 tabs which contains activities. In
I have problem with this code, it's working on debug environment. On the instruments
I have a peculiar issue which is giving me headaches... The following code works
could really use your help, understanding this complex rails issue I've been banging by
Problem Solved, thank you all for your help! I've run into a problem that
I have this time series data: timestamp depth from_sensor_to_river_bottom Depth_from_river_surface_to_bottom 1 2012-05-23 18:30:12-05 16.4
I have an query that has been giving me trouble. I think there is
Thank you in advanced for taking the time to read my post. I will
thank you for reading. For a shell command to wget, something like this works:

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.