Layers in Dreamweaver

Discussion in 'HTML & Website Design' started by d16man, Jun 3, 2006.

  1. #1
    Is there a way to center a new layer in Dreamweaver? I am using a layer to place a heading over an image. On my main computer (laptop with 15" screen) it is perfectly centered, but on my desktop (15" flat panel) the heading shows to the left. Just wondering. Thanks. The website is my guitar website. I would like to know where it shows up on your machine as well.
     
    d16man, Jun 3, 2006 IP
  2. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #2
    You don't have a complete and proper DTD, which causes browsers to switch into quirks mode. Not too big a problem with many browsers, but a killer in IE (and Opera, which is an IE wannabe in quirks).

    Use html 4.01 strict, and validate the html. If you still have problems, at least all browsers will be on the same page, and you will have a sane code base to work from.

    cheers,

    gary
     
    kk5st, Jun 3, 2006 IP
  3. brian394

    brian394 Well-Known Member

    Messages:
    226
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    108
    #3
    Here's your problem...

    If you're trying to center something horizontally you can't rely on absolute coordinates. :D

    Try this instead...

    Whenever you're using absolute positioning and you want to center something horizontally you have to set your left property to 50% and then to correct the offset that it causes you have to set the margin-left property to be half the width of your element and then stick a minus sign in front of it (to move it to the left). In this case, the width of your text is 200px so we set your margin-left to -100px.

    I also condensed all your code down into one <h1> tag to make it easier to read. :D
     
    brian394, Jun 6, 2006 IP