English 中文(简体)
是否可以将线 c和地 h混为一谈?
原标题:Combining inline css and hover state, is it possible?

我发现,如果我们在网上书写(或用Java语添加),那么我们就会失去 c的值。 是否有可能改变这种行为?

Simple example


<div id="test" style="color: red">test</div>
<style>
#test:hover {
    color:blue;
}
</style>

在这种情形下,留工。

<>Update>

我可以使用<代码>! 进口,因为在此之后,我将无法通过 Java本改写。

同样,我能动地产生风格,因此,我可以通过贾瓦伦语补充特定课程。

问题回答

because inline css overrides your css styles in the file if you had

color: blue !important

这样做会奏效,但并非建议,你总是能够用 j子去除 though带。

最新情况:

删除使用舱位或使用javascript的标签......添加!

I can t use !important, because after it i will not be able to change that atribute via javascript.

您仍可使用<条码>! 进口,仅增加一个有 Java本的班子,并删除你想要的任何时间。

demo

前进最容易的方法如下:

$(selector).hover(function() {
                $st = $(this).attr("style");
                $(this).attr("style","");
            },function() {
                $(this).attr("style",$st);
            });

在中央支助事务中,<代码> 字标/代码>属性将优先于任何<代码>> 字码要素或<代码> 字标/代码>。 如果你不能改变<条码> 字面属性,你必须使用<条码>! 进口。 如果你可以删除<条码> 字标/代码>,将全部内容放在<条码>上。 更糟的是,在单独的<条码>上 您的问题将固定下来。

P.S. The type Depende is required on /打字/编码s. 这为你的问题打上了标签,但你应当修改<条码>和代号;至<条码>和代号;上型=“文本/文件”和“





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.