1. This website uses cookies. By continuing to use this website you are giving consent to cookies being used.
    For information on cookies and how you can disable them visit our Cookie Usage page.
    Dismiss Notice

CSS make div center css

Discussion in 'Web Development' started by Jaybirddesigns, Jun 16, 2008.

  1. Jaybirddesigns

    Jaybirddesigns New Member

    Just trying to center this div here's what i got, but no worky.


    body {
    background: url(images/background.gif) 0% 0% repeat-x;
    }

    .bkpage {
    align: center;
    TOP: 0px;
    position: absolute;
    }

    this is what it's doing

    http://jaybirdfolio.com/Realestate Template/index.php

    simple i'm sure

    also tryed

    <div class="bkpage" id="bkpage" align="center"><IMG src="images/bkpage.gif">
    </div>

    Thanks
     
  2. indumathi

    indumathi New Member

    hello

    hi,

    .bkpage {
    align: center;
    TOP: 0px;
    position: absolute;
    }

    <div class="bkpage" id="bkpage" align="center"><IMG src="images/bkpage.gif">
    </div>

    i think no need for this style at all.

    <div align="center"><IMG src="images/bkpage.gif">
    </div>

    just this will do i think
    this may be a solution!
     
  3. Jaybirddesigns

    Jaybirddesigns New Member

  4. pezboy45

    pezboy45 Mod/Design & Coder [Pro]

    Just add center.

    Alright, I pretty much got it.
    Here is the CSS:
    Code:
    body {
    background: url(http://jaybirdfolio.com/Realestate%20Template/images/background.gif) 0% 0% repeat-x;
    }
    .bdyimg {
        align: center;
        position: absolute;
        top: 0px;
    }
    And here is the HTML (I think):
    HTML:
    <div class="bdyimg"><img src="http://jaybirdfolio.com/Realestate%20Template/images/bkpage.gif" align="top"></div>
     
  5. xbox360gurl70s

    xbox360gurl70s New Member

    lol, a little "class" and it solves it all hehe
     
  6. Jaybirddesigns

    Jaybirddesigns New Member

  7. pezboy45

    pezboy45 Mod/Design & Coder [Pro]

  8. 4aces

    4aces New Member

    Solved.

    Hello Jaybirddesigns,

    I was searching google and stumbled upon this fourm and your question asked, I then took it upon myself to work out a fix. Once I had worked out the fix I registered to this site to supply you with an answer and I hope it can be of some use to you.

    I am not to sure of the BB codes here so please bare with me.

    Your index.php should look like this:
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Realestate Template</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <link href="styles.css" rel="stylesheet" type="text/css">
    </head>
    
    <body>
    
    <div class="bdyimg" align="center"><img src="http://jaybirdfolio.com/Realestate%20Template/images/bkpage.gif" align="top"></div>
    </body>
    </html>
    
    and your CSS code should look like this:
    Code:
    body {
    background: url(http://jaybirdfolio.com/Realestate%20Template/images/background.gif) 0% 0% repeat-x;
    }
    .bdyimg {
        margin-left:auto;
        margin-right:auto;
        top: 0px;
        overflow:hidden;
        
    }
    
    I hope this helps you get back on track.

    Jonathan Dey
    http://www.n33t.co.uk :cool: