There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
Web Design & Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
Problem with DIVs ann CSS


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
RiazMC's Avatar
Member with 59 posts.
 
Join Date: Oct 2004
Location: UK
Experience: Intermediate
19-Jun-2008, 10:02 AM #1
Problem with DIVs ann CSS
Hi,

I'm creating a site for my friends company, i'm using div and css. this is the first time i'm using this method, i usally use table. But this way seems a lot "neater". But i'm having problems with getting my DIV layers to behave how i want them.

My problem is, when i try and add content on my page my div layers seperate ( as indicated in the screenshot).

I have also included my css code i'm pretty sure i have something conflicting in there.

Thanks guys


Code:
body {
	margin:0;
	padding:0px;
	height:100%; 
	text-align:center;
}

.container {
	margin-left:auto;
	margin-right:auto;
	margin-bottom:0;
	padding:15px;
	height:100%;
}

.navbar {
	padding:0px 33px 0 42px;
	font: normal 12px auto "Arial", Verdana, Arial, Helvetica, sans-serif;
	/*border:	2px solid #0000ff;*/
	position: relative;
	top: 150px;
	text-align:right;
	z-index: 5
}

.headr {
	background-image: url(images/Taylor_Stanton_Hdr.jpg);
	background-repeat: no-repeat; 
	text-align:left;
	height: 181px;
	width: 800px;
	position: relative;
	margin:0px auto;			
}

.middl {
	top:0px;
	background-image: url(images/Taylor_Stanton_Mid.jpg);	
	text-align:left;
	height: 254px;
	width:800px;
	position: relative;
	margin:0px auto;
}

.footer {
	background-image: url(images/Taylor_Stanton_Ftr.jpg);
	background-repeat: no-repeat;
	text-align:left;
	width:800px;
	height: 205;
	position: relative;
	margin:0px auto;	
}


.content {
	width: 700px;
	padding:0px 0px 0px 60px;
	font: normal 14px auto "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
	color: #4f6b72;
	position: relative;
	top: 20px;
	z-index: 2
}


/* css menu ==================*/

ul.menu {
list-style-type:none;
width:auto;
position:relative;
display:block;
height:33px;
font-size:.6em;
/*background:url(images/bg.png) repeat-x top left;
border:1px solid #000;*/
font-family:Verdana,Helvetica,Arial,sans-serif;
margin:0;
padding:0;
}

ul.menu li {
display:block;
float:left;
margin:0;
padding:0;
}

ul.menu li a {
float:left;
color:#000033;
text-decoration:none;
height:24px;
padding:9px 2px 0;
}

ul.menu li a:hover,.current {
color:#663399;
font-weight:bold;
/*background:url(images/bg.png) repeat-x top left;*/
}

ul.menu .current a {
color:#330066;
font-weight:700;
}
Attached Thumbnails
problem-divs-ann-css-screnntshot.jpg  
__________________
Abit AN7
Athalon XP 2200
1024 DDR
220gig HD space
Aopen 128DDr 8x gfx card
WinXP pro
Mr.LLB's Avatar
Senior Member with 138 posts.
 
Join Date: May 2008
19-Jun-2008, 10:10 AM #2
Can I please have the website link so I can look at the HTML code as well and which div tag uses which CSS style.

Thanks,
RiazMC's Avatar
Member with 59 posts.
 
Join Date: Oct 2004
Location: UK
Experience: Intermediate
19-Jun-2008, 01:12 PM #3
Hi MR.LLB, thanks for replying. The website isn't online yet, but i have pasted the html below, thanks for your help

Quote:
<html>
<head>
<link rel="StyleSheet" href="Ver2styles.css" type="text/css" media="screen">
<title>One Hundred Percent Height Divs</title>
</head>
<body>

<div class="container">
<div class="headr">
<div class="navbar">
<ul class='menu orange'>
<li class='current'><a href='index.html'>Home |</a></li>
<li><a href='quote.php'>| Quote |</a></li>
<li><a href='AboutUs.html'>| About Us |</a></li>
<li><a href='ContactUs.html'>| Contact Us</a></li>
</ul>
</div>
</div>
<div class="middl">
<div class="content">
<h4>Contact Us</h4>
</div>
</div>
<div class="footer"> </div>
</div>
</body>
</html>
Mr.LLB's Avatar
Senior Member with 138 posts.
 
Join Date: May 2008
19-Jun-2008, 01:22 PM #4
Make the following changes and let me know if there's any improvement:

.navbar {
padding:0px 33px 0px 42px; <<< you didn't put the px beside the bottom 0
font: normal 12px auto "Arial", Verdana, Arial, Helvetica, sans-serif;
/*border: 2px solid #0000ff;*/
position: relative;
top: 150px;
text-align:right;
z-index: 5
RiazMC's Avatar
Member with 59 posts.
 
Join Date: Oct 2004
Location: UK
Experience: Intermediate
20-Jun-2008, 09:16 AM #5
Hi Mr.LLB, that seems to have solved the problem in IE but not opera or firefox. I also changed the position from relative, to absolute which fixed the problem in IE and F/Fox...hmm.

Any way well spotted and thanks again four your help i appreciate it
Mr.LLB's Avatar
Senior Member with 138 posts.
 
Join Date: May 2008
20-Jun-2008, 10:41 AM #6
glad to help
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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 On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 09:29 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.