Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-18-2012, 04:26 PM   PM User | #1
james_taylor
New to the CF scene

 
Join Date: Dec 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
james_taylor is an unknown quantity at this point
having problems positioning the nav bar

hi guys im doing code using html and css to make a website, but im having trouble at the moment positioning the nav bar to the right to align with my heading, ill show you the code for both the css and my html home page, and if anyone can see whats wrong please let me know, thanks.


HTML:

<!DOCTYPE html>
<html>
<head>
<title>Lucia Pupilli - Home</title>
<link rel="stylesheet" type="text/css" href="website.css">
</head>

<body class="background">

<h1>Lucia Pupilli</h1>

<div id="luciaPages">
<ul>
<li><a href="home.html">Home</a></li>
<li><a href="bio.html">Bio</a></li>
<li><a href="listen to me.html">Listen to me</a></li>
<li><a href="gallery.html">Gallery</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
</div>

<div class="page">
<video width="340" height="320" controls>
<p>Click to see Lucia in action</p>
<source src="luciavid.mp4" type="video/mp4">
<!-- <source src="movie.ogg" type="video/ogg"> -->

</source>
Your browser does not support the video tag.
</video>

</div>

</body>
</html>



CSS:

.background{
background-image: url(lucia2.jpg);
background-repeat:no-repeat;
background-color: black;
}


body {
padding:0;
color:white;
border-color:white;
background-color: white;
overflow:auto;

}

.page{

margin-top:-1%;
margin-bottom:80%;
margin-left:50%;
margin-right:10%;

color:none;
border-color:none;
background-color: none;

}

#bio{
color: #C80000;
}

h1 {
color: #C80000;
font-family: Zapf Chancery, cursive;
font-size: 50px;
margin: 50px;
}

#luciaPages
{
width:100%;
margin:0 0 2%;
}

ul {list-style-type: none; }

li {display:inLine; float:left;}

ul a {color:#C80000; padding-left:25px; padding-right:25px; text-decoration: none; line-height:1px; font-family: Zapf Chancery, cursive;}

ul a:hover {color:white}

.swapMe img { -webkit-transition: all 1s ease-in-out; -moz-transition: all 1s ease-in-out; -ms-transition: all 1s ease-in-out; -o-transition: all 1s ease-in-out; transition: all 1s ease-in-out; }
.swap1, .swapMe:hover .swap2 { -webkit-opacity: 1; -moz-opacity: 1; opacity: 1; } .swapMe:hover .swap1, .swap2 { -webkit-opacity: 0; -moz-opacity: 0; opacity: 0; }

</body>
james_taylor is offline   Reply With Quote
Old 12-18-2012, 04:53 PM   PM User | #2
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
Hello james_taylor,
To place those two elements side by side, you need to float one or both.

Look at it like this -
Code:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Lucia Pupilli - Home</title>
<style type="text/css">
.background { background: #000 url(lucia2.jpg) no-repeat; }
body {
	padding: 0;
	color: white;
	border-color: white;
	background-color: white;
}
#header {
	width: 100%;
	overflow: auto; /*this clears floated h1*/
}
h1 {
	width: 325px;
	margin: 50px;
	float: left;
	color: #C80000;
	font-family: Zapf Chancery, cursive;
	font-size: 50px;
	text-align: center;
}
ul#luciaPages { 
	margin: 75px 0 0 325px;
	list-style-type: none; 
}
li {
	display: inLine;
	float: left;
}
li a {
	color: #C80000;
	padding-left: 25px;
	padding-right: 25px;
	text-decoration: none;
	line-height: 1px;
	font-family: Zapf Chancery, cursive;
}
li a:hover { color: white }
</style>
</head>
<body class="background">
    <div id="header">
        <h1>Lucia Pupilli</h1>
            <ul id="luciaPages">
                <li><a href="home.html">Home</a></li>
                <li><a href="bio.html">Bio</a></li>
                <li><a href="listen to me.html">Listen to me</a></li>
                <li><a href="gallery.html">Gallery</a></li>
                <li><a href="contact.html">Contact</a></li>
            </ul>
    <!--end header--></div>
</body>
</html>
See a float tutorial here.

When posting code in the forum, please use the code tags, [code][/code] - available with the # button in the post edit window.
This will wrap your code in a scroll box which greatly helps the readability of your post.
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad
Excavator is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 05:40 AM.


Advertisement
Log in to turn off these ads.