IE6 space bug correction method

Time:2021-10-21

Look at the code:

Copy code

The code is as follows:

< !DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “//www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”//www.w3.org/1999/xhtml”>
<head>
<title></title>
<style type=”text/css”>
<!–
p{font-size:12px;}
p:first-letter{font-size:300%}
–>
</style>
</head>
<body>
<p>To the world, you are a person; But for someone, you are his whole world. Never frown, even when you are sad, because you never know who is falling in love with your smile</ p>
</body>
</html>

This code has no effect on the definition of the first character style of < p > in IE6. After adding spaces to P: first letter and {font size: 300%}, that is, P: first letter {font size: 300%}, the display will be normal.

This problem mainly appears in IE6 browser, and this friend also explained some necessary trigger conditions:
1. IE6 browser
2. Selectors are with pseudo classes
3. The pseudo class must have the connector “-“, for example: first letter
4. Is there a space