Centering an HTML page for...

Discussion in 'HTML & Website Design' started by etmedia, Oct 26, 2007.

  1. #1
    I need help centering an HTML page which I made in Dreamweaver.
    When I view it on my PC on a certain resolution that I made it in
    it looks perfect. When I view it on my Mac, the text in the middle
    and the background picture is off. Even when you make your browser
    smaller on a PC, that will happen too.

    Check the page here:

    http://amesalimo.com/etnew/NEW/home.html


    Does anybody have a solution or a script I can paste into dreamweaver?

    Thanks everyone.
     
    etmedia, Oct 26, 2007 IP
  2. gsfl4u2

    gsfl4u2 Banned

    Messages:
    1,418
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    43
    #2
    Hey et..let me find a friend of mine..he konws what hes doing most of the time..you might know him
     
    gsfl4u2, Oct 26, 2007 IP
  3. Baby Boy

    Baby Boy Guest

    Messages:
    419
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    My best suggestion is where it says:

    
    <div align="center">
    
    Code (markup):
    Change that to:

    
    <div id="center">
    
    Code (markup):
    And add this code in your CSS space in the head:

    
    #center
    {
    width: 679px;
    margin: 0px 10% 0px 10%;
    }
    
    Code (markup):
    I cannot guarantee it'll work but see what happens. It should format it using the CSS to be centered no matter the screen resolution.
     
    Baby Boy, Oct 26, 2007 IP
  4. etmedia

    etmedia Banned

    Messages:
    242
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks dude, I'll try it and let you know what happens.
     
    etmedia, Oct 26, 2007 IP
  5. etmedia

    etmedia Banned

    Messages:
    242
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #5
    It doesn't seem to work. :eek: The background picture moves when you change
    the size of the browser, but the text stays in the middle.

    Did I use a wrong kind of text?
    Should I use text field or text area?

    Thanks again.
     
    etmedia, Oct 26, 2007 IP
  6. Baby Boy

    Baby Boy Guest

    Messages:
    419
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Sorry, try this:

    
    #center
    {
    width: 100%;
    margin: 0px 10% 0px 10%;
    }
    
    Code (markup):
    That should make the width to 100% and set the left and right side of the table to 10% from the sides. 'Em, update the URL you put in the first post everytime you change it. Like, everytime you do these changes, change the page at the URL so I can see for myself.
     
    Baby Boy, Oct 26, 2007 IP
  7. etmedia

    etmedia Banned

    Messages:
    242
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Alright check it out now, same thing though...

    Also, check the source maybe you'll find a mistake?


    Thanks..
     
    etmedia, Oct 26, 2007 IP
  8. etmedia

    etmedia Banned

    Messages:
    242
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Is the text layer supposed to be text field, or text area.

    How much would you charge to design this page and make the center
    work?
     
    etmedia, Oct 26, 2007 IP
  9. gsfl4u2

    gsfl4u2 Banned

    Messages:
    1,418
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    43
    #9
    one day you will thank me for telling you about this forum cousin..i hope they treat you as good as they are treating me..I told you people would help you here..Didnt I ?
     
    gsfl4u2, Oct 27, 2007 IP
  10. srki

    srki Peon

    Messages:
    11
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #10
    wait 10 min's. I will make it for you.
     
    srki, Oct 27, 2007 IP
  11. srki

    srki Peon

    Messages:
    11
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #11
    http://rapidshare.com/files/65568970/template.rar
     
    srki, Oct 27, 2007 IP
  12. etmedia

    etmedia Banned

    Messages:
    242
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Wow it works!!
    Thank you so much Srki, you saved
    my new website!


    How about if I want to change the background so I can
    use it for another page like about? Because the
    homepage background has to stay like that and the rest of
    the site I want the same one but without the text you know?

    Thanks again!!
     
    etmedia, Oct 27, 2007 IP
  13. etmedia

    etmedia Banned

    Messages:
    242
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #13
    Thanks so much!! I got the whole thing finished!!!

    amesalimo.com/etent/


    Thanks for all your help everybody!!!
     
    etmedia, Oct 27, 2007 IP
  14. Baby Boy

    Baby Boy Guest

    Messages:
    419
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #14
    Congragulations, sorry I didnt respond in time... damn sleep got to me :eek:
     
    Baby Boy, Oct 27, 2007 IP
  15. etmedia

    etmedia Banned

    Messages:
    242
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #15
    it's okay...

    I might need to know how to put a footer...
    would it just be an image then I would
    put it in the css?
     
    etmedia, Oct 27, 2007 IP
  16. Baby Boy

    Baby Boy Guest

    Messages:
    419
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #16
    Hey et,

    Its either that or you could take a very thin (width wise) image and duplicate it using the "repeat: repeat-x;" element for the CSS variable you are setting... lol. If you don't get that, send me a PM.
     
    Baby Boy, Oct 27, 2007 IP
  17. srki

    srki Peon

    Messages:
    11
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #17
    sorry,
    you should replace next tag in your css.css file:

    .work {
    position:relative;
    top:0px;
    background-image:url(../images/home_main_middle.jpg);
    width: 675px;
    height: 476px;
    margin-left:auto;
    margin-right:auto;
    }

    should be:

    .work {
    position:absolute;
    top:172px;
    background-image:url(../images/home_main_middle.jpg);
    width: 675px;
    height: 476px;
    margin-left:auto;
    margin-right:auto;
    }

    That's because stupid Opera don't render positions like other browsers.

    Regarding footer, you have to make some img file (about 10px wide) and make it repeat like BabyBoy said. Try to combine things in your css file (positions, top, repeat-x, etc.) inside .main tag and right after closing tag of .work.

    I'm going for a beer so if you can't make it I will help you tomorrow .

    Cheers!
     
    srki, Oct 27, 2007 IP
  18. etmedia

    etmedia Banned

    Messages:
    242
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #18
    Yeah...I don't know anything you said at the end there...


    I've already made all the pages, so if I add
    the footer in the CSS files, it would show up on all
    the pages right? I just want it like the width of the background
    and the height like 8 pixels or something..

    I already made it though.
     
    etmedia, Oct 27, 2007 IP
  19. srki

    srki Peon

    Messages:
    11
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #19
    Here is some work with part of your image. You can modify some settings to fit your needs.

    http://rapidshare.com/files/65749661/template2.rar
    
    Code (markup):
    Easiest way to make other pages is to just copy and rename them (about.html, etc.),
    make one picture to replace background in work area,
    in css file copy and paste .work tag, rename it to .work2, change img settings into name of new bcg picture,
    in about.html find where is the beginning of <div class="work"> and change to work2,
    fill div area with your custom text.

    thats should work.
     
    srki, Oct 28, 2007 IP
  20. etmedia

    etmedia Banned

    Messages:
    242
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #20
    Well I got that and I've made other pages as you can
    see when you check out the site:

    amesalimo.com/etent/

    But the next problem is that
    if I add a footer, do I put it in the css?
    CAN'T I ADD THE FOOTER LIKE THIS AFTER .work { ????

    .footer {
    position:relative;
    top:0px;
    background-image:url(../images/FOOTER.jpg);
    width: 675px;
    height: 476px;
    margin-left:auto;
    margin-right:auto;
    }





    Thanks...
    and oh yeah, can I embed youtube video in the text???
     
    etmedia, Oct 28, 2007 IP