加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net – IE6 vs IE8,按钮vs超链接,CSS渲染问题

发布时间:2020-12-16 09:35:04 所属栏目:asp.Net 来源:网络整理
导读:给出以下示例表单代码和CSS样式表 形成 div class="Center_300 " button id="KeaneDelegate" runat="server" class="button_red2" causesvalidation="false"spanKeane's delegate view/span/button br /br /a class="button_red2" spanKeane's delegate view
给出以下示例表单代码和CSS样式表

形成

<div class="Center_300 ">
 <button id="KeaneDelegate" runat="server" class="button_red2" causesvalidation="false"><span>Keane's delegate view</span></button> 
<br />
<br />
<a class="button_red2"> <span>Keane's delegate view</span></a> 
</div>

CSS

.button_red2 
{
background:url('../../images/button_red_left.gif') no-repeat left top; 
display:inline;  
float:left; 
font-size:12px;  
font-weight:bold; 
line-height:16px; 
height:21px; 
padding-left:9px; 
text-decoration:none;
border-style:none; 
color:White;
 }
.button_red2  span
{   background:transparent url('../../images/button_red.gif') no-repeat top right; 
padding:3px 10px 2px 0px;
border-style:none;
display:block;
}

.Center_300 { width:300px; margin:0 auto }

在IE8的兼容模式(IE6)中查看时,按钮正确渲染,但我的文本左侧和右侧有“空白”空格.
超链接正确呈现

当我切换回本机IE8模式时,按钮正确呈现,如同超链接一样长,但在滑动门中有轻微的错位,右侧部分似乎被分流1个像素

如果我然后删除块对齐并调整填充,它渲染完美(但不再是超链接)

.button_red2  span
{   background:transparent url('../../images/button_red.gif') no-repeat top right; 
    padding:3px 10px 3px 0px;
    border-style:none;
 }

但是将其切换回IE6模式会让它变得更加丑陋

我正在尝试使用按钮,而不是我的表单的超链接,但从我交付的CSS样式,只有超链接在各种IE版本之间完美呈现.

为什么按钮上的IE6渲染中有额外的空间?回到IE8模式时,为什么它会出现像素格式,如何排序呢?还是不可解决?

在滑动门的2个GIF下面.

tnxs

克里兹

解决方法

我认为这是由于IE中的按钮错误导致的太宽.
看看这篇文章: http://latrine.dgx.cz/the-stretched-buttons-problem-in-ie

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读