chase klingel Posted April 4, 2014 Share Posted April 4, 2014 (edited) I'm trying to extend my background-image across the entire webpage to act as a header. Image it as the blue header that facebook has at the top of their page. For some reason there is white space to the left of the background image, but the right extends all the way to the end of the web browser. I want to extend the background image all the way to the right side of the browser as well. Can you help with my code? HTML <!DOCTYPE html><html><head><link rel="stylesheet" type="text/css" href="style.css"></head><body> <div id="container"> <div class="stuff"> <img src="black.png" id="black"></body></html> CSS #container { white-space: nowrap; position: relative;}.stuff { min-width: 100%;} trying.html styling.css Edited April 5, 2014 by davej Link to comment Share on other sites More sharing options...
davej Posted April 4, 2014 Share Posted April 4, 2014 Your code looks very sad and confused. Start over. See... http://www.w3schools.com/html/html_basic.asp http://www.w3schools.com/css/css_background.asp http://www.w3schools.com/cssref/css3_pr_background.asp <!DOCTYPE html><html><head><meta charset="utf-8"><title>tab</title><style>#banner{background-image:url("mybannerimage.png");background-repeat:no-repeat;background-position:center center;background-size:100% 80px;height:80px;text-align:center;}</style></head><body><div id="banner"><h1>My Banner!</h1></div><h3>Title</h3><p>Test paragraph 1</p><p>Test paragraph 2</p></body></html> Link to comment Share on other sites More sharing options...
giapceoit Posted April 4, 2014 Share Posted April 4, 2014 I think do it <body> <div id="container"> <div class="stuff" style="min-width:100%; background-image:url(black.png);"> </div div></body> Ex: http://dongtammedia.com/ You see look: <Div> logo used code: background-image:url(url-image) in file css . Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now