xhtml1-strict.dtd, 让b1和a1平行,b2和a2平行,依次论推…… IE里可以平行,FireFox就不行……咋办……:cry: HTML: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> <style type="text/css"> <!-- .a { background-color: #CCCCCC; margin: 5px; float: left; clear: left; height: 50px; width: 53%; } .b { background-color: #999999; margin: 5px; float: right; clear: right; height: 50px; width: 43%; } --> </style> </head> <div class="a">a1</div> <div class="a">a2</div> <div class="a">a3</div> <div class="b">b1</div> <div class="b">b2</div> <div class="b">b3</div> <body> </body> </html> :cry:
:lol: 兄弟,这么些就没有问题了,应该是一个a,一个b那样的写! HTML: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>无标题文档</title> <style type="text/css"> <!-- .a { background-color: #CCCCCC; margin: 5px; float: left; clear: left; height: 50px; width: 53%; } .b { background-color: #999999; margin: 5px; float: right; clear: right; height: 50px; width: 43%; } --> </style> </head> <div class="a">a1</div> <div class="b">b1</div> <div class="a">a2</div> <div class="b">b2</div> <div class="a">a3</div> <div class="b">b3</div> <body> </body> </html>
你可以考虑将 a 相关的放到一个 DIV 中,b 相关的放到另一个中,让这两个 DIV 并列…… HTML: <div> <div class="a">a1</div> <div class="a">a2</div> <div class="a">a3</div> </div> <div> <div class="b">b1</div> <div class="b">b2</div> <div class="b">b3</div> </div>