Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
css navigation menu not lining up with my header div image.
Old 03-31-2009, 02:26 PM css navigation menu not lining up with my header div image.
Webmaster Talker

Posts: 611
Trades: 0
hi, my css navigation menu is not linking up centered with my header div, or the image in it. it is off to the left. i have the navigation inside a centered div but its not centering. also, my #left_content image is not showing up in browser except for way below the #wrapper div to the left, and its not lining up with the header div either it goes all the way to the left. any help greatly appreciated. thanks .derek

EDIT- i added left padding to the containing div of the navigation to move it to the center. is that the correct way to center a list navigation in the page?

here is the page im talking about

http://derekvanderven.com/jewel_gallery/home.html

here is the css

Code:
@charset "utf-8";
/* CSS Document */

body {
margin: 0;
height: 0;
}

#wrapper {
margin: 0 auto 0 auto;
width: 1007px;
height: 863px; 
background-image: url(home/background.jpg);
     background-repeat:repeat-x;
}

#content_wrapper {
margin: 0 auto 0 auto;
width: 801px;
height: 863px;
}

#header {
margin: 0 auto 0 auto;
width: 801px;
height: 100px;
background-image: url(home/header.jpg);
     background-repeat:no-repeat;
     }
#left_content{
float: left;
height:840px;
width: 400px;
background-color: black;
background-image: url(home/vertical_jewels.jpg);
     background-repeat:no-repeat;
     background-position: right;
     text-align: left;
     padding-left: 15px;
     
}

     
#navigation_div {
margin: 0 auto 0 auto;
width: 801px;
height: 25px;
}     
    /***********************css navigation code*****************/ 
ul#navigation
{
    font-size:.9em;
    font-family: "Courier New";
    margin: 0 auto;
    padding: 0;
    list-style-type: none;
    background: ;
    color: #FFF;
    float: left;
    width: 100%;
}    

ul#navigation li
{
    display: inline;
}

ul#navigation a
{
    float: left;
    margin: 0 auto;
    display:block;
    padding: .2em 2em;
    text-decoration:none;
    color: #fff; /* text color*/
    background: #A06710; /* background color */
    border-width: 1px;
    border-color: #ffe #aaab9c #ccc #fff;
    border-style: solid;    
}

ul#navigation a:hover
{
    color: #995522; /* hover text */
    background: black; /* background color may be transparent value*/
    border-color: #aaab9c #fff #fff #ccc;
} 

/*********************END CSS NAVIGATION CODE ********************/
and here is the html

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="jewel_gallery.css" rel="stylesheet" type="text/css"/>

<title>Jewel Gallery</title>
</head>

<body>

    <div id="wrapper">
         <div id="content_wrapper">
        <div id="header">
        </div>
        <div id="navigation_div">
        <ul id="navigation">
        <li><a href="home.html">Home</a></li>
        <li><a href="about.html">Education</a></li>
        <li><a href="services.html">Ask The Experts</a></li>

        <li><a href= "archive.html">Archive</a></li>
        <li><a href="contact.html">Contact Us</a></li>
        
        </ul> </div><!--end navigation-->
        </div><!--end navigation_div-->
          <div id="left_content">
          </div> <!--end leftcontent-->
          </div><!--end contentwrapper-->
        
        </div> <!--end wrapper div-->
</body>
</html>

Last edited by silverglade; 03-31-2009 at 04:31 PM..
silverglade is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-31-2009, 04:40 PM Re: css navigation menu not lining up with my header div image.
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
Well, you do have an extra </div> in there for one thing.

You have ul#navigation floated left - so that's exactly what it's doing.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 03-31-2009, 04:52 PM Re: css navigation menu not lining up with my header div image.
Webmaster Talker

Posts: 611
Trades: 0
please, where is the extra div? navigation and navigation_div are 2 different divs. also, i tried margin: 0 auto 0 auto; on the ul#navigation and it still is to the left. any more help greatly appreciated. i still cant get my leftcontent to go inside the contentwrapper, it jumps outside of it.
silverglade is offline
Reply With Quote
View Public Profile
 
Old 03-31-2009, 05:20 PM Re: css navigation menu not lining up with my header div image.
Average Talker

Posts: 23
Name: Nikola
Trades: 0
I think you just need

# navigation_div {
margin: auto;
width: 801px;
hight: 25px;
}

that's working in mine code...
__________________

Please login or register to view this content. Registration is FREE

Last edited by nikolla983; 03-31-2009 at 05:27 PM..
nikolla983 is offline
Reply With Quote
View Public Profile Visit nikolla983's homepage!
 
Old 03-31-2009, 05:28 PM Re: css navigation menu not lining up with my header div image.
Webmaster Talker

Posts: 611
Trades: 0
the navigation menu is still to the left. here is the code im using for it.
and #left_content is popping out of #content_wrapper for some reason. it floats left right out of #content_wrapper.

Code:
# navigation_div {
margin: auto;
width: 801px;
height: 25px;
} 


ul#navigation
{
    font-size:.9em;
    font-family: "Courier New";
    margin: auto;
    padding: 0;
    list-style-type: none;
    
    color: #FFF;     
    width: 100%;
}

Last edited by silverglade; 03-31-2009 at 05:52 PM..
silverglade is offline
Reply With Quote
View Public Profile
 
Old 04-01-2009, 05:13 AM Re: css navigation menu not lining up with my header div image.
Experienced Talker

Posts: 38
Name: pravash chamling rai
Trades: 0
here is the solution dude !!!!!

well CSS3 will be the most easier solution to ur problem !!! but let me go through some way around !!!! dude, change you 100% to pixel and use margin-left to push your ul from the left !!!!!
mindlesswizard is offline
Reply With Quote
View Public Profile Visit mindlesswizard's homepage!
 
Old 04-01-2009, 05:23 AM Re: css navigation menu not lining up with my header div image.
Experienced Talker

Posts: 38
Name: pravash chamling rai
Trades: 0
and remember one thing !!!! the margin width and the total width of your ul should not exceed the width of the main container !!!
mindlesswizard is offline
Reply With Quote
View Public Profile Visit mindlesswizard's homepage!
 
Old 04-01-2009, 06:50 AM Re: css navigation menu not lining up with my header div image.
Webmaster Talker

Posts: 611
Trades: 0
thank you, i fixed it with padding, centering it that way, which may not be the best solution. but it worked. also, #left_content is popping out of #content_wrapper for some reason. it floats left out of #content_wrapper.any more help greatly appreciated. thank you. derek

the page is here, notice the leftcontent image of jewels popped out way below the containing div. http://derekvanderven.com/jewel_gallery/home.html

Last edited by silverglade; 04-01-2009 at 07:16 AM..
silverglade is offline
Reply With Quote
View Public Profile
 
Old 04-01-2009, 07:55 AM Re: css navigation menu not lining up with my header div image.
Webmaster Talker

Posts: 611
Trades: 0
i made some major adjustments, and the only things wrong now are when i try to add padding to the rightcontent div for text, it pushes the right_nav area down and out. also, the links on the left in firefox dont go orange when i hover. any help greatly appreciated. here is the page now.

http://derekvanderven.com/jewel_gallery/home.html

here is the css



Code:
@charset "utf-8";
/* CSS Document */

body {
margin: 0;
height: 0;
background-image: url(home/background.jpg);
     background-repeat:repeat-x;
}





#header {
margin: 0 auto 0 auto;
width: 801px;
height: 100px;
background-image: url(home/header.jpg);
     background-repeat:no-repeat;
     }
     
#wrapper {
margin: auto;
width: 801px;
height: 703px;
background-color: black;
}

#left_content{
float: left;
height:703px;
width: 400px;
background-color: black;
 background-image: url(home/vertical_jewels.jpg);
     background-repeat:no-repeat;
     background-position: right top;
     text-align: left;
     
     border-right: 1px dotted gray;

     
}

 #right_content{
float: left;
height:703px;
width: 250px;
background-color: black;
color: white;
padding-top:15px;
 
}

#right_nav {
float: left;
height: 703px;
width: 150px;
background-color: black;
}

.nav_header {
color: #B76C28;
font-size: large;
}  
#right_nav a
{
color: #B76C28;
text-decoration: none;
}
     

 
    /***********************css navigation code*****************/ 
ul#navigation
{
    font-size:.9em;
    font-family: "Courier New";
    margin: auto;
    padding-left: 60px;
    list-style-type: none;
    
    color: #FFF;     
    width: 100%;
}    

ul#navigation li
{
    display: inline;
}

ul#navigation a
{
    float: left;
    margin: 0 auto;
    display:block;
    padding: .2em 2em;
    text-decoration:none;
    color: #fff; /* text color*/
    background: #A06710; /* background color */
    border-width: 1px;
    border-color: #ffe #aaab9c #ccc #fff;
    border-style: solid;    
}

ul#navigation a:hover
{
    color: #995522; /* hover text */
    background: black; /* background color may be transparent value*/
    border-color: #aaab9c #fff #fff #ccc;
} 

/*********************END CSS NAVIGATION CODE ********************/

/*****START LEFTCONTENT TEXT ****************/

