Solved

Centering captions with css

Posted on 2014-03-25
2
247 Views
Last Modified: 2014-03-25
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
Comment
Question by:paulbsb
2 Comments
 
LVL 8

Accepted Solution

by:
soupBoy earned 500 total points
ID: 39954536
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
 

Author Closing Comment

by:paulbsb
ID: 39954577
It works. I had tried the text align: center; but not the display:block;
Thanks!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
move widget title down 4 26
Width of Page is Affecting Side Menu 6 32
How to position loader with CSS 3 55
Hiding Adsense on Mobile Devices 2 30
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
This article discusses four methods for overlaying images in a container on a web page
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question