Home > Web Front-end > HTML Tutorial > There is a compatibility issue with the form, please give me some advice~! So sad_html/css_WEB-ITnose

There is a compatibility issue with the form, please give me some advice~! So sad_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:19:22
Original
1040 people have browsed it





无标题文档




  
     
     
  
  
    

sfsdfdfdsfdsf

 
  







在IE下, 第一行的第二个td设置了高为10,为什么显示不正常呢?


回复讨论(解决方案)

标签去掉就一样了。

在IE下, 第一行的第二个td设置了高为10,为什么显示不正常呢?
IE就是个怪胎,我折腾了1个多小时Google百度的方法都试过了都没办法将第二个td的高度设为10px。
Chrome浏览器倒是很听话。

终于找到解决方案了:请看下面的代码:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title></head><body><table width="100%" border="1" cellpadding="0" cellspacing="0">  <tr>    <td rowspan="2" width="100px" height="200px" bgcolor="#990033"> </td>    <td id="td10" style="font-size:10px;line-height:10px;height:10px" bgcolor="#FFFF00"> </td>  </tr>  <tr>     <td height="190px" bgcolor="#CC0033"><p style="margin-top">sfsdfdfdsfdsf</p></td>   </tr></table></body></html>
Copy after login

关键点:
1.表格的height="100%"属性去掉。
2.第二个td添加样式属性:style="font-size:10px;line-height:10px;height:10px"
3.第三个td设置属性:height="190px"。
最简化的代码:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title></head><body><table width="100%" border="1" cellpadding="0" cellspacing="0">  <tr>    <td rowspan="2" width="100px" height="200px" bgcolor="#990033"> </td>    <td style="font-size:10px;line-height:10px;height:10px" bgcolor="#FFFF00"> </td>  </tr>  <tr>     <td height="190px" bgcolor="#CC0033"><p>sfsdfdfdsfdsf</p></td>   </tr></table></body></html>
Copy after login

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template