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
Beginner Positioning help
Old 12-05-2007, 03:16 PM Beginner Positioning help
Novice Talker

Posts: 7
Trades: 0
I've just started using CSS and i'm having trouble positioning layers. I would like both the white logo layer and the blue navigation layer to be inside the navy header layer. I've got the logo layer where i want it but i can't seem to get the blue layer on the same line. Below are both my html and css code as well as a link to the page to you can have a visual.

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

body {
    margin:9px 9px 9px 9px;
    padding:0px;
    background:white;
}
#header{
    background:navy;
    width:775px;
    height:auto;
    margin-left:auto;
    margin-right:auto;    
}

#logobox{
    background:white;
    width:210px;
    height:40px;
    margin-left:10px;
    text-align:center;
}

#navbox{
    background:blue;
    width:500px;
    height:40px;
    position:inherit;
}
HTML
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Digicon Media : Home</title>
    <meta name="keywords" content="Digicon Media Group Web Design webdesign small business communication connect with customers">
    <meta name="description" content="Digicon Media Group specializes in connecting small business with customers via a digital medium. ">
    <link href="normal.css" rel="stylesheet" type="text/css">
    <style type="text/css">
        a:link {color:navy;text-decoration:none;}
        a:visited {color:navy;text-decoration:none;}
        a:hover {color:blue;text-decoration:underline;}
        a:active {color:red;text-decoration:none;}
    </style>

</head>

<body>
    <div id="header">
        <div id="logobox"><img alt="" src="images/smlogo.gif" width="219" height="30">
        </div>
        <div id="navbox">
        </div>
    </div>
</body>
</html>
http://digiconmediagroup.com/new.htm
cfgcjm is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-05-2007, 03:36 PM Re: Beginner Positioning help
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
You need to use floats - float the logo and the navbox left, then clear the float after the closing div for #header.

Like this:
Quote:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Digicon Media : Home</title>
<meta name="keywords" content="Digicon Media Group Web Design webdesign small business communication connect with customers">
<meta name="description" content="Digicon Media Group specializes in connecting small business with customers via a digital medium. ">
<link href="normal.css" rel="stylesheet" type="text/css">
<style type="text/css">
a:link {color:navy;text-decoration:none;}
a:visited {color:navy;text-decoration:none;}
a:hover {color:blue;text-decoration:underline;}
a:active {color:red;text-decoration:none;}
body {
margin:9px 9px 9px 9px;
padding:0px;
background:white;
}
#header{
background:navy;
width:775px;
/*height:auto;*/
margin: 0 auto;

}

#logobox{
background:white;
width:210px;
height:40px;
margin-left:10px;
text-align:center;
float: left;
}

#navbox{
background:blue;
width:500px;
height:40px;
float: left;

}

.brclear { /* Use a break with this class to clear float containers on both sides */
clear:both;
height:0;
margin:0;
font-size: 1px;
line-height: 0;
}
</style>

</head>

<body>
<div id="header">
<div id="logobox"><img alt="" src="http://www.webmaster-talk.com/images/smlogo.gif" width="219" height="30">
</div><!-- end logo -->
<div id="navbox">
</div><!-- end nav -->
<br class="brclear" />
</div><!-- end header -->

</body>
If you add any LEFT margin to either floated box, you'll trigger a bug in IE6 and below that you will have to fix.
__________________
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
 
Reply     « Reply to Beginner Positioning help
 

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.55269 seconds with 12 queries