HTML/CSS: Centering after float element
I have a float element on the left side on my page.
Now after this float, I want to center the rest of the content.
Please see here: http://jsfiddle.net/ETm93/13/
This is what I have now. I did float: left. I can do float: right to get it to the right side, but how should i get it centered of the space that is after the floated element. Example:
IMAGE (that is floated) | stuff here in middle |..
How can I 开发者_StackOverflow中文版do that?
Use text-align: center
and display: inline
#profile_leftPanel{
width: 150px;
float: left;
border-right: 1px solid #666;
margin-right: 20px;
}
#profile_rightPanel_center {
margin-left:auto;
margin-right: auto;
text-align: center;
}
#recentStatus{
width: 400px;
text-align: center;
display: inline;
}
See http://jsfiddle.net/adamzr/QbMmX/
Have you tried changing
#profile_rightPanel_center {
float: left;
}
to
#profile_rightPanel_center {
text-align: center
}
For text only, use text-align:center;
精彩评论