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 02-18-2012, 10:13 PM   PM User | #1
manda
New to the CF scene

 
Join Date: Feb 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
manda is an unknown quantity at this point
Text outside of div

Hi, I'm an absolute newbie to css so I do apologise if this seems very simple but I can't figure it out. The problem is that any long text goes beyond the div, how do I get the div to fit to the amount of text? Also, the wrapper only goes half way down the page when it is set to 100% and I'd like it to go all the way to the bottom so the colour of it can be seen. Here is the code (hopefully):


Code:
html, body{
	background-color: #C33;
	margin: 0px;
	height: 100%;
}


#wrapper {
	width: 1024px;
	background-color: #000;
	height:100%;
	min-height:100%;
	margin: 0 auto;
	overflow:visible;
	border-radius: 5px;
	-moz-border-radius: 5px;


}
#header {
	height: 150px;
	width: 1024px;
	background-color: #000000;
	border-radius: 5px;

	-moz-border-radius: 5px;
	background-image:url(Images/title2.jpg);
	background-repeat:no-repeat;
	background-position: 50% 50%;

}
#navbar {
	height: 35px;
	width: 1024px;
	background-color: #D6D6D6;
	border-radius: 5px;
	-moz-border-radius: 5px;
	margin-bottom: 3px;
}

#left {
	float: left;
	height: 100%;
	width: 24%;
	background-color: #000;
	margin-bottom: 3px;
	border-radius: 5px;
	-moz-border-radius: 5px;
	margin-right: 5px;
}
#middle {
	height: 100%;
	min-height:100%;
	width: 51%;
	background-color: #FFF;
	float: left;
	margin-bottom: 3px;
.
	border-radius: 5px;
	-moz-border-radius: 5px;
	font-family: Verdana, Geneva, sans-serif;
}
#right {
	float: right;
	height: 100%;
	width: 24%;
	background-color: #000;
	margin-bottom: 3px;
	border-radius: 5px;
	-moz-border-radius: 5px;
	font-family: Verdana, Geneva, sans-serif;
	color: #FFF;
}


#footer {
	height:30px;
	width:1024px;
	background-color:#D6D6D6;
	clear:both;
	margin-right:auto;
	margin-left:auto;
	margin-top:-30px;
	margin-bottom:-30px;
	border-radius: 5px;
	-moz-border-radius: 5px;
	
	}
	
	
	#navbar ul {
	list-style-type: none;
	margin: 0px;
	padding: 0px;
}
#navbar ul li {
	display: inline;
}
#navbar ul li a {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	text-decoration: none;
	float: left;
	padding-top: 7px;
	padding-right: 15px;
	padding-bottom: 0px;
	padding-left: 15px;
}
#navbar ul li a:hover {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	color: #FFFFFF;
	text-decoration: none;
	float: left;
	padding-top: 7px;
	padding-right: 15px;
	padding-bottom: 7px;
	padding-left: 15px;
	background-color: #999999;
}
manda is offline   Reply With Quote
Old 02-19-2012, 10:35 AM   PM User | #2
miennh_coding
New Coder

 
Join Date: Dec 2010
Posts: 32
Thanks: 5
Thanked 2 Times in 2 Posts
miennh_coding is an unknown quantity at this point
html?
miennh_coding is offline   Reply With Quote
Old 02-19-2012, 05:04 PM   PM User | #3
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,383
Thanks: 18
Thanked 350 Times in 349 Posts
sunfighter is on a distinguished road
manda I do not see these behaviors, but you need to give us the HTML code and tell us what div your having problems with. And what browsers have you looked at your page with.
sunfighter is offline   Reply With Quote
Old 02-19-2012, 06:11 PM   PM User | #4
teedoff
Senior Coder

 
Join Date: Aug 2010
Location: High Point, NC
Posts: 3,325
Thanks: 5
Thanked 363 Times in 360 Posts
teedoff is on a distinguished road
We do need your html code, but in the mean time, try instead of setting a height on wrapper, set

overflow: auto;

on wrapper.
__________________
Teed
teedoff is offline   Reply With Quote
Old 02-20-2012, 01:03 PM   PM User | #5
clausrei
New Coder

 
Join Date: Sep 2011
Location: United Kingdom
Posts: 72
Thanks: 2
Thanked 3 Times in 3 Posts
clausrei is an unknown quantity at this point
Or :
Code:
overflow:hidden
Or delete the #wrapper attribute for height:
Code:
 height: 100%;
This should do the job.
clausrei is offline   Reply With Quote
Old 02-20-2012, 01:56 PM   PM User | #6
Co1dFusion
New Coder

 
Join Date: Feb 2012
Location: England
Posts: 77
Thanks: 0
Thanked 12 Times in 11 Posts
Co1dFusion can only hope to improve
The problem is that you have specfied the height of the div. remove that and the div will just fit the text.
Co1dFusion 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 11:53 AM.


Advertisement
Log in to turn off these ads.