#left_nav {
width: 177px;
height: 703px;
padding-left: 15px;
text-align: left;
padding-top: 15px;
}

.left_nav { 
font-family:Arial,Helvetica,sans-serif;
font-size:13px;
line-height:25px;
}

.small_nav:hover { 
color:#EA4C03;
text-decoration:none;
}
.small_nav:link { 
color:#666666;
text-decoration:none;
}
a:hover { 
color:#EA4C03;
}
a:link { 
color:#E47941;
}
a:visited {
decoration: none;
}
.small_nav { 
color:#666666;
text-decoration: none;
line-height: 25px;
}
 
.style1 { 
color:#666666;
}
and here is the html

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="jewel_gallery.css" rel="stylesheet" type="text/css"/>

<title>Jewel Gallery</title>
 
 
</head>

<body>

     
       
        
        <div id="wrapper">
        <div id="header">
        </div>
        <ul id="navigation">
        <li><a href="home.html">Home</a></li>
        <li><a href="about.html">Education</a></li>
        <li><a href="services.html">Ask The Experts</a></li>

        <li><a href= "archive.html">Archive</a></li>
        <li><a href="contact.html">Contact Us</a></li>
        
        </ul> <!--end navigation-->
       
        
        <div id="left_content">
        
        <div id="left_nav">
        
        <p>
        <strong style="color: rgb(255, 255, 255);">Ultimate Bauble Odyssey</strong>
        <br/>
        <span class="style1">
        <a class="small_nav" href="design-directory.html">Designer Directory</a>
        <br/>
        <a class="small_nav" href="in-the-salon.html">In the Salon</a>
        <br/>
        <a class="small_nav" href="up-for-auction.html">Up for Auction</a>
        <br/>
        <a class="small_nav" href="special-pieces-&-places.html">Special Pieces & Places</a>
        </span>
        <br/>
        </p>
        
        <p>
        <strong style="color: rgb(255, 255, 255);"> The Deal On Diamonds</strong>
        <span class="style1">
        <br/>
        <a class="small_nav" href="beauty-and-pricing.html">Beauty & Pricing</a>
        <br/>
        <a class="small_nav" href="special-stones.html">Special Stones</a>
        </span>
        <br/>
        </p>
        
        <p>
        <strong style="color: rgb(255, 255, 255);"> Savvy Shopping</strong>
        <span class="style1">
        <br/>
        <a class="small_nav" href="rules-of-engagement.html">Rules of Engagement</a>
        <br/>
        <a class="small_nav" href="buying-for-the-lady.html">Buying for the Lady</a>
        <br/>
        <a class="small_nav" href="buying-for-the-gentleman.html">Buying for the Gentleman</a>
        <br/>
        <a class="small_nav" href="shopping-etiquette.html">Shopping Etiquette</a>
        </span>
        </p>
        
        <p>
        <strong style="color: rgb(255, 255, 255);">Building Your Collection</strong>
        <br/>
        <span class="style1">
        <a class="small_nav" href="the-smart-investor.html">The Smart Investor</a>
        <br/>
        <a class="small_nav" href="old-rock-new-tricks.html">Old Rocks New Tricks</a>
        <br/>
        <a class="small_nav" href="how-to-use-you-jewel.html">How to Use your Jewel </a>
        <br/>
        <a class="small_nav" target="_blank" href="">Jewel Gallery Blog</a>
        <br/>
        <br/>
        <br/>
        <img height="118" border="0" width="100" alt="Jewel Gallery Events" src=                                                                        "home/events.jpg"/>
        </span>
        </p>
        
        
        </div><!--end left_nav-->
        
        </div><!--end leftcontent-->
        
         <div id="right_content">
         
         <p><span class="nav_header">GIA Grading and Reports</span> </p>
         <p>A new and vastly improved resource is now available on the web, for those who want to understand the information on a GIA (Gemological Institute of America) diamond grading report. Μore ></p>
         <p><span class="nav_header"> Check this out: Jewel Gallery Review:</span>
           <br />
         </p>
         <p> I've known about this design team for a while, since I side-stepped with little dog into          the JJ Marco boutique on Madison Avenue last year. Now I can tell you.. a pair of          earrings from JJ Marco should be highly considered for a gal that loves everyday luxury.          Maybe that gal is yourself. Maybe you drop a hint to your guy. Μore ></p>
         <p> <span class="nav_header">The Perfect Ring for the Woman who knows her Diamonds:</span>          </p>
         <p>This delicious 7.12 Carat Asscher Cut Diamond, in a handmade double prong Platinum           mounting is GIA certified E Color, VS1 Clarity and is available through an exclusive          network throughout all 50 states. The price is a Jewel Gallery Launch "Party Favor". 
          $352,440.00 Don't say we never showed you fabulous.  Μore>     </p>
         </div>
         <!--end rightcontent-->
         
         <div id="right_nav">
          <img height="34" width="150" alt="Friends &amp; Sponsors" src=                                        "home/right_nav/friends-sponsors.jpg"/>
          
         <a href="http://renaissanceplatinum.ad2.com/?section=showcase" target="_blank" >
         <img src="home/right_nav/spectacular-platinum-work.jpg" alt="Spectacular Platinum          Work" width="150" height="87" border="0" /></a><br /><br />
         
         <a href="http://www.zaffirojewelry.com/" target="_blank" class="sponsors" ><img src=         "home/right_nav/delicious-couture-color.jpg" alt="Delicious Couture Color" width="150"          height= "94" border="0" /></a><br />
          <br />
          <a href="http://www.samsclub.com/shopping/search.do?searchtype=simple&amp;catg=1&amp;simplesearchfor=premi         er+platinum&amp;simpleitemtype=1&amp;x=14&amp;y=11" target="_blank" class="sponsors"><img         src="home/right_nav/timeless-classics.jpg" alt="Timeless Classics Larger Diamonds" width=          "150"  height="93" border="0" /></a><br />
          <br />

          <a href="http://www.dovesjewelrydesigns.com/collections/collections.cfm?collection=5"          target="_blank" class="sponsors"><img src="home/right_nav/special-in-18-karat.jpg" alt=         "Special in 18 Karat White Gold" width="150" height="90" border="0" /></a><br />


         
         </div><!--end rightnav-->
         
          
