Solved

Need some help with html/css layout

Posted on 2013-01-10
9
288 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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
This article offers some helpful and general tips for safe browsing and online shopping. It offers simple and manageable procedures that help to ensure the safety of one's personal information and the security of any devices.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

706 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

12 Experts available now in Live!

Get 1:1 Help Now