Solved

Centering captions with css

Posted on 2014-03-25
2
248 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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
Media Queries  not Firing 6 31
CSS for <center> 14 49
Can anyone help me find this preloader? 51 68
toggle content 12 41
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

752 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