SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2004
    Location
    Places
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Centering Images with CSS

    Hi, I was wondering if there was a way to center images with CSS without having to use div layers or tables? Because it would be really annoying to have to go and put a div layer around each and every image D:

    Site in question: http://www.the-vent.net/contest/fall2004.php

    I realize on this page that I could just use one div layer, but through out the site other images are scattered as well.

    equang
    The Ventilation Shaft-
    http://www.the-vent.net

  2. #2
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    .righttd img {
    display: block; 
    margin-left: auto; 
    margin-right: auto;
    }
    HTH
    Simon Pieters

  3. #3
    SitePoint Zealot ralphnumbers's Avatar
    Join Date
    Nov 2003
    Location
    Saint Paul, Mn
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I myself would use text-align: center because ie/win runs into some problems with the margin-left, margin-right trick.
    http://www.simplebits.com/notebook/2...centering.html
    check this out, he explains it best.

  4. #4
    SitePoint Zealot ralphnumbers's Avatar
    Join Date
    Nov 2003
    Location
    Saint Paul, Mn
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also, I would recommend putting some alt tags on your images. acessify!

  5. #5
    SitePoint Enthusiast
    Join Date
    Jul 2004
    Location
    Places
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeeeeeees, thank you!

    equang


Bookmarks

Posting Permissions

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