Brett Brett - 1 year ago 85
CSS Question

Using a percentage margin in CSS but want a minimum margin in pixels?

I have set a

margin: 0 33% 0 0;
however I would also like to make sure the margin is at least a certain
amount. I know there is no
in CSS so I was wondering if I have any options here?

Answer Source

Place a div with a % width and a static min-width to the right of your element.

<div style="position:relative; float:left; margin:0">
<div style="position:relative; float:left; width:33%; min-width:200px">
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download