Home > Net >  How to use CSS to replace text?
How to use CSS to replace text?

Time:06-10

How do I replace Type: with Class: using CSS?

<span >Type:<a href="....../type/aaa/">aaa</a>, <a href="...../type/bbb/">bbb</a></span>

CodePudding user response:

It's was challenging without updating HTML here's code
It's not perfect but it's works :D

.skills:before {
  content: "Class: ";
  font-size: 14px;

}

.skills {
  font-size: 0;
}
 
.skills a {
  font-size: 14px;
}

.skills a:after {
  content: ", ";
  font-size: 14px;
}
 
<span >Type:<a href="....../type/aaa/">aaa</a>, <a href="...../type/bbb/">bbb</a></span>

CodePudding user response:

.skills{font-size:0;}
.skills a{font-size:20px;}
.skills a:after {content: ", "; font-size: 20px;}
.skills a:last-child:after {content: ""; } 
.skills:before {
content: 'Class: ';
font-size:20px;
}
<span >Type:<a href="....../type/aaa/">aaa</a>, <a href="...../type/bbb/">bbb</a></span>

  • Related