一个关于a:hover的问题_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:08:02
Original
1121 people have browsed it

如果在css标签中定义
a:hover {color: #FF00FF}
那么我们鼠标移动到链接上的时候,链接会变色。

但是现在情况有点特殊要求不能定义css标签,并且无法引入css文件。
我该怎样实现这个功能呢?如果直接这样行吗?该怎样写?


回复讨论(解决方案)

<a href="http://www.baidu.com" onMouseOver="javascript:this.style.color='#FF0000';" onMouseOut="javascript:this.style.color='#0000FF';"> TEST color change </a>
Copy after login


情况特殊,所有javascript都会被过滤掉。。。
可以用css实现吗?

情况特殊,所有javascript都会被过滤掉。。。
可以用css实现吗?

<a href="http://www.baidu.com" onMouseOver="this.style.color='#FF0000';" onMouseOut="this.style.color='#0000FF';"> TEST color change </a>
Copy after login


伪类不能写到这里

刚才测试了一下onMouseOver和onMouseOut同样被过滤掉。
能不能

这样写?将伪类写在div的style里面?

禁用JS,你上网还能做什么?

路过,UPUPPUPUPUP

都过滤掉怎么实现

还有什么能用的?



不用想了,做不了,除非平台开放独立CSS

淘宝之类的就是这样,普通用户要通过代码实现文字变色是不可能的,得用平台规定的模板

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!