Netscape中不需要的空间btwn div [英] Unwanted space btwn divs in Netscape
问题描述
在下面的代码中,Explorer上的一切看起来都很好,但在Netscape
上,''top''部分和''底部菜单''
部分。我已经设置了'div img {display:block}''的风格已经摆脱了
Netscape在图像周围放置空间的问题,但它没有为
这个。将边距和填充设置为零也不做任何事情。这是代码:
<! - top - >
< div style =" width:100%; background:url(week01 / images / innertop.gif)
repeat-x top;">
< img
src = " week01 /图像/ innercorner.gif" ALT =""宽度= QUOT; 23" height =" 23"
style =" padding-left:125px; background-color:#B5302B; ">
< / div>
<! - 底部菜单 - >
< div style =" width:130px;背景:#b5302b
url(week01 / images / innerright.gif)repeat-y right; float:left;">
< h3> Item 1< / h3>
< h3> Item 2< / h3>
< h3>第3项< / h3>
< / div>
<! - bottom head - >
< div>
文字到这里
< / div>
谢谢,
Aaron
Aaron写道:
在下面的代码中,Explorer上的一切看起来都很好,但在Netscape上,顶部部分和底部菜单部分之间存在较大的白色间隙。我已经设置了'div img {display:block}'的风格,以摆脱Netscape在图像周围放置空间的问题,但它没有为此做任何事情。将边距和填充设置为零也不做任何事情。这是代码:
<! - top - >
< div style =" width:100%; background:url(week01 / images / innertop.gif)
repeat-x top;">
< img
src =" week01 / images / innercorner.gif" ALT =""宽度= QUOT; 23" height =" 23"
style =" padding-left:125px; background-color:#B5302B; ">
< / div>
<! - 底部菜单 - >
< div style =" width:130px;背景:#b5302b
url(week01 / images / innerright.gif)repeat-y right; float:left;">
< h3> Item 1< / h3>
< h3> Item 2< / h3>
< h3> Item 3< / h3>
< / div>
<! - - head head - >
< div>
文字在这里
< / div>
谢谢,
Aaron
空间由div内的图像构成。尝试将一个彩色的
背景添加到顶部div中,你会看到
两个div之间没有差距...你为什么放图像的背景颜色?而且,按照上帝的缘故,不要把空的alt放在上面。属性;-)
AndrésSedano写道:Aaron写道:
[snip]< blockquote class =post_quotes>< img
src =" week01 / images / innercorner.gif" ALT =""宽度= QUOT; 23" height =" 23"
style =" padding-left:125px; background-color:#B5302B; ">
< / div>
[snip]
并且,出于上帝的缘故,不要放一个空的alt属性; - )
为什么不呢?如果该图像是用于装饰(是吗?),而不是添加盲人或使用文本浏览器的人可能需要的值,那么空的
alt肯定是最好的吗?
-
Barry Pearson
http://www.Barry.Pearson.name/photography/
http://www.BirdsAndAnimals.info/
http://www.ChildSupportAnalysis.co.uk/
Barry Pearson写道:AndrésSedano写道:
Aaron写道:
[snip]
< img
src =" week01 / images / innercorner.gif" ALT =""宽度= QUOT; 23" height =" 23"
style =" padding-left:125px; background-color:#B5302B; ">
< / div>
[snip]
并且,为了上帝,不要把空的alt属性; - )
为什么不呢?如果该图像用于装饰(是吗?),而不是添加盲人或使用文本浏览器的人可能需要的值,那么空的
alt肯定是最好的吗?
如果它是用于装饰(绝对是演示文稿),它必须不是标记中的
。把它放在后台......
Hi,
In the following code, everything looks fine on Explorer, but on Netscape
there is a large white gap between the ''top'' section and the ''bottom menu''
section. I''ve set the style ''div img {display:block}'' already to get rid on
Netscape''s problem with putting space around images, but it does nothing for
this. Setting margins and padding to zero do nothing also. Here''s the code:
<!-- top -->
<div style="width: 100%; background: url(week01/images/innertop.gif)
repeat-x top;">
<img
src="week01/images/innercorner.gif" alt="" width="23" height="23"
style="padding-left: 125px; background-color: #B5302B; ">
</div>
<!--bottom menu -->
<div style="width: 130px; background: #b5302b
url(week01/images/innerright.gif) repeat-y right; float: left;">
<h3>Item 1</h3>
<h3>Item 2</h3>
<h3>Item 3</h3>
</div>
<!--bottom head -->
<div >
Text goes here
</div>
Thanks,
Aaron
Aaron wrote:
Hi,
In the following code, everything looks fine on Explorer, but on Netscape
there is a large white gap between the ''top'' section and the ''bottom menu''
section. I''ve set the style ''div img {display:block}'' already to get rid on
Netscape''s problem with putting space around images, but it does nothing for
this. Setting margins and padding to zero do nothing also. Here''s the code:
<!-- top -->
<div style="width: 100%; background: url(week01/images/innertop.gif)
repeat-x top;">
<img
src="week01/images/innercorner.gif" alt="" width="23" height="23"
style="padding-left: 125px; background-color: #B5302B; ">
</div>
<!--bottom menu -->
<div style="width: 130px; background: #b5302b
url(week01/images/innerright.gif) repeat-y right; float: left;">
<h3>Item 1</h3>
<h3>Item 2</h3>
<h3>Item 3</h3>
</div>
<!--bottom head -->
<div >
Text goes here
</div>
Thanks,
Aaron
The space is made by the image inside the div. Try to put a colored
background to the top div and you''ll see that there''s no gap between the
two divs... Why do you put a background color to the image? And, by the
sake of god, don''t put an empty "alt" attribute ;-)
Andrés Sedano wrote:Aaron wrote: [snip]<img
src="week01/images/innercorner.gif" alt="" width="23" height="23"
style="padding-left: 125px; background-color: #B5302B; ">
</div>
[snip]
And, by the sake of god, don''t put an empty "alt" attribute ;-)
Why not? If that image is intended for decoration (is it?), rather than adding
value that a blind person or someone using a text-browser may need, an empty
alt is surely best?
--
Barry Pearson
http://www.Barry.Pearson.name/photography/
http://www.BirdsAndAnimals.info/
http://www.ChildSupportAnalysis.co.uk/
Barry Pearson wrote:Andrés Sedano wrote:Aaron wrote:
[snip]<img
src="week01/images/innercorner.gif" alt="" width="23" height="23"
style="padding-left: 125px; background-color: #B5302B; ">
</div>
[snip]And, by the sake of god, don''t put an empty "alt" attribute ;-)
Why not? If that image is intended for decoration (is it?), rather than adding
value that a blind person or someone using a text-browser may need, an empty
alt is surely best?
If it''s intended for decoration (presentation, definitely), it must not
be in the markup. Put it in a background...
这篇关于Netscape中不需要的空间btwn div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!