aquaben Posted August 26, 2010 Share Posted August 26, 2010 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 More sharing options...
aquaben Posted August 26, 2010 Author Share Posted August 26, 2010 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-2009Also that is the only coding ive done on this page. Link to comment Share on other sites More sharing options...
thescientist Posted August 26, 2010 Share Posted August 26, 2010 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 More sharing options...
aquaben Posted August 26, 2010 Author Share Posted August 26, 2010 just tried that after my post and still not showing up Link to comment Share on other sites More sharing options...
ShadowMage Posted August 26, 2010 Share Posted August 26, 2010 just tried that after my post and still not showing uprepost your code. Link to comment Share on other sites More sharing options...
Ingolme Posted August 26, 2010 Share Posted August 26, 2010 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 More sharing options...
thescientist Posted August 26, 2010 Share Posted August 26, 2010 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 More sharing options...
aquaben Posted August 26, 2010 Author Share Posted August 26, 2010 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 More sharing options...
ShadowMage Posted August 26, 2010 Share Posted August 26, 2010 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 More sharing options...
thescientist Posted August 26, 2010 Share Posted August 26, 2010 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 More sharing options...
aquaben Posted August 26, 2010 Author Share Posted August 26, 2010 Actually, you're missing your opening <html> tag. WOW had not noticed it thx mate Link to comment Share on other sites More sharing options...
thescientist Posted August 26, 2010 Share Posted August 26, 2010 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 More sharing options...
thescientist Posted August 26, 2010 Share Posted August 26, 2010 WOW had not noticed it thx matethat was intentional Link to comment Share on other sites More sharing options...
ShadowMage Posted August 26, 2010 Share Posted August 26, 2010 nope, it wil validate. It seems to get all rolled into the DTD.Really? Didn't know that... Link to comment Share on other sites More sharing options...
Synook Posted August 27, 2010 Share Posted August 27, 2010 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.