Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to add CSS on specific element while using pseudo-class or pseudo element

This are 5 pieces a href and when hover unto them Hello World!! would show up unto there rigth side.. How can I make Hello World!!only show on Only Here when hover? Is there like

<a style =":hover::after display: inline-block; content: "Hello World!!"; font-size: 16px; ... etc " href="#">

POC coding argument of some sort to design specific element while using pseudo-class or pseudo element

a:hover::after {
  display: inline-block;
  content: "Hello World!!";
  font-size: 16px;
  font-weight: bold;
  padding-left: 5px;
}
<a href="#">Not Here</a><br>
<a href="#">Not Here</a><br>
<a href="#">Only Here</a><br>
<a href="#">Not Here</a><br>
<a href="#">Not Here</a><br>

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Is this what you want to chieve?

a.hello:hover::after {
  display: inline-block;
  content: "Hello World!!";
  font-size: 16px;
  font-weight: bold;
  padding-left: 5px;
}
<a href="#">Not Here</a><br>
<a href="#">Not Here</a><br>
<a class="hello" href="#">Only Here</a><br>
<a href="#">Not Here</a><br>
<a href="#">Not Here</a><br>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading