I\'m trying to center a Div that will have varying width\'s (based on content of a website).
I read about a relative positioning technique here:
http://www.t
@Talon; you can do it like this http://jsfiddle.net/sandeep/7PXQF/
CSS:
.container{
background-color:red;
text-align:center;
}
.center{
background-color:yellow;
display:inline-block;
text-align:left;}
HTML:
This is a div with an much wider width, to make the yellow div go off the page to the right. We'll type a bit more to be sure.
Most people will see a horizontal scroll bar on the bottom, unless their screen is very wide.