<span> with <div> as parent:div#ex1 > span {
font-style: italic;
}
Above was the original coding using a child selector, which doesn't work in IE6.
span.ie6 {
font-style: italic;
}
Above is a quick addition to work in IE6, though it does require creating a new class target.
This <div> should be at least 500px wide.
div#ex11 div {
min-width: 500px;
background: yellow;
}
Above style rule works in IE7 and Firefox, but not in IE6, which by
default extends only as far as the content (i.e., text) extends.
Below the original code is rewritten with an IE6 HACK
div#ex11 div {
width: 500px; In IE6 the width property works basically like the min-width property in IE7 and Firefox.
min-width: 500px;
float: left;
background: gray;
}
div#ex11 div {
width /**/: auto; This Hack applies these styles to all BUT IE6, basically overwriting the IE6-specific code for
Firefox and IE7.
background /**/: yellow;
}
This <div> should be no more than 500px wide. This <div> should be no more than
500px wide. firefox_doesnt_have_wordBreak_CSS_rule._Can_use_the_Conditional_Statement_in_Head_part_of_this-page_(note spaces_will_break_to_a_new_line_in_a_text_string_in_firefox.<space>
So_you_can_either_add_spaces_or_you_can_set_overflow_to_"hidden",<space>
which_doesn't_break_the_text_to_a_new_line,_it_simply_hides_it_from_view. This <div> should be no more
than 500px wide. This <div> should be no
more than 500px wide.
div#ex12 div {
float: left;
max-width: 500px;
background: pink;
}
Hack to display ONLY in IE6
/*\*/ * html div#ex12 div {
background: green;
width: 500px;
margin: 0 0 15px 0;
} /**/
You could add the declaration: "word-wrap: break-word;" to the above Hack. However, this is a proprietary Microsoft CSS rule,
which needs to be hidden within a Conditional Comment to validate. So I placed the Conditional Comment (that you see below)
in the header area.
<!--[if IE]>
<style type="text/css">
div#ex12 div {word-wrap: break-word;}
</style>
<![endif]-->