Can't center or add top margin to webpage

Discussion in 'Scripts' started by DaveFL, Aug 6, 2013.

to remove all ads.
  1. DaveFL

    DaveFL New Member

    Messages:
    3
    I recently created a new webpage but I'm having problems trying to center it vertically. I'm really new to html and css so I was hoping someone might be able to explain to me in layman terms how to edit my html to either get my page to center vertically or at least how to add a top margin so the page isn't stuck right up against the top of the screen. I tried changing the top margin value from 0 to something else, but it didn't work. Here is my current html:

    <html>
    <head>
    <title>Webpage Home 3</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
    <!-- ImageReady Slices (Webpage Home 3.psd) -->
    <a href="http://website.com/portfolio.pdf">
    <img src="images/index.jpg" width="1000" height="768" border="0" alt=""></a>
    <!-- End ImageReady Slices -->
    </body>
    </html>


    Any help with this would be much appreciated.
     
  2. chrishirst

    chrishirst Well-Known Member Staff Member

    Messages:
    2,611
    HTML:
    <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
    Why are you using HTML code that was deprecated in 1999???
     
  3. GUDVH

    GUDVH New Member

    Messages:
    45
    <body>
    <br><br>... before your first content, as many times as you like to lower the page! It's the simplest ways :)
     
  4. d a v e

    d a v e New Member

    Messages:
    671
    '

    assuming everyone has the same size "page" as you - inluding those with the same text size, browser size, screen size - kind of doubtful if you have those on a mobile phone or tablet up to those with a maximised browser on say a 27" screen of 1600px wide or more :)
     
  5. chrishirst

    chrishirst Well-Known Member Staff Member

    Messages:
    2,611
    Oh Please!!!! May I suggest that you do NOT give up your day job to become a web developer!!
     
  6. GUDVH

    GUDVH New Member

    Messages:
    45
    :p ... :D ... ;)
     
  7. ronaldroe

    ronaldroe Super Moderator Staff Member

    Messages:
    1,223
    Because he's using a technology that was created in 2002 that was out of date when it was released.
     
  8. leroy30

    leroy30 New Member

    Messages:
    485
    http://www.qrcodegenerator.co.nz/ > F12 [Developer Tools] > Clickety click

    No, I'm not spamming lol. Yes, this is one of my websites.

    It's centered vertically. Just use developer tools to see how. Can't really be arsed explainin it when it's already a google search away.
     

Share This Page