×
Home About Us Products Services News Free Scripts Contact
news php scripts and software

CSS example - How to set minimum width of a div for all browsers?


CSS - How to set minimum width of a div for all browsers?

The example below will set the minimum width of the "example-div" element to 200px. It works in all major browsers (Internet Explorer, FireFox, Chrome, Safari etc.).

<style>

.example-div
{
    min-width:200px;
    width:auto !important;
    width:200px; 
}

</style>

<div class="example-div"></div>

A similar css code can be used also to set a minimum height of a div, just width should be replaced with height then -

    min-height:200px;
    height:auto !important;
    height:200px;

Category: CSS

 
<< Go back