救命!单元格填充不一致 - Firefox与IE7 [英] help! cell padding inconsistency- Firefox vs. IE7

查看:69
本文介绍了救命!单元格填充不一致 - Firefox与IE7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

非常沮丧,因为我无法在两个浏览器中显示相同的简单表格。它在Firefox中显示我想要它的方式,但在IE7(Windows XP)中不显示。


1)不确定我的doctype是否正确 - 这只是一个简单的vanilla html页面,所以我用了

<!DOCTYPE HTML PUBLIC" - // W3C // DTD HTML 4.01 // EN" http://www.w3.org/TR/html4/strict.dtd">


< html lang =" en">


2)我试图在表格上放置cell padding = 0,margin = 0,在样式表和html文档中放置表格单元格。没有组合有效,因此IE7将显示表格行,而行的底部没有轻微的填充。


我添加了一个边框,这样你就可以清楚地看到圆角红色底部的底部没有碰到行的底部。


我甚至将表格单元格的宽度和高度设置为图形的宽度和高度,但没有运气。 (我已检查过图形,周围没有白色边框)。


3)我无法得到中心td'的内容(1px乘1px我已经拉伸到300像素的图形在IE7中与顶部对齐。


感谢任何帮助,谢谢!


这里是页面 ...


这是我的html页面的代码:

Hello all,
am very frustrated because I can''t get a simple table to display the same way in both browsers. It displays the way I want it to in Firefox but not in IE7 (Windows XP).

1) not sure if my doctype is correct- this is just a plain vanilla html page, so I used
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html lang="en">

2) I have tried to put cell padding=0, margin=0 on the table and the table cells in both the style sheet and the html document. No combination has worked so that IE7 will display the table row without the slight padding at the bottom of the row.

I have added a border so that you can clearly see that the bottom of the rounded red corners do not touch the bottom of the row.

I''ve even set the width and height of the table cells to those of the graphic but no luck. (I''ve checked the graphic, there is no white border around it).

3) I can''t get the center td''s contents (a 1px by 1px graphic that I''ve stretched to 300 px) to align to the top in IE7.

Any help is appreciated, thank you!

Here''s the page ...

Here is my html page''s code:

展开 | 选择 | Wrap | 行号

推荐答案

您的doctype没问题。所有新页面都应该使用严格的doctype。

但是你不应该使用表格进行布局。


验证你的31个html错误列表。现在可以忽略''alt''错误。


你将遇到的另一个问题是geocities页面。他们放在顶部的垃圾会让IE进入怪癖模式。不过,现在这不是你的桌子的问题。
Your doctype is fine. All new pages should always use the strict doctype.
But you should never use tables for layout.

Validate for your list of 31 html errors. The ''alt'' errors can be ignored for now.

Another problem you''ll have is with that geocities page. The garbage they put at the top will throw IE into quirks mode. That''s not the problem with your table right now, though.


你好drhowarddrfine!


你是绝对正确的 - 我滚动了31错误,几乎所有错误都来自插入地理位置的垃圾代码。


我将页面移植到地理位置的唯一原因是因为我还没有网络托管服务。我只是需要一种方法让你们能够看到这个页面。


如果你把我的代码复制并粘贴到一个html文档中并在你的计算机上本地查看,我'我很好奇它是如何找你的。我发现在Firefox中的Geocities上查看时,表格会显示我想要的方式(图形全部排成一行,圆角红色底部没有空白区域)。如果我在我的电脑上本地打开html页面,它甚至不能在Firefox中正常显示,更不用说IE7了。


你建议我不要用表格进行布局,但我不确定什么是设置包含盒子的最有效方法。像这样会保留文字。我应该将整个框作为图形并使用图层来定位文本吗?


谢谢!


Hello drhowarddrfine!

You are absolutely right- I scrolled through the 31 errors and almost all of them are from garbage code that geocities inserted.

The only reason I ftp''d the page out to geocities is because I do not yet have a web hosting service. I just needed a way for you guys to be able to look at this page.

If you copy and paste my code into an html document and view it locally on your computer, I''d be curious how it looks for you. I found that when looking at it on Geocities in Firefox, the table displays the way I intend (graphics are all lined up, and no white space at the bottom of the rounded red corners). If I open the html page locally on my computer, it doesn''t even display properly in Firefox, let alone IE7.

You recommend that I don''t use tables for layout, but I''m just not sure what''s the most efficient way to set up a containing "box" like this which will hold text. Should I make the entire box as a graphic and use layers to position text inside of it?

Thanks!



您的doctype没问题。所有新页面都应该使用严格的doctype。

但是你不应该使用表格进行布局。


验证你的31个html错误列表。现在可以忽略''alt''错误。


你将遇到的另一个问题是geocities页面。他们放在顶部的垃圾会让IE进入怪癖模式。不过,现在这不是你的桌子的问题。
Your doctype is fine. All new pages should always use the strict doctype.
But you should never use tables for layout.

Validate for your list of 31 html errors. The ''alt'' errors can be ignored for now.

Another problem you''ll have is with that geocities page. The garbage they put at the top will throw IE into quirks mode. That''s not the problem with your table right now, though.



你建议我不要用表格进行布局,但我只是不确定设置包含框的最有效方法是什么?像这样会保留文字。
You recommend that I don''t use tables for layout, but I''m just not sure what''s the most efficient way to set up a containing "box" like this which will hold text.



前往球赛。把它扔在一起。我会回来的。

Heading to the ball game. Threw this together. I''ll be back.

展开 | 选择 | Wrap | 行号


这篇关于救命!单元格填充不一致 - Firefox与IE7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