gpt4 book ai didi

asp.net - 如何区分同一页面上不同CSS中的两个同名类

转载 作者:行者123 更新时间:2023-11-28 10:58:03 25 4
gpt4 key购买 nike

在我的 asp.net 页面上,我链接了 2 个 css 文件,它们由 2 个不同的控件使用,但主要问题是两者中的一个类名相同,因此它们相互冲突,请告诉我如何区分他们之间。

都是jquery的,一个是slider控件,一个是time picker控件。并且它们在背景图像上存在冲突,因为我想更改 slider 控件的滚动条的背景图像。请给我解决方案..

使用 slider 的代码:

    <div id="time1" style="float: left; width: 100px" >
<code>$('#time1 input').ptTimeSelect({ popupImage:
'<img alt="Select" src="../images/icon_clock_2.gif"
style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" />'
}); </code>
<div >
<input id="s2Time1" runat="server" name="s2Time1" readonly="readonly" style="width: 60px" />
</div>
</div>

以下代码用于时间选择器:

 <div id="time2" style="float: left; width: 100px">
<code>$('#time2 input').ptTimeSelect({ popupImage: '<img alt="Select" src="../images/icon_clock_2.gif"
style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" />'
}); </code>
<div>
<input id="s2Time2" runat="server" name="s2Time2" readonly="readonly" style="width: 60px" /></div>
</div>

最佳答案

您可以向其中一个控件添加第二个类。

<div class = "first_class second_class">
<div class = "first_class">

然后做类似的事情:

first_class {
attributes
}

second_class {
more attributes that may or may not write over first_class attributes
}

有道理吗?

关于asp.net - 如何区分同一页面上不同CSS中的两个同名类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2703546/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com