Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 257
  • Last Modified:

Centering captions with css

Hello,
I'm creating a photo gallery here http://www.paulb.com/1-gallery.htm and I'm trying to center the captions under the pics. I've tried setting the margins to auto, adding padding and margins, but I can't get them to move at all, let alone centered.
 I also have the attached gallery.css file that's attached to the page, but I don't thing it affects what I'm trying to do here.
Thanks,
Paul

This is the code I'm using on this page only:


<style type="text/css">
#gallery #thumbs tr td a img {
            text-decoration: none;
      border-top-width: 0px;
      border-right-width: 0px;
      border-bottom-width: 0px;
      border-left-width: 0px;
      border-top-style: 0;
      border-right-style: 0;
      border-bottom-style: 0;
      border-left-style: 0;
      margin-bottom: 10px;
      /*text-align: left;*/
      margin-left: 10px;
      }
#gallery #thumbs tr td h3 a {
      font-size: 12px;
      color: #33cc00;
      text-align: center;
      text-decoration: none;
      font-family: AndikaBasicRegular;
      padding-left: 25px;
      margin-left: 25px;
}
</style>
gallery.css
0
paulbsb
Asked:
paulbsb
1 Solution
 
soupBoyCommented:
Try adding:
text-align: center;
display: block;

to your anchor (a):

#thumbs tr td h3 a {
      font-size: 12px;
      color: #33cc00;
      text-align: center;
      text-decoration: none;
      font-family: AndikaBasicRegular;
      padding-left: 25px;
      margin-left: 25px;
      text-align: center;
      display: block;
}
0
 
paulbsbAuthor Commented:
It works. I had tried the text align: center; but not the display:block;
Thanks!
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now