什么时候div不是div? [英] When is a div not a div?

查看:77
本文介绍了什么时候div不是div?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个看似与其背景脱节的div。


我正在翻新一个网站 www.dja.co.nz 。它在上周六转发了

在一台新服务器上,我的所有新鲜的css都很好。


这是一个三列布局,中间列较大。今天,两个外部的
列仅在MSIE中变宽了大约80个像素。这已经打破了布局,这意味着右侧列没有足够的空间,而且是b / b $ b $分流到中心列的底部。具体来说,左栏中的蓝色

背景颜色变得更宽,将

中央列向右推;左侧列中的文本仍然受原始160px列宽限制。
受限于原始的160px列宽。通过将左手div的宽度更改为120px来证明这一点;只有文本被重新格式化;

蓝色无法移动。


它似乎在MSIE 7中正确显示。它在FF中显示正确,

Opera,Netscape,K-Meleon和Amaya。


任何人都可以建议为什么背景突然表现不同来自div本身?
来自div本身?或者指出我错过了什么?


理由告诉我这是我做出的改变的结果,但我徒劳地搜索

for与这些div远程连接的更改。它必须是另一个变化

- 但是什么?


有人愿意看样式表吗?


对于任何帮助我都会感到非常感激。


谢谢。


Richard。

解决方案

ri*****@NOSPAMwordshine.co.nz ( Richard Treadgold写道:

我正在翻新网站 www.dja.co.nz 。它是在上周六转发的新服务器上,带有我所有新鲜的css。

这是一个三列布局,中间列较大。今天,两个外部列仅在MSIE中变宽,大约80像素。




您的doctype触发怪异模式,将其更改为:

<!DOCTYPE html PUBLIC" - // W3C // DTD HTML 4.01 // EN">

看看是否有帮助。

-

Spartanicus


Spartanicus写道:


您的doctype触发怪异模式,将其更改为:
<!DOCTYPE html PUBLIC" - // W3C // DTD HTML 4.01 // EN">
看看是否有帮助。




嗯,谢谢,Spartanicus,这让我成为Google''css quirks模式'',我发现

更多关于doctype声明。


顺便提一下,大多数页面都已经调用了Strict doctype - 你

一定找到了我错过的一个。


尽管如此,改变它并没有解决布局问题,尽管有很多重新加载。

它仍然适用于FF但是不是在IE6。


我还有其他途径可以探索吗?


Richard


ri*****@NOSPAMwordshine.com (Richard Treadgold)写道:

您的doctype触发怪癖模式,将其更改为:
<!DOCTYPE html PUBLIC" - // W3C // DTD HTML 4.01 // EN"> <看看是否有帮助。

嗯,谢谢,Spartanicus,这让我成为Google''css quirks模式'',我发现了更多关于doctype声明的内容。<顺便提一下,大多数页面都已经调用了严格的文档类型 - 你必须找到一个我错过的文档。

然而,更改它并没有修复布局问题,尽管重新加载。
它仍然在FF中工作,但不在IE6中。




主页仍然使用不正确的doctype。

我还有其他途径可以探索吗?


将代码减少到最低限度可以帮助您查看任何问题,并且如果您仍然需要帮助,我们将获得支付。


但你的第一个停靠点应该是修复众多的验证

错误。
http://validator.w3.org/check?uri=http://www.dja.co。 nz /
http://jigsaw.w3.org/css-validator/v...www.dja.co.nz/


- -

Spartanicus


I have a div seemingly divorced from its background.

I''m refurbishing a web site at www.dja.co.nz. It was reposted last Saturday
on a new server with all my nice fresh css.

It''s a three-column layout with a larger centre column. Today, the two outer
columns have, in MSIE only, become wider by about 80 pixels. This has broken
the layout, meaning the right-hand column has insufficient room and is
shunted to the bottom of the centre column. Specifically, the blue
background colour to the left-hand column has become wider, shoving the
central column to the right; the text in the left-hand column is still
constrained by the original 160px column width. This is proved by changing
the width of the left-hand div to 120px; only the text is reformatted; the
blue doesn''t move.

It appears to display correctly in MSIE 7. It does display correctly in FF,
Opera, Netscape, K-Meleon and Amaya.

Can anyone suggest why the background should suddenly behave differently
from the div itself? Or point out what I have missed?

Reason tells me this is a result of a change I''ve made, but I search in vain
for a change remotely connected with those divs. It must be another change
-- but what?

Would anyone care to see the style sheet?

I''d be pathetically grateful for any help.

Thank you.

Richard.

解决方案

ri*****@NOSPAMwordshine.co.nz (Richard Treadgold) wrote:

I''m refurbishing a web site at www.dja.co.nz. It was reposted last Saturday
on a new server with all my nice fresh css.

It''s a three-column layout with a larger centre column. Today, the two outer
columns have, in MSIE only, become wider by about 80 pixels.



Your doctype triggers quirks mode, change it to:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
see if that helps.

--
Spartanicus


Spartanicus wrote:


Your doctype triggers quirks mode, change it to:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
see if that helps.



Hmmm, thanks, Spartanicus, that made me Google ''css quirks mode'' and I found
out a lot more about the doctype declaration.

Incidentally, most of the pages do already invoke the Strict doctype -- you
must have found one I missed.

Still, changing it did not fix the layout problem, despite much reloading.
It still works in FF but not in IE6.

Are there any other avenues I might explore?

Richard


ri*****@NOSPAMwordshine.com (Richard Treadgold) wrote:

Your doctype triggers quirks mode, change it to:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
see if that helps.

Hmmm, thanks, Spartanicus, that made me Google ''css quirks mode'' and I found
out a lot more about the doctype declaration.

Incidentally, most of the pages do already invoke the Strict doctype -- you
must have found one I missed.

Still, changing it did not fix the layout problem, despite much reloading.
It still works in FF but not in IE6.



The home page still uses the incorrect doctype.
Are there any other avenues I might explore?



Reducing the code to the bare minimum helps you to see any problems, and
us if then you still need help.

But your first port of call should be fixing the numerous validation
errors.
http://validator.w3.org/check?uri=http://www.dja.co.nz/
http://jigsaw.w3.org/css-validator/v...www.dja.co.nz/

--
Spartanicus


这篇关于什么时候div不是div?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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