Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    May 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CSS Image won't fit to all the way

    html file

    Code:
    <!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
    Code:
    #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]]]]]]|

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,667
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    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 -
    Code:
    <!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>
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #3
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    3,761
    Thanks
    23
    Thanked 546 Times in 545 Posts
    give your height a px value instead of a % in #head.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •