dcsimg
www.webdeveloper.com
Results 1 to 4 of 4

Thread: Left vs. Margin-left, basic question (i should know this by now.)

  1. #1
    Join Date
    Mar 2010
    Posts
    281

    Left vs. Margin-left, basic question (i should know this by now.)

    I have an element that i am positioning with position:absolute and i honestly don't know if i should
    use left: or Margin-left?

    What is the rule of thumb for deciding which one to use.

    (i should know this by now!)

    big thanks

    T

  2. #2
    Join Date
    Oct 2012
    Posts
    11
    I am not the expert in JavaScript,If you said position:absolute then I prefer using just "left". but "Margin-left" also should be working fine. I tried it.......

  3. #3
    Join Date
    Mar 2011
    Posts
    1,156
    To control the positioning of an element with position:absolute, use top or bottom to control the vertical position and left or right to control the horizontal position. It can seem like you're controlling position with the margin settings, but you're essentially just changing an offset from the default position settings for the element, and that may cause problems in the future.

  4. #4
    Join Date
    Mar 2010
    Posts
    281
    thank you both for the help

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles