Solved

Need some help with html/css layout

Posted on 2013-01-10
9
290 Views
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{ 
color:#ffffff;
position:static;
float: left;
left:30%;
 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>

	</div>

Open in new window

0
Comment
Question by:CavemanLawyer
  • 6
  • 3
9 Comments
 
LVL 30

Expert Comment

by:LZ1
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?
0
 

Author Comment

by:CavemanLawyer
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.
0
 

Author Comment

by:CavemanLawyer
ID: 38764862
I applied the changes you suggested but was unable to fix the issue.
0
 
LVL 30

Expert Comment

by:LZ1
ID: 38765424
Can we see a live link?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:CavemanLawyer
ID: 38765498
Sure, here is a link:

www.geniesgameroom.com/ee/
0
 

Author Comment

by:CavemanLawyer
ID: 38765910
bump?
0
 

Author Comment

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

Accepted Solution

by:
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;
0
 

Author Closing Comment

by:CavemanLawyer
ID: 38768864
thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
SSL stands for “Secure Sockets Layer” and an SSL certificate is a critical component to keeping your website safe, secured, and compliant. Any ecommerce website must have an SSL certificate to ensure the safe handling of sensitive information like…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
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).

863 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now