为什么我的链接在IE中间隔开? [英] Why are my links spaced out in IE?

查看:60
本文介绍了为什么我的链接在IE中间隔开?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,


我刚刚尝试了一个基于CSS的设计,它可以像我预期的那样工作在
FF和Opera中,但是有问题IE浏览器。如果您在查看我当前的

版本FF中的http://www.kidsinaction.org.uk/FredsBoots/Freds.html
或者

Opera,左边距中的链接按预期显示在一起。


如果你在IE浏览器中查看相同的页面,这些链接是相当分开的,

,它们之间的垂直空间比我想要的多。知道为什么会这样吗?

我想这与我制作链接的事实有关

" display:block"因为我想悬停效果(颜色的变化)到

会影响边距的整个宽度,而不仅仅是链接中的文本宽度。
>

任何有关正在发生的事情的解释,以及我可以采取哪些措施来解决问题

。请原谅任何明显的错误,我不会声称自己是专家

就此!!


TIA


-

Alan Silver

(此行下面添加的任何东西都与我无关)

解决方案

Alan Silver写道:

你好,

我刚刚尝试了一种基于CSS的设计,它按照我的预期工作FF和Opera,但IE有问题。如果您在 http://查看我当前的
版本在FF或
Opera中的www.kidsinaction.org.uk/FredsBoots/Freds.html
,左边距中的链接按预期显示在一起。

如果你看一下在IE中的同一页面,这些链接相当分散,它们之间的垂直空间比我想要的更多。知道为什么会这样吗?




如果您这样做,IE可以运行:


< ul>

< li>< a href ="">工作服< / a>< / li>< li>< a

href =""> ;安全靴< / a>< / li>< li>< a

href =""> Boilersuits< / a>< / li>< li>< ;

href =""> Safety Jackets< / a>< / li>< li>< a

href ="" > HiViz背心< / a>< / li>< li>< a

href ="">工作靴< / a>< / li>< li> ;< a

href =""> Jackets< / a>< / li>< li>< a

href ="" ;> T恤< / a>< / li>< li>< a

href ="">眼睛保护< / a>< / li>< ; li>< a

href =""> Hard Hats< / a>< / li>

< / ul>


它看到< / li>末尾的换行符作为换行符?

糟糕的浏览器,没有甜甜圈。


为什么要创建具有Transitional doctype的新文档?你好b / b
应该使用Strict。


-

-bts

-警告:我草坪鹿刹车


文章< ml ***************** @ bgtnsc05-news.ops.worldnet。 att.net>,

Beauregard T. Shagnasty< a。********* @ example.invalid>写道

< snip>

如果您执行此操作,IE可以运行:
< snip>它会在< / li>结尾看到换行符;作为...换行?
糟糕的浏览器,没有甜甜圈。


啊哈,就是这样。


如果没有IE,生活会如此沉闷,你不觉得吗?想象一下,从

开始,在所有浏览器中编写web

页面并使它们看起来一样。我们整天会对自己做些什么?


无论如何,删除换行符可以解决问题,但这些链接之间仍然存在差距。\\ b
。我在< li>上都设置了零保证金。和

< a>元素,FF和Opera不会在链接之间留下任何空间,

但IE仍然可以。您可以通过将鼠标从一个链接

移动到另一个链接并注意到两者之间没有

链接处于悬停状态的点来看到这一点。在FF和Opera中,你直接从一个链接的

悬停状态转到下一个链接的悬停状态。


任何解释?

为什么要使用Transitional doctype创建新文档?你应该使用Strict。




哎呀,错了。我在一台旧机器上敲了那个测试,这台旧机器上有一个用于HTML页面的过时的
过时模板。我没注意到doctype。谢谢

指出来。


非常感谢您的帮助。任何补充答案都是

也感激不尽。


-

Alan Silver

(此行下面添加的任何内容都与我无关)


Alan Silver写道:

文章< ml *****************@bgtnsc05-news.ops.worldnet.att.net> ;,
Beauregard T. Shagnasty< a。******* **@example.invalid>写道
< snip>

如果您执行此操作,IE可以正常工作:< snip>

它会在< / li>的末尾看到换行符;作为...换行?糟糕的浏览器,没有甜甜圈。



啊哈,就是这样。

没有IE,生活会如此沉闷,不是吗认为?想象一下,从一开始就编写
网页并让它们在所有浏览器中看起来都一样。我们整天会对自己做些什么?




好​​吧,我会骑摩托车去找一个好的芝士汉堡

道路。

无论如何,删除换行符可以解决问题,但这些链接之间仍然存在差距。我在< li>
和< a>上都设置了零保证金。元素,FF和Opera不会在
链接之间留下任何空间,但IE仍然可以。


是的,IE中有一点差距;但是,我不认为这对页面的显示有害。我的意见,当然。

您可以通过将鼠标从一个链接移动到另一个链接来看到这一点,并注意到两者之间没有任何链接的位置。
悬停状态。在FF和Opera中,你直接从一个链接的悬停状态转到下一个链接的悬停状态。


为什么不将它们设计为看起来像按钮呢?没有任何改变

除了CSS。


我会告诉你一个在我的网站上使用的例子,''该死的

服务器今天关闭。 [我不会提这个价格实惠的

服务器的名字...]

