< H1> IE6或IE7 [英] <h1> en IE6 or IE7

查看:60
本文介绍了< H1> IE6或IE7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我被要求为初学者写一个CSS / HTML课程(对我自己?:))。


我想到IE的一个奇怪的行为< h1> ;。


只需看看 http://www.web-garden.be/tijdelijk/index2.html


我添加到< h1a border 1px solid black。


然而,IE会在所有内容周围设置边框,而不仅仅是标题。


在FF中,一切看起来都很棒。

I''m asked to write a CSS/HTML course for beginners (for myself?:)).

I came up to a strange behaviour of IE regarding <h1>.

Just look to http://www.web-garden.be/tijdelijk/index2.html

I added to <h1a border 1px solid black.

However IE puts a border around everything instead of only the header.

In FF everything look great.

推荐答案

Scripsit Jobe:
Scripsit Jobe:

我被要求为初学者写一个CSS / HTML课程(对我自己? :))。
I''m asked to write a CSS/HTML course for beginners (for myself?:)).



您是否考虑给出诚实的答案? (提示:那将是我不能,

我不能胜任。

Did you consider giving the honest answer? (Hint: That would be "I can''t,
I''m not competent.")


看看 http://www.web-garden.be/tijdelijk/index2 .html



这是无效的标记;所有的赌注都已关闭。


您还使用猪拉丁语作为内容占位符,这是一个_bad_

示例,并且您正在设置字体大小(像素)。所以我认为你应该考虑给出诚实的答案。 (提示:你可以添加我不能写一个

CSS / HTML课程。我需要_read_一门HTML课程和一门课程

CSS 。")

It''s invalid markup; all bets are off.

You''re also using pig Latin as content placeholder, which is a _bad_
example, and you''re setting the font size in pixels. So I think you should
consider giving the honest answer. (Hint: You might add "I can''t write a
CSS/HTML course. I need to _read_ both a course in HTML and a course in
CSS.")


我添加到< h1a border 1px solid black。
I added to <h1a border 1px solid black.



如果你使用了验证器,你就不会那么惊讶了。


-

Jukka K. Korpela(Yucca)
http://www.cs.tut.fi/~jkorpela/

If you had used a validator, you wouldn''t be so surprised.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/


2006-10-29,Jobe< jo * *******@gmail.com写道:
On 2006-10-29, Jobe <jo********@gmail.comwrote:

我被要求为初学者写一个CSS / HTML课程(对我自己?:))。


我遇到了IE关于< h1>的奇怪行为。


只看 http://www.web-garden.be/tijdelijk/index2.html

我添加到< h1a border 1px solid black。


然而,IE会在所有内容周围放置边框,而不仅仅是标题。
I''m asked to write a CSS/HTML course for beginners (for myself?:)).

I came up to a strange behaviour of IE regarding <h1>.

Just look to http://www.web-garden.be/tijdelijk/index2.html

I added to <h1a border 1px solid black.

However IE puts a border around everything instead of only the header.



这可能是因为你忘了关闭< h1tag。

It may because you forgot to close the <h1tag.


在FF中,一切看起来都很棒。
In FF everything look great.



猜猜你的意思是< / h1before< h2>。但你显然应该不依赖于这种行为。


这是我使用的有用程序:

http://tidy.sourceforge.net/


检查这样的事情。

It guessed that you meant </h1before <h2>. But you obviously should
not rely on this kind of behaviour.

This is a useful program I use:

http://tidy.sourceforge.net/

to check things like that.


Jobe写道:
Jobe wrote:

我被要求写一个CSS / HTML课程适合初学者(对我来说?:))。


我想出了关于< h1>的IE的奇怪行为。


只需查看 http://www.web-garden.be /tijdelijk/index2.html


我添加到< h1a border 1px solid black。


但IE放置边框围绕一切而不仅仅是标题。


在FF中,一切看起来都很棒。
I''m asked to write a CSS/HTML course for beginners (for myself?:)).

I came up to a strange behaviour of IE regarding <h1>.

Just look to http://www.web-garden.be/tijdelijk/index2.html

I added to <h1a border 1px solid black.

However IE puts a border around everything instead of only the header.

In FF everything look great.



您需要关闭< h1element。你有:


< body>

< h1> Hoofdstuk I:Basisopbouw van een webpagina

< h2> Inleiding< / h2>


在Hoofdstuk的末尾放置一个< / h1。线。当它遇到另一个块级元素时,IE并没有关闭

< h1。前往

验证器的行程会向您显示:

< http://validator.w3.org/check?verbose = 1& uri = http%3A %2F%2Fwww.web-garden.be%2Ftijdelijk%2Findex2.html>


进一步推荐:

不要在px中指定字体大小(或者pt)。 IE无法调整大小。使用

百分比,内容100%,标题元素更大。
http://k75s.home.att.net/fontsize.html

您应该为新文档使用严格的doctype; Transitional用于

旧页面,可能使用HTML 4.01 Strict而不是XHTML。
http://w3.org/QA/2002/04/valid-dtd-list.html


-

-bts

-Motorcycles无视重力;汽车只是吮吸

You need to close the <h1element. You have:

<body>
<h1>Hoofdstuk I: Basisopbouw van een webpagina
<h2>Inleiding</h2>

Place an </h1at the end of the "Hoofdstuk" line. IE isn''t closing the
<h1when it encounters another block level element. A trip to the
validator would have shown you this:
<http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fwww.web-garden.be%2Ftijdelijk%2Findex2.html>

Further recommendations:
Don''t assign font sizes in px (or pt). IE can''t resize them. Use
percents, 100% for content, larger for the header elements.
http://k75s.home.att.net/fontsize.html

You should use a Strict doctype for new documents; Transitional is for
legacy pages, and probably use HTML 4.01 Strict instead of XHTML.
http://w3.org/QA/2002/04/valid-dtd-list.html

--
-bts
-Motorcycles defy gravity; cars just suck


这篇关于&LT; H1&GT; IE6或IE7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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