...

View Full Version : CSS Image won't fit to all the way



buku
05-18-2012, 08:20 PM
html file


<!DOCTYPE html>
<html>
<link rel="stylesheet" type="text/css" href="style.css" />
<body>
<div id="head">
<div id="logo">
</div>
</div>
</body>
</html>

css file


#head
{
background:url('images/header.jpg')left top repeat-x;
height:100%;
padding:0;
margin:0;
}

I want it to be my header and I want it to fit the screen not stop, for example:

| [[[[[[[[[Image]]]]]]]]] |

|= the side of the page

[[[Image]]]= image

I want it to be

|[[[[image]]]]]]|

Excavator
05-19-2012, 03:31 PM
Hello buku,
It looks like you may be talking about the 8px margin that is default on the body of the document. Try it like this -

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
<style type="text/css">
body{margin: 0;}
#head {
height: 100%;
margin: 0;
padding: 0;
background: url('images/header.jpg')left top repeat-x;
}
</style>
</head>
<body>
<div id="head">
<div id="logo"> </div>
</div>
</body>
</html>

sunfighter
05-19-2012, 03:52 PM
give your height a px value instead of a % in #head.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum