Jump to content

Problem with background image as a header

chase klingel

Recommended Posts

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?



<!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>


#container {	white-space: nowrap;	position: relative;}.stuff {	min-width: 100%;}



Edited by davej
Link to comment
Share on other sites

Your code looks very sad and confused. Start over. See...







<!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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...