1

I want to give inline css for p tag in html inline,so what i need is something look likes this,

<p class="skill" style="hover {border-color:#20b920;}">Node.js</p>

Is there a way to give such thing in inline html,

Mehul Prajapati
  • 1,210
  • 2
  • 11
  • 29
  • Short answer : you can't,Long answer : bad practice http://stackoverflow.com/questions/1033156/how-to-write-ahover-in-inline-css – bigbounty May 07 '17 at 18:52

1 Answers1

4

Correct way to do it (in my opinion)

Use css with selector p.skill:hover.

For example:

p.skill:hover {
    background-color: yellow;
}

Source https://www.w3schools.com/cssref/sel_hover.asp

The way you want to do... Use javascript

<p class="skill" onmouseover="this.style='background-color:#20b920;';" onmouseout="this.style='background-color:white';">Node.js</p>

Don't forget to change "white" to color of parent element background.