We Recommend

CSS: The Definitive Guide CSS: The Definitive Guide
Provides you with a comprehensive guide to CSS implementation, along with a thorough review of all aspects of CSS 2.1. Updated to cover Internet Explorer 7, Microsoft's vastly improved browser, this new edition includes content on positioning, text wrapping (nowrap), lists and generated content, table layout, user interface, paged media, and more.


Posted By

roberocity on 07/09/06


Tagged

hack minmax ie6


Versions (?)


Who likes this?

63 people have marked this snippet as a favorite

designerd
joernba
katxorro70
mate
meth
postNuKe
kaminogoya
panatlantica
dertimbo
pocorn
fatihturan
markfavazza
marza
billtaichi
yu_industries
aznprncritic
dmarten
Sahoglu
Poltras
tavo
icarus
hollowmyth
manub
robotoverlord
rich13
marcoba
jonhenshaw
vali29
heinz1959
candes
pagetoscreen
aziz
hariharank12
Winkyboy
willgarrison
visuallyspun
kaiser79
arala22
marcio
vasya1905
jbreen
seekup00
avioli
stphnclysmth
vbert
snucko
wbowers
maddesigns
gbot
gtalmes
chill3d
sgiberson
shalo
digitalifer
stylz
alvaroisorna
juliend2
JustinCrossman
Mithun
riz
pablodgavilan
wizard04
bassdas


min/max-width fix for IE6


Published in: CSS 


Javascript expression in css to allow for min/max widths. replaces the min-width, max-width that works for IE6.


  1. #content {
  2. height: 75px;
  3. background-color: #000;
  4. color: #fff;
  5. width: expression(document.body.clientWidth < 742? "740px" : document.body.clientWidth > 1202? "1200px" : "auto");
  6. min-width: 740px;
  7. max-width: 1200px;
  8. }

Report this snippet 

You need to login to post a comment.