Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Problem with centering text
Old 07-25-2008, 02:38 PM Problem with centering text
Average Talker

Posts: 24
Trades: 0
Hi there,

I have this html:
Code:
<div class="box">
   <h3>TEXT</h3>
   <p>
      BOX CONTENT<br />
      MORE CONTENT
   </p>
</div>
And this CSS:

Code:
 .box {
        background: #fff url(../images/box_header.gif) repeat-x top;
        border: 1px solid #EC7700;
        }
        
    .box p {
        padding: 6px;
        padding-top: 4px;
        background-color: #FF0033;
        }
    
     .box h3 {        
        padding: 6px;
        font-size: 14px;
        color: #FFF;
        font-weight: bold;
        }
My problem is whenever I attempt to center something within this div, the content that should be in the <p></p> tags is displayed outside of it. I have tried many ways including <div align="center">, <center>, <span style=...> and <div style=...>.

Why does this not display correctly?

If you would like to see the website its http://northvillebasketball.com, I have added a background color to the <p> tags so you can see where they are placed in relation to the text.

Thanks in advance!
FuZion is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-25-2008, 03:45 PM Re: Problem with centering text
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
Just put:
Code:
text-align: center
Into any of those CSS code blocks and you'll see something happen.
__________________
Join me on
Please login or register to view this content. Registration is FREE
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 07-25-2008, 04:10 PM Re: Problem with centering text
Average Talker

Posts: 24
Trades: 0
I have just added it to the p element, but it still does not display correctly, please check out http://northvillebasketball.com and look at the recent news section and you will see what I mean.
FuZion is offline
Reply With Quote
View Public Profile
 
Old 07-25-2008, 04:16 PM Re: Problem with centering text
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
I must be blind - it looks centered to me.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 07-25-2008, 04:21 PM Re: Problem with centering text
Average Talker

Posts: 24
Trades: 0
I apologize, I did not explain myself enough. If you look to the right side of the page you will see a contact us box, that box has a pink background and uses the same styling as the recent news box. The <p> element has some padding to make it look nicer, but the text is not displaying within the <p> tags in the recent news box. Thus, the padding does not work and the box displays incorrectly.

If you look at the code, the No Recent News text is within the <p> tags in the Recent News Box, but it is displayed outside. The pink area is generated by the <p> tags.
FuZion is offline
Reply With Quote
View Public Profile
 
Old 07-26-2008, 12:31 PM Re: Problem with centering text
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
Did you fix it ? I looked at the code and did some testing , still don't see the problem you describe.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 07-27-2008, 03:58 AM Re: Problem with centering text
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Pink area??

I'd be a little concerned about the navigation floating up behind the header text and logo in IE6 though
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-27-2008, 10:03 PM Re: Problem with centering text
Average Talker

Posts: 24
Trades: 0
I was able to fix this, and I am aware of the IE6 issue which is my next hurdle. Thanks!
FuZion is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Problem with centering text
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.67134 seconds with 12 queries