Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Aug 2005
    Posts
    29
    Member #
    10866
    I have an image in a <div> and it seems like it should be so simple to fix, yet for some reason float: center; doesn't work, and nothing i've tried has. I could fix it easily if I just used the HTML <center> tag, but I'm trying to avoid depreciated tags and use CSS. I know it's probably simple to fix I just don't now how.

  2.  

  3. #2
    Junior Member
    Join Date
    Aug 2005
    Posts
    29
    Member #
    10866
    I found one way to do it in an earlier post...

    margin: 0px auto 0px auto;

    but it seems like there should be a much easier way to do it... and the other thing is, in the code above, why does this act as a center function? Doesn't it just state that there is no margin?

  4. #3
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Actually, you can shortcut that one to [minicode]margin: 0px auto;[/minicode]. The reason this works is due to the way positioning is calculated with respect to margins within block-level boxes. If you're interested, this is discussed in an example on the World Wide Web Consortium website.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 03:11 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com