Jump to content

Background disapeared


aquaben

Recommended Posts

heyanyone see a problem on my header since for a reason or another my background disapeared.<html><head><body>{ background-color:#A46FCC; background-image:url('17.jpg'); background-repeat:no-repeat; } h1 {text-align:center;} h2 {text-align:center;} h3 {text-align:left;) h4{text-align:left;} h5{text-align:center} h1{color:#B7FEF4} h2{color:#B7D3FE} h3{{color:#CFFEB7} h4{color:#FEDA87} h5{color:red} h3 {text-indent:50px;} h4 {text-indent:50px;} <a href="http://18.jpg" target="_blank"></a> 08-01-2009</body></head></html>

Link to comment
Share on other sites

heyanyone see a problem on my header since for a reason or another my background disapeared.<html><head><body>{ background-color:#A46FCC; background-image:url('17.jpg'); background-repeat:no-repeat; } h1 {text-align:center;} h2 {text-align:center;} h3 {text-align:left;) h4{text-align:left;} h5{text-align:center} h1{color:#B7FEF4} h2{color:#B7D3FE} h3{{color:#CFFEB7} h4{color:#FEDA87} h5{color:red} h3 {text-indent:50px;} h4 {text-indent:50px;} <a href="http://18.jpg" target="_blank"></a> 08-01-2009
Also that is the only coding ive done on this page.
Link to comment
Share on other sites

how about adding a <body>? and maybe an opening/closing <html>?I would start by using a properly formed HTML document including a Strict DTD and go from there. Of course no styles applied to the <body> will show if there's no <body> tag in you document...

Link to comment
Share on other sites

Your CSS isn't within style tags.And also, you don't have a selector on this declaration:

{background-color:#A46FCC;background-image:url('17.jpg');background-repeat:no-repeat;}

Link to comment
Share on other sites

sorry there's a lot more to it than what I first saw:first, this is how you make a standard (validating and strict) web document:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <head>  <title>Page Title</title>  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head><body>  <h1>text here</h1></body></html>

now if you want to add styles (not using an include), put them in the head

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <head>  <title>Page Title</title>  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">   <style type="text/css">  body{   background-color:#A46FCC;   background-image:url('17.jpg');   background-repeat:no-repeat;  }  h1 {	text-align:center;	color:#B7FEF4  }  h2 {	text-align:center;	color:#B7D3FE;  }   h3 {	 text-align:left;	 color:#CFFEB7;	 text-indent:50px;  }  h4{	text-align:left;	color:#FEDA87;  }  h5{	text-align:center;	color:red;	text-indent:50px;  }</style></head><body>  <h1>text here</h1></body></html>

note how I combined like elements together to consolidate the styles. (It is recommended to use an external stylesheet however). I also fixed some syntax errors you have, including extra curly braces and parenthesis being used instead of curly braces.I highly recommend you go back and reread the HTML/CSS tutorials and start learning how to validate your page as you go.

Link to comment
Share on other sites

sorry there's a lot more to it than what I first saw:first, this is how you make a standard (validating and strict) web document:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <head>  <title>Page Title</title>  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head><body>  <h1>text here</h1></body></html>

now if you want to add styles (not using an include), put them in the head

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <head>  <title>Page Title</title>  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">   <style type="text/css">  body{   background-color:#A46FCC;   background-image:url('17.jpg');   background-repeat:no-repeat;  }  h1 {	text-align:center;	color:#B7FEF4  }  h2 {	text-align:center;	color:#B7D3FE;  }   h3 {	 text-align:left;	 color:#CFFEB7;	 text-indent:50px;  }  h4{	text-align:left;	color:#FEDA87;  }  h5{	text-align:center;	color:red;	text-indent:50px;  }</style></head><body>  <h1>text here</h1></body></html>

note how I combined like elements together to consolidate the styles. (It is recommended to use an external stylesheet however). I also fixed some syntax errors you have, including extra curly braces and parenthesis being used instead of curly braces.I highly recommend you go back and reread the HTML/CSS tutorials and start learning how to validate your page as you go.

Will do, I just re-started to learn HTML/CSS/Javascript last week, havn t touched in almost a decade. just another noob question, could you list me a few good external stylesheet?And also it now works
Link to comment
Share on other sites

first, this is how you make a standard (validating and strict) web document:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <head>  <title>Page Title</title>  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head><body>  <h1>text here</h1></body></html>

Actually, you're missing your opening <html> tag. :)
Link to comment
Share on other sites

stylesheets are made to meet your needs. You make them based on how you want things to look, so it will probably be different for every site you make.

Link to comment
Share on other sites

Actually, you're missing your opening <html> tag. :)
nope, it wil validate. It seems to get all rolled into the DTD.
Link to comment
Share on other sites

Really? Didn't know that...
Remember, this is SGML, land of the strange syntax and laissez-faire rulebook...
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...