Re: [問題] div+css滿版問題
最前面加上
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"" rel="nofollow">http://www.w3.org/TR/html4/strict.dtd">
或是
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"" rel="nofollow">http://www.w3.org/TR/html4/loose.dtd">
或是XHTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"" rel="nofollow">http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="" rel="nofollow">http://www.w3.org/1999/xhtml">
或是
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"" rel="nofollow">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="" rel="nofollow">http://www.w3.org/1999/xhtml">
IE6顯示結果可能會多個空行
IE7/Opera顯示正常
IE7會修正旁邊多出的寬度
---
example
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"" rel="nofollow">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="" rel="nofollow">http://www.w3.org/1999/xhtml">
<body>
aa
<div style='background:#C9F'>
<div style='float:left;width:200px;background:#CCF'>
test
</div>
<div style='margin-left:200px;background:#9CF'>
<table width="100%">
<tbody>
<tr>
<td>
a
</td>
<td>
b
</td>
</tr>
</tbody>
</table>
</div>
</div>
cc<br />
<div style='clear:both;'></div>
cc
</body>
</html>
---
原始討論
http://bytes.com/topic/html-css/answers/100441-problems-table-width-ie
google: ie width css 100% table
--
→
06/25 21:30,
06/25 21:30
→
06/25 21:30,
06/25 21:30
→
06/25 21:30,
06/25 21:30
→
06/25 21:30,
06/25 21:30
→
06/25 21:30,
06/25 21:30
→
06/25 21:30,
06/25 21:30
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.116.201.115
※ 編輯: nosql 來自: 140.116.201.115 (08/06 11:47)
→
08/06 11:49, , 1F
08/06 11:49, 1F
→
08/06 11:49, , 2F
08/06 11:49, 2F
推
08/06 15:41, , 3F
08/06 15:41, 3F
討論串 (同標題文章)
完整討論串 (本文為第 3 之 3 篇):
問題
2
12