Thursday, 3 October 2013

Minimal left margin for centred div

Minimal left margin for centred div

Is there a "css" way of making a centred div behave as if it had a minimal
left margin? I would like a centred div to be centred on a page unless the
width of that page is less than a certain value. Something like the
following:
.centred { width: 400px; margin: 0 auto; min-margin-left: 200px; }
I know that min-margin-left doesn't exist, but how could I achieve this?
Below is an example in pictures. Think that grey border is the browser and
blue box is my "centred" div.

No comments:

Post a Comment