admin管理员组文章数量:1400157
I know that with CSS you can do for example:
p:hover {
xxx:yyy;
}
I wish to do so but in the HTML page without linking the CSS, like so:
<p style="xxx">xxxxxxxx</p>
but with the hover option.
I know that with CSS you can do for example:
p:hover {
xxx:yyy;
}
I wish to do so but in the HTML page without linking the CSS, like so:
<p style="xxx">xxxxxxxx</p>
but with the hover option.
Share Improve this question edited Jan 1, 2014 at 14:24 Matthew Strawbridge 20.7k10 gold badges79 silver badges96 bronze badges asked Jan 1, 2014 at 14:18 BodokhBodokh 1,0764 gold badges18 silver badges34 bronze badges 1- 1 see stackoverflow./questions/5293280/… – db9dreamer Commented Jan 1, 2014 at 14:25
3 Answers
Reset to default 3You can insert directly your CSS inside the html page without linking it:
<head>
<style>
p:hover {
xxx: yyy;
}
</style>
</head>
<body>
<p>xxxxxxxx</p>
</body>
Internal Style Sheet
You can simply use internal css in your html page as below..
<style>
p:hover{
//coding...
}
</style>
Try JavaScript:
<p onmouseover="change(this)" >xxxxx</p>
<script type="text/javascript" >
function change (element) {
var style = element.style;
// Do something with style...
// Example: style.color = "red";
}
</script>
本文标签: javascriptHow do I create Hover effects in HTML without using a CSS pageStack Overflow
版权声明:本文标题:javascript - How do I create Hover effects in HTML without using a CSS page - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744177981a2594091.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论