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 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Mar 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Centering div with form in it in web page

    Hi all, I'm sort of new to CSS and I've been working on the same thing for like 3 hrs. I have a page I created in fireworks and exported to dreamweaver. Everything is fine when I apply my CSS which centers and adds a background. The problem is I have a form that needs to go into the center of the page. I created the form in DW. I draw a div on the page and paste the code in at<div id="apDiv1">. The form is now in the page. The problem is that I cant seem to anchor the form there. I preview it in the browser and when I adjust the screen size the form moves but the background stays the same even when I apply CSS to the div containing the form.

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,680
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello madagascar,
    It sounds like DW is steering you toward using absolute positioning.

    The quick fix might be to make the contianing div position:relative; That way the positioned div will base it's position off the top left of it's container instead of the top left of the viewport.
    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
    New to the CF scene
    Join Date
    Mar 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you, looks like its working by simply changing it to relative

  • #4
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,680
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    After you learn a bit more you can start getting away from absolute positioning and start using floats and margins to build your webpages.

    Pitfalls of Absolute Positioning

    Float Tutorial

    It's really a shame that new coders, not having a clue where to start, are steered by DreamWeaver toward using absolute positioning and "layers." AP has it's uses but not that often.
    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


  •  

    Posting Permissions

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