It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming CSS Forum

Make <nav> bar page width

Make <nav> bar page width

Postby maltepeter on Wed Aug 10, 2011 3:01 pm

Hello, I am working on a webpage for my grandfather's charity. Everything has been going fine. Except one thing: I can't get the width of the <nav> bar to automatically become the width of the page. I use a dual monitor setup(15" MacBook Pro 1440x900 and a 23" Acer 1920x1080).

Here is the screen shot on acer monitor:
http://flic.kr/p/abNdyG

Here is the screen shot on MBP monitor:
http://flic.kr/p/abKoiP

I would like it to look like the MBP screenshot on every monitor, if possible.

Here is my code:

<html>
<head><title>Foundation for Haitians</title></head>

<style type="text/css">

body{
background-color: black;
}
header
{
padding-left: 10px;
padding-top: 10px;
/*background-image:url(heading1.jpg); */
background-color: black;
font-family: fantasy, sans-serif;
color:beige;
font-size:36;
height:120px;

}

nav
{

margin-top: 10px;
font-size: 16;
width: 1400;
float:right;
background-color: black;
padding: 10px 10px 10px 10px;
display: -webkit-box;
border: 2px solid beige;
-webkit-box-direction: horizontal;
-webkit-border-radius: 6px;
color: white;
margin-bottom: 0px;
}

nav a
{

font-family: fantasy;
display: block;
-webkit-box-flex: 1;
text-align: center;
-webkit-transition: all .5s linear;
}

nav a:hover
{
color:red;
}


a:link{ color:white;}



p{
color:beige;
font-size: 26;
font-family: fantasy;
margin-top: 200px;
}

</style>

<header>Foundations for Haitians

<br>

<nav>
<a href="home.html" target="content">Home</a>
<a>|</a>
<a href="mission.html">Our Mission</a>
<a>|</a>
<a href="slideshow.html">Slideshow</a></a>
<a>|</a>
<a href="contact.html">Contact Us</a>
<a>|</a>
<a href="donate.html">Donate</a>
<a>|</a>
<a href="other.html">Other</a>
<a>|</a>
<a href="other1.html">Other 1</a>
</nav>
</header>

</html>

Thanks for all of the help
maltepeter
 
Posts: 2
Joined: Wed Aug 10, 2011 2:59 pm

Re: Make <nav> bar page width

Postby rajmv on Thu Aug 11, 2011 3:30 am

Code: Select all
<html>
<head><title>Foundation for Haitians</title></head>

<style type="text/css">

body{
background-color: black;
}
header
{
width:100%;
padding-left: 10px;
padding-top: 10px;
/*background-image:url(heading1.jpg); */
background-color: black;
font-family: fantasy, sans-serif;
color:beige;
font-size:36;
height:120px;

}

nav
{
float:right;
font-size: 16px;
margin-top: 10px;
margin-bottom: 0px;
padding: 10px 10px 10px 10px;
margin-right:20px;
border: 2px solid beige;
border-radius:6px;
color: white;
text-align:right;
}

nav a
{

font-family: fantasy;
-webkit-box-flex: 1;
-webkit-transition: all .5s linear;
}

nav a:hover
{
color:red;
}


a:link{ color:white;}



p{
color:beige;
font-size: 26;
font-family: fantasy;
margin-top: 200px;
}

</style>

<header>Foundations for Haitians

<br>

<nav>
<a href="home.html" target="content">Home</a>
&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
<a href="mission.html">Our Mission</a>
&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
<a href="slideshow.html">Slideshow</a>
&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
<a href="contact.html">Contact Us</a>
&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
<a href="donate.html">Donate</a>
&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
<a href="other.html">Other</a>
&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
<a href="other1.html">Other 1</a>
</nav>
</header>

</html>
rajmv
100+ Club
 
Posts: 103
Joined: Thu Jul 14, 2011 7:22 am


Who is online

Users browsing this forum: No registered users and 1 guest