Goulven,

You didn't state whether you were using xhmtl or html. I use xhmtl so I'll
take a stab at this problem with css. I am sure others will have different
solutions.

To center text under an image will depend on whether the image and text are
under a block level element or not. If they are under a div, I might place a
<br/> after the image and try the following code.

div {
   text:align-center;
}

If the they are not under a block level element or one that you can apply
styles to without effecting other code, you will have to place the image
into a block level element such as a paragraph and style it.

p   {
   text-align:center;
}

You may have to give this paragraph a class, since you probably have other
paragraphs. This is where I always use my old stand by class called
"center". I create one for every site I do and use it on an as needed basis.


.center {
   text-align:center;
}

There are other ways but that depends on the layout of your page you might
try the following code only if you want all text under every image to be
centered.

image + p {
   text-align:center;
}

I hope this is what you were looking for.

Norma




On Mon, Aug 10, 2009 at 10:28 AM, Goulven CHAMPENOIS <[email protected]>wrote:

> On Wed, Aug 5, 2009 at 3:09 PM, OrientSee <[email protected]>wrote:
>
>> Sorry for this. How do I center text  beneath an image?
>>
>
> I'd simply use text-align: center on the image + text div.
> <div style="text-align: center">
>     <img src="" alt="" />
>     text
> </div>
>
> Another (and better) solution is to wrap the text in a p.legend with
> text-align: center. In HTML5 you will be able to use a dedicated tag instead
> of p.legend, but it is completely unusable for now. The following code will
> work now and later though:
>
> <div>
>     <img src="" alt="" />
>     <p class="legend">
>         text
>     </p>
> </div>
> --
> Goulven Champenois
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Blueprint CSS" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/blueprintcss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to