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>
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744177982a4561845.html
评论列表(0条)