Monthly Archives: September 2008

Set min/max height or min/max width for DIVs

#div1 { min-height:700px; /* Set min-height for all standards-compliant browsers */ height: expression( this.scrollHeight < 701 ? “700px” : “auto” ); /* Set min-height for IE */} #div2 { max-height:700px; /* Set min-height for all standards-compliant browsers */ height: expression( this.scrollHeight > 699 ? “700px” : “auto” ); /* Set min-height for IE */} #div3 […]

CSS styles for vertical navigation menu

#verticalnav {width: 179px;} #verticalnav ul {width: 179px;height:288px;} #verticalnav li {list-style: none;float: left;text-align:left;} #verticalnav li a {display: block;text-decoration: none; width: 151px;height:33px;font-size:17px;padding:2px 0 0 28px; background:url(../images/verticalnav_bg1.jpg);color:#32475A;} #verticalnav li a:hover {background:url(../images/verticalnav_bg2.jpg);color:#FFFFFF;}

Clear floated DIVs

#div-parent { overflow: hidden; /*Clear the float*/ width: 990px; /*IE and Opera fix for clearing, they need a dimensions*/} #div-child { float:left;}

CSS: margin=0 padding=0 applied to all elements

At the beginning of your external stylesheet, put these codes to apply (margin=0 padding=0) to all elements: * {padding: 0; margin: 0;} p {margin-top: 0;}

link to external stylesheet