Need some help with html/css layout

Posted on 2013-01-10
Last Modified: 2013-01-11
I am trying to center the menu and add some images in the div. For some reason it seems off. It doesn't center well.
What is the best practice for top menus? I read something about centering in css > html.

Any help is appreciated.

.topmenu a{ 
float: left;
 margin: 15px;
-webkit-transition: margin 1.5s ease-out;
 -moz-transition: margin 1.5s ease-out;
 -o-transition: margin 1.5s ease-out;

.topmenu a:hover { margin-top: 2px; color:#afa9d9} 

Open in new window

<div class="topmenu">	

	  <a href="#!/page_About"style="text-decoration:none"><strong>About</strong></a>
	<a href="#!/page_Portfolio"style="text-decoration:none"><strong>Portfolio</strong></a>	
	<a href="#!/page_Services"style="text-decoration:none"><strong>My Services</strong></a>
	<a href="#!/page_Reviews"style="text-decoration:none"><strong>Reviews</strong></a>	
	<a href="#!/page_Contact"style="text-decoration:none"><strong>Contact</strong></a>


Open in new window

Question by:CavemanLawyer
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
LVL 30

Expert Comment

ID: 38764706
Generally you would give your menu a width and then use margin:0 auto; to center it. I see you have position:static set right now, which would not work with the margin: 0 auto;. Are you trying to keep it on top of the other elements?

Author Comment

ID: 38764757
There won't be anything under it but yes it would need to be the top layer. I was thinking about trying to use z index and make it a top layer. Just not sure what would work and what is best for browser comparability.

Author Comment

ID: 38764862
I applied the changes you suggested but was unable to fix the issue.
RoboForm Secure Password Management System

RoboForm Everywhere - Superb Browser Support
Windows / Apple / IOS / Android / Linux / Chrome OS
Use different complex passwords everywhere
Best Secure Password Management by far
Synchronize all of your devices instantly
Safe, Secure & Highly Recommended!

LVL 30

Expert Comment

ID: 38765424
Can we see a live link?

Author Comment

ID: 38765498
Sure, here is a link:

Author Comment

ID: 38765910

Author Comment

ID: 38766093
It looks centered but it is off to the left. Not sure why..
LVL 30

Accepted Solution

LZ1 earned 500 total points
ID: 38766983
Give the div that has the inline style of margin-left:30% the following CSS:

    margin: 0 auto;
    width: 481px;

Author Closing Comment

ID: 38768864

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question