Log in

View Full Version : text-align CENTER not responding



jerdy
07-23-2010, 12:25 AM
Find issue @ www.yogamoves.net/time_out.html

I am trying to center a few quotes, here is the code I am using:

.smallquote {
text-align: center;
font-weight: bold;
}
.smallquote_sub {
text-align: center;
font-weight: lighter;
font-style: italic;
}

When I am viewing the Dreamweaver preview it works, but when I preview on Firefox the centering doesn't show up, anybody know the reason? I've had this problem a few times... :confused:

I am also trying to use padding between paragraphs, I used this code:

<p class="sub_title" style="margin-top:-10px" "padding-bottom:20px">~ Both CDs ~</p>

Screen shot of issue, color coded:
http://i847.photobucket.com/albums/ab38/metzhere/quote_paddingissue.jpg

traq
07-23-2010, 12:47 AM
what element are you applying the class (smallquote / smallquote_sub) to?

About the paragraph, your negative top margin is effectively canceling out half of your bottom padding.

azoomer
07-23-2010, 01:02 AM
A span element can not be centered like that. Either you can change it to <p> elements or you can make the span element display:block like this

.smallquote {
display: block;
text-align: center;
font-weight: bold;
}
.smallquote_sub {
display: block;
text-align: center;
font-weight: lighter;
font-style: italic;
}
Regarding the last part try to change it to

<p class="sub_title" style="margin-top:-10px; padding-bottom:20px;">~ Both CDs ~</p>
removing two quotes in the middle and adding some semicolons