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 11-21-2010, 01:13 AM   PM User | #1
Rhombusone
New Coder

 
Join Date: Nov 2010
Location: Devon, UK
Posts: 44
Thanks: 6
Thanked 1 Time in 1 Post
Rhombusone is an unknown quantity at this point
Background Composition

Hi guys,

Just joined up and very new to the coding scene. I'm a designer by trade so looking got some help. I have my template made up but already im stuck on my background. I'm trying to work out how to construct it, i basically have a top border, the main background then a footer which is another seperate textured background.

I am thinking the best way to tackle it is have the top image seperate, middle, bottom. But how would i code this, does each image go in it's own div or can the lot be done using css within one single div?

I hope you follow

Thanks
Rhombusone is offline   Reply With Quote
Old 11-21-2010, 01:31 AM   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 Rhombusone,
To learn how to write a page you might have some luck following a tutorial. There are some very good ones at http://www.tizag.com/beginnerT/ and http://www.w3schools.com/

When you run into a problem with code you've tried that's not working, post back here - Lots of good help available here.

Tip: You will probably want each seperate image to be a background of it's own div. Like a header image would be the background of <div id="header"> so you can put other header stuff in that div and the image stays behind it all.
__________________
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
Old 11-21-2010, 11:34 AM   PM User | #3
Rhombusone
New Coder

 
Join Date: Nov 2010
Location: Devon, UK
Posts: 44
Thanks: 6
Thanked 1 Time in 1 Post
Rhombusone is an unknown quantity at this point
This is my markup in html:

Code:
<!DOCTYPE html>
<html>
 <head>

 <link rel="stylesheet" href="css/style.css" />
 <link rel="stylesheet" href="css/reset.css" />	
	
	
</head>
	
<body>
<div id="container">
	
	<div id="topEdge"><img src="images/topedge.jpg" class="top"/></div>
	<div id="content"></div>
	
	<div ="footer"></div>
			

</div>













</body>	
</html>
And here is my css.. now the topEdge image will not repeat for some reason and the body background is not showing.. no idea why :S


Code:
body {
	background: url(images/bg.jpg) repeat-x;
	font-family: helvetica, arial, sans-serif;
	line-height:25px;
	overflow:hidden;
	}
	
	
container{
	width:959px;
	margin:0px auto;
	position:relative;
	overflow:hidden;
}

topEdge{


}
.top{
	background-repeat:repeat-x;
	border-bottom: 2px solid #ccc;
}
Live version : http://www.rhombusone.com/projecttiger/index.html

Last edited by Rhombusone; 11-21-2010 at 12:01 PM.. Reason: added
Rhombusone is offline   Reply With Quote
Old 11-21-2010, 03:13 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
The image isnt repeating because your css is wrong. Try this:

Code:
#topEdge {background-image: url(images/cross.jpg);
	background-repeat: repeat-x;}
Then take out the image src from the html.

You should also specifiy a valid doctype such as:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
teedoff is offline   Reply With Quote
Old 11-21-2010, 04:12 PM   PM User | #5
Rhombusone
New Coder

 
Join Date: Nov 2010
Location: Devon, UK
Posts: 44
Thanks: 6
Thanked 1 Time in 1 Post
Rhombusone is an unknown quantity at this point
thanks for that, although it still is not repeating for some reason... i must have the document setup wrong because ive done it before i just can not see why it will not work. I have corrected the doc type and changed the CSS - I Take is i remove the img input from the html as i should be able to call up the image as a background with that css section however screen is blank... no background no topbar :S
Rhombusone is offline   Reply With Quote
Old 11-21-2010, 07:41 PM   PM User | #6
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
Do you have a link to your site?
teedoff is offline   Reply With Quote
Old 11-21-2010, 07:48 PM   PM User | #7
Rhombusone
New Coder

 
Join Date: Nov 2010
Location: Devon, UK
Posts: 44
Thanks: 6
Thanked 1 Time in 1 Post
Rhombusone is an unknown quantity at this point
http://www.rhombusone.com/projecttiger/index.html

Sorry if it's something really obvious, but i keep looking over it and it must be simple but i just can not see it!
Rhombusone is offline   Reply With Quote
Old 11-21-2010, 07:57 PM   PM User | #8
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 Rhombusone,
That reset is messing up a lot when I view your website.

See what this does for you -
Code:
html, body, div, span, object, iframe, h1, h2, h3, h4, h5,
h6, p, blockquote, pre, a, code, del, em, font, img, small,
strike, strong, dl, dt, dd, ol, ul, li, fieldset, form,
label, table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-size: 100%;
vertical-align: baseline;
/*background: transparent;*/
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after, q:before, q:after {
content: ‘’;
content: none;
}
__________________
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
Old 11-21-2010, 08:05 PM   PM User | #9
Rhombusone
New Coder

 
Join Date: Nov 2010
Location: Devon, UK
Posts: 44
Thanks: 6
Thanked 1 Time in 1 Post
Rhombusone is an unknown quantity at this point
Hi thanks for that although didnt seem to make any change for me. I tried removing the reset altogeather and the body background works fine after however the topEdge div image background still not showing up.
Rhombusone is offline   Reply With Quote
Old 11-21-2010, 08:16 PM   PM User | #10
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
Quote:
Originally Posted by Rhombusone View Post
Hi thanks for that although didnt seem to make any change for me. I tried removing the reset altogeather and the body background works fine after however the topEdge div image background still not showing up.
You need to give #topEdge some content so it will show. Or a height, like this -
Code:
#topEdge{
height: 27px;
 background-image: url(images/topedge.jpg);
 background-repeat: repeat-x;
}
__________________
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
Old 11-21-2010, 08:22 PM   PM User | #11
Rhombusone
New Coder

 
Join Date: Nov 2010
Location: Devon, UK
Posts: 44
Thanks: 6
Thanked 1 Time in 1 Post
Rhombusone is an unknown quantity at this point
Ahhh thankyou Excavator, sorry for the hassle, appreciate the patience and time taken to help me. I think i have it now

Thanks to everyone else too!
Rhombusone is offline   Reply With Quote
Old 11-21-2010, 08:29 PM   PM User | #12
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
No hassle at all. Glad to help
__________________
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 06:58 AM.


Advertisement
Log in to turn off these ads.