| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Center a div (FF problem) within table TD
Ihave a <td>:
Code:
<td class="message-poster-box" align="center">
Forum Admin
<br /><br />
<div style="display: block; align: center; border:1px solid; background-image: url('http://dev.billiardsforum.info/forum/avatars/personal/778-160Raptox.jpg');background-repeat: no-repeat; background-position: center; height:80px; width:80px;">
</div>
210 Posts
</td>
How can i get that div to center in there? (it leans left in FF) Here is the class="message-poster-box"... Code:
.message-poster-box
{
padding: 0 20px 20px 5px;
margin: 0;
width: 173px;
text-align: center;
border-bottom: 1px solid #d0d0d0;
border-left: 1px solid #d0d0d0;
border-right: 1px solid #d0d0d0;
}
|
|
#2
|
|||
|
|||
|
You are declaring the alignment of the content *within the div*, not of the div itself. You need to declare text-align:center on the parent element of the div.
|
|
#3
|
||||
|
||||
|
to center a div you'll want to use the following CSS:
margin-left:auto; margin-right:auto; text-align:center; it also helps when the parent element has text-align:center declared.
__________________
If you found a post of mine helpful, please click on the on my post to add to my reputation.
|
![]() |
| Viewing: ASP Free Forums > Web Design > Web Layout > Center a div (FF problem) within table TD |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|