Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > CSS > CSS Cascading Style Sheets
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
CSS Cascading Style Sheets All issues relating to Cascading Style Sheets (CSS).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the CSS Cascading Style Sheets section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old July 3rd, 2015, 01:51 AM
Authorized User
Points: 259, Level: 5
Points: 259, Level: 5 Points: 259, Level: 5 Points: 259, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2013
Posts: 59
Thanks: 10
Thanked 0 Times in 0 Posts
Default menu items fall out of place when minimizing window

Hello,
my cs file is this:
*{font-family:Arial, Sans-Serif;}
body{width:100%;margin:0;background-color:#000000;color:grey;}
a{text-decoration:none;color:grey;}
a:hover{text-decoration:underline;color:purple;}
h1{font-size:20px;text-align:center;}
h2{font-size:14px;color:#7773A1;margin-top:10px;}
#PageWrapper{width:100%;background-color:#000000;}
nav{width:80%;height:0px;padding-top:0px;background-color:black;}
nav a{color:#fff;}
.MainMenu{border:1px solid #000000;width:75%;height:19px;background-color:black;padding-left:25%;}
.MainMenu ul li{width:180px;position:relative;z-index:9999;text-align:center; }
.beforeHead{width:100%;background-color:#B92F8F;height:30px;}
header{background-color:white;width:100%;height:140px;background-image:url(Images/Logo.png);background-repeat:no-repeat;background-position:center;}
header a{width:100%;height:86px;display:block;}
section#MainContent{font-size:1em;width:96%;background-color:#000000;color:grey;min-height:505px;padding-left:2%;padding-right:2%;}
footer{width:100%;clear:both;position:relative;bot tom:0px;text-align:center;font-size:0.7em;font-weight:bold;line-height:20px;color:grey;}
.Introduction{font-style:italic;color:#3e3e3e;}
.MyButton{color:White;}
ul.level1{font-size:14px;font-weight:bold;height:19px;line-height:19px;}
ul.level1 .selected{background-color:#000000;}
a.level1{padding-left:25px !important;}
a.level2{background-color:black;padding-left:8px;}
a.level1:hover, a.level2:hover{background-color:white;color:black;}
img{border:0;}
.ErrorMessage{color:red;}
.PleaseWait{height:32px;width:500px;background-image:url(Images/PleaseWait.gif);background-repeat:no-repeat;padding-left:40px;line-height:32px;}
.Attention{border:4px solid red;padding:10px 0;width:100px;margin:auto;display:block;text-align:center;}
.ItemContainer{width:600px;list-style-type:none;clear:both;}
.ItemContainer li{height:300px;width:200px;float:left;}
.ItemContainer li img{width:180px;margin:10px 20px 10px 0;}
.Summary{font-style:italic;display:block;}
.startLogin a{font-size:x-large;color:purple;}
.logIn{float:right;font-weight:bold;padding-right:1%;}
.hr{color:grey;font-size:small;width:50%}
.hr1{color:grey;font-size:small;width:100%}
.contactUs{padding-left:45%;font-size:x-large;}
.textbox{float:right;}


When I am resizing the window the main menu items fall out of place!
check www.easatelier.com/homepage.aspx
if you want to understand what I mean.
All I want is the menu items to be in the middle of the page. When I minimize the page I still want the items to center in the middle of the page.

Please advice and thank you!
Reply With Quote
  #2 (permalink)  
Old July 7th, 2015, 10:46 AM
Imar's Avatar
Wrox Author
Points: 71,164, Level: 100
Points: 71,164, Level: 100 Points: 71,164, Level: 100 Points: 71,164, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,948
Thanks: 79
Thanked 1,555 Times in 1,532 Posts
Default

Try setting a fixed width on your MainMenu.

Note that this will cause a scrollbar to appear when the window isn't large enough. This will also cause issues on mobile devices.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Menu items fall out of place after minimizing dksellou BOOK: Beginning ASP.NET 4.5.1 : in C# and VB 2 July 1st, 2015 11:49 AM
minimizing the window drops one menu item below the main menu dksellou ASP.NET 4.5 General Discussion 5 November 14th, 2014 03:04 AM
Blank items in menu ricardor ASP.NET 2.0 Basics 2 December 18th, 2009 05:08 AM
CH 15 Context Menu - Element Menu Items Razzy The Pug BOOK: Ivor Horton's Beginning Visual C++ 2005 2 November 9th, 2008 02:53 PM
Menu Items JoBi C# 0 October 20th, 2004 08:51 PM



All times are GMT -4. The time now is 07:40 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.