强制标签背景:url()在Internet Explorer中

时间:2021-12-12 17:04:08

I have a Html/Css code that work fine in Chrome and firefox but in IE i can't show up the background for my label

我有一个在Chrome和Firefox中运行良好的Html / Css代码但在IE中我无法显示我的标签的背景

i have two class css one for active lable and other for no active.

我有两个类css一个用于活动标签,另一个用于没有活动。

Here is my Css Code:

这是我的Css代码:

.jqTransformDayRadioWrapper label {
    width: 31px !important;
    height: 28px;
    margin-right: 2px;
    text-align: center;
    font-weight: normal;
    line-height: 28px;
    cursor: pointer;
    background: url('../img/form/day_radio_button.gif') no-repeat;
}
.jqTransformDayRadioWrapper label.active {
    background: url('../img/form/day_radio_button_selected.gif') no-repeat !important;
}

And Here is the HTML code generate by Cakephp Html Helper Form :

这是由Cakephp Html Helper Form生成的HTML代码:

<div class="jqTransformDayRadioWrapper">
    <label for="EventReoccurringOnDay1">S</label>
    <input name="data[Event][reoccurring_on_day1]" type="text"  class="jqTransformDayRadioWrapper" value="0" id="EventReoccurringOnDay1" />

   <label for="EventReoccurringOnDay5">T</label>
    <input name="data[Event][reoccurring_on_day5]" type="text" checked="checked" class="jqTransformDayRadioWrapper" value="1" id="EventReoccurringOnDay5" />
    </div>
</div>

Thanks in advance:).

提前致谢:)。

1 个解决方案

#1


0  

You will need to set your label to display:block; because labels are inline elements. And without display:block; your background image will not appear in IE 7.

您需要将标签设置为display:block;因为标签是内联元素。没有显示:块;您的背景图片不会出现在IE 7中。

#1


0  

You will need to set your label to display:block; because labels are inline elements. And without display:block; your background image will not appear in IE 7.

您需要将标签设置为display:block;因为标签是内联元素。没有显示:块;您的背景图片不会出现在IE 7中。