</div> <!--end wrapper div-->
</body>
</html>

Last edited by silverglade; 04-01-2009 at 10:20 AM..
silverglade is offline
Reply With Quote
View Public Profile
 
Old 04-01-2009, 04:08 PM Re: css navigation menu not lining up with my header div image.
NewBreed's Avatar
Extreme Talker

Posts: 223
Name: Johnny
Location: Washington
Trades: 0
the reason why it messes up when you add padding is because when you add the width of all your divs, 400px, 250px, 150px = 800px. #wrapper is only 801px and the total width your using is 800. So you only have one extra pixel of space to use so since it can't fit all on one line it does it on different line. Thus you'll have to make your wrapper bigger or some other things smaller. haven't looked at the link section yet but I'll let you know soon.
NewBreed is offline
Reply With Quote
View Public Profile
 
Old 04-01-2009, 04:17 PM Re: css navigation menu not lining up with my header div image.
NewBreed's Avatar
Extreme Talker

Posts: 223
Name: Johnny
Location: Washington
Trades: 0
Add this to your code for your left nav to show hovered colors.
Code:
#left_nav a:hover { 
color: #fff; /*change the color to w/e*/
}
NewBreed is offline
Reply With Quote
View Public Profile
 
Old 04-01-2009, 04:34 PM Re: css navigation menu not lining up with my header div image.
Webmaster Talker

Posts: 611
Trades: 0
thank you newbreed for fixing my links!!! and taking the time to look through my code and explain well what is going on. also, i made my wrapper div 830px and the rightnav fit, but now the right side is bigger than the left side, i guess ill have to live with that due to poor planning of padding to my layout width.then i had to make my length of wrapper 850px to go all the way down. and the page looks pretty good now, probably finished i guess except for some href locations of links. so thanks.
ps. do you plan for padding in your compositions since it expands the divs?

here is the page now almost done.

http://derekvanderven.com/jewel_gallery/home.html

Last edited by silverglade; 04-01-2009 at 04:59 PM..
silverglade is offline
Reply With Quote
View Public Profile
 
Old 04-02-2009, 02:13 PM Re: css navigation menu not lining up with my header div image.
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
Quote:
when i try to add padding to the rightcontent div for text, it pushes the right_nav area down and out.
As already noted, you do NOT want the padding on the div for text. Put the padding on the TEXT INSIDE - add left and right padding to the <p> tag inside the box!

Derek, you really need to get the box model down so you understand why that happened in the first place:

http://dev.opera.com/articles/view/3...-boxes-border/
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 04-02-2009, 05:35 PM Re: css navigation menu not lining up with my header div image.
Webmaster Talker

Posts: 611
Trades: 0
thank you very much for the link ladynred. i need a good dose of the basics so i can stop wondering "why did this pop over there?" HAHAHA. i had no idea i could put padding on p. so i changed all my pages to do that.
silverglade is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to css navigation menu not lining up with my header div image.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.61047 seconds with 12 queries