有什么解释吗?




不,除非您刚刚更改了自发布以来的页面。在IE浏览器中我看起来很好

,悬停颜色变化延伸到块的末尾。

为什么您使用Transitional doctype创建新文档?你应该使用Strict。



哎呀,错了。我在一台旧机器上敲了那个测试,这台机器上有一个过时的HTML页面模板。我没注意到doctype。谢谢
指出。




欢迎。 < g>


-

-bts

-警告:我为草坪鹿刹车


Hello,

I have just been trying a CSS-based design that works as I expected in
FF and Opera, but has a problem with IE. If you look at my current
version at http://www.kidsinaction.org.uk/FredsBoots/Freds.html in FF or
Opera, the links in the left margin appear close together as expected.

If you look at the same page in IE, these links are quite spaced out,
with more vertical space between them than I want. Any idea why this is?
I guess that it is connected to the fact that I made the links
"display:block" as I wanted the hover effect (change of colours) to
affect the full width of the margin, not just the width of the text in
the link.

Anyone any explanation of what is happening, and what I can do to fix
it. Please forgive any obvious blunders, I don''t claim to be an expert
on this!!

TIA

--
Alan Silver
(anything added below this line is nothing to do with me)

解决方案

Alan Silver wrote:

Hello,

I have just been trying a CSS-based design that works as I expected in
FF and Opera, but has a problem with IE. If you look at my current
version at http://www.kidsinaction.org.uk/FredsBoots/Freds.html in FF or
Opera, the links in the left margin appear close together as expected.

If you look at the same page in IE, these links are quite spaced out,
with more vertical space between them than I want. Any idea why this is?



IE works if you do this:

<ul>
<li><a href="">Workwear</a></li><li><a
href="">Safety Boots</a></li><li><a
href="">Boilersuits</a></li><li><a
href="">Safety Jackets</a></li><li><a
href="">HiViz Vests</a></li><li><a
href="">Work Boots</a></li><li><a
href="">Jackets</a></li><li><a
href="">T-shirts</a></li><li><a
href="">Eye Protection</a></li><li><a
href="">Hard Hats</a></li>
</ul>

It sees the line feed at the end of the </li> as .. a line feed?
Bad browser, no donut.

Why are you creating new documents with a Transitional doctype? You
should be using Strict.

--
-bts
-Warning: I brake for lawn deer


In article <ml*****************@bgtnsc05-news.ops.worldnet.att.net>,
Beauregard T. Shagnasty <a.*********@example.invalid> writes
<snip>

IE works if you do this: <snip>It sees the line feed at the end of the </li> as .. a line feed?
Bad browser, no donut.
Ah ha, that was it.

Life would be so dull without IE, don''t you think? Imagine writing web
pages and having them look the same in all browsers right from the
start. What would we do with ourselves all day?

Anyway, removing the line feeds fixed the problem, but still leaves a
gap between these links. I have set a zero margin on both the <li> and
<a> elements, and FF and Opera do not leave any space between the links,
but IE still does. You can see this by moving your mouse from one link
to another and noting that there is a point in between where neither
link is in the hover state. In FF and Opera, you go directly from the
hover state of one link to the hover state of the next.

Any explanation?
Why are you creating new documents with a Transitional doctype? You
should be using Strict.



Oops, mistake. I knocked up that test on an old machine that had an
outdated template for HTML pages. I didn''t notice the doctype. Thanks
for pointing it out.

Thanks very much for the help. Any answers to the supplementary would be
gratefully received too.

--
Alan Silver
(anything added below this line is nothing to do with me)


Alan Silver wrote:

In article <ml*****************@bgtnsc05-news.ops.worldnet.att.net>,
Beauregard T. Shagnasty <a.*********@example.invalid> writes
<snip>

IE works if you do this: <snip>

It sees the line feed at the end of the </li> as .. a line feed? Bad
browser, no donut.



Ah ha, that was it.

Life would be so dull without IE, don''t you think? Imagine writing
web pages and having them look the same in all browsers right from
the start. What would we do with ourselves all day?



Well, I would go for a motorcycle ride and find a good cheeseburger
somewhere down the road.
Anyway, removing the line feeds fixed the problem, but still leaves a
gap between these links. I have set a zero margin on both the <li>
and <a> elements, and FF and Opera do not leave any space between the
links, but IE still does.
Yes, there is a wee bit of gap in IE; however, I don''t think it is
detrimental to the display of the page. My opinion, of course.
You can see this by moving your mouse from one link to another and
noting that there is a point in between where neither link is in the
hover state. In FF and Opera, you go directly from the hover state of
one link to the hover state of the next.
Why not style them to look like buttons instead? No change to anything
other than the CSS.

I would show you an example used at a site of mine, ''cept the damn
server is down today. [I will not mention the name of this affordable
server...]
Any explanation?



No, unless you''ve just changed the page since your post. It looks fine
to me in IE and the hover color change extends to the end of the block.

Why are you creating new documents with a Transitional doctype? You
should be using Strict.



Oops, mistake. I knocked up that test on an old machine that had an
outdated template for HTML pages. I didn''t notice the doctype. Thanks
for pointing it out.



Welcome. <g>

--
-bts
-Warning: I brake for lawn deer


这篇关于为什么我的链接在IE中间隔开?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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