CSS: get div to expand with content
I am doing some CSS stuff and I have a div which I want to center using "margin: auto". However, the div automatically expands (horizontal) to fill the parent. I would like a way to make it just as wide as it needs to be, according to the content inside it (which will be normal text and <a>s).
|
Quote:
Look at this page: Learning Sage and scroll down until you see a yellow box at the right entitled "Functions". That's a DIV that is floated right. Its CSS definition looks like this: Code:
.sidebox { Here's my suggestion: visit Web sites until you see the effect you want. Look at the CSS. Copy it. |
All times are GMT -5. The time now is 03:45 PM. |