Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
150 views
in Technique[技术] by (71.8m points)

html - CSS change image href and src


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can achieve this using the URL function, make sure to mind browser compatibility if needed.

.toBeReplacedDescription span {
    display: none;
}
    
.toBeReplacedDescription:after {
    content: url(“Here is the new replaced text.”);
}
<a href="https://newlink”.com target="_blank">
    <img src="https://example.com/assets/images/1.png" />
</a>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...