What Doooo?

Status
Not open for further replies.

Vanish

Rising Java Developer
Dec 8, 2013
630
94
<html>
<header>
<title>Emilio's Portfolio</title>
<style>
header {background-color:lightgrey};
body {
background-image: url("website.jpg");

}
footer {background-color:#1C1C1C};
</style>
</header>
<body>
<button align="left">Home</button>
<button align="center"> About Me</button>
<button align="right">Contact Me</button>
<p> Test</p>
<footer><font color="white">Design & Copyrights go to Emilio.</font></footer>
</body>
</html>
is what i get. Help. What's wrong with the code? I tried setting the image source instead of just the name, same thing. Help pls?
 

brsy

nah mang
May 12, 2011
1,530
272
Just put this instead "url( )"
That gives him more work when he is moving his site to a web host. For medium-large projects, that will create more work and more places for things to go wrong for you.
 

Evilsmoothie

Mad kung-fu artist
Feb 11, 2013
446
57
Do this instead
HTML:
<style>
header {background-color:lightgrey;}
body {background-image: url("website.jpg");}
footer {background-color:#1C1C1C};
</style>

Because header {background-color:lightgrey}; that doesnt work.
Edit: Also, why are you using header where you should use head? :confused:
 
Last edited:

flyest

Doctor
Mar 3, 2013
94
13
Check if the image is linked right, sir. There's nothing wrong with the code. Perhaps you should put the style tags outside your header.
Also, If you're planning on making a website with several pages, I recommend that you add the CSS in a separate file and just link it to every page.
 

Sysode

Front-End Developer
Dec 11, 2012
1,673
848
Check the console to see what resources are not being loaded correctly.

Chrome:
Firefox:

Google if you use any other browser. Use this in the future, it'll save having to guess what the issue is.
 

Vanish

Rising Java Developer
Dec 8, 2013
630
94
Do this instead
HTML:
<style>
header {background-color:lightgrey;}
body {background-image: url("website.jpg");}
footer {background-color:#1C1C1C};
</style>

Because header {background-color:lightgrey}; that doesnt work.
Edit: Also, why are you using header where you should use head? :confused:
The code you provided fixed me up, but the image is repeating, rather than stretching, anything i should do?
This is what i mean ->
Check the console to see what resources are not being loaded correctly.

Chrome:
Firefox:

Google if you use any other browser. Use this in the future, it'll save having to guess what the issue is.
So i tried that and nothing appeared on my console (Before i tried Evilsmoothie's code). Thanks for your time though :)
 

Lame

Member
Nov 6, 2014
303
78
The code you provided fixed me up, but the image is repeating, rather than stretching, anything i should do?
This is what i mean ->

So i tried that and nothing appeared on my console (Before i tried Evilsmoothie's code). Thanks for your time though :)
background-repeat: no-repeat;
Simple and should stop it from well... repeating
 
Status
Not open for further replies.

Users who are viewing this thread

Top