Add link to images

Hello
I want to copy (legal) texts in my website. In this texts are images.

<a href="test123.html" >
<img src="test456.jpg" width="245" height="165">
</a>
<a href="test234.html" >
<img src="test567.jpg" width="245" height="165">
</a>
<a href="test345.html" >
<img src="test567.jpg" width="245" height="165">
</a>

After copying the texts the links to the images are broken.
What I can do now is changing every link of each image:

<a href="test123.html" >
<img src="http://www.abc.com/test/test456.jpg" width="245" height="165">
</a>
<a href="test234.html" >
<img src="http://www.abc.com/test/test567.jpg" width="245" height="165">
</a>
<a href="test345.html" >
<img src="http://www.abc.com/test/test567.jpg" width="245" height="165">
</a>

My Question:
Instead of changing every link of each image is there something for example in css to make this link change only one time:

<style type="text/css">
add: 'http://www.abc.com/test/' to each image
</style>

<a href="test123.html" >
<img src="test456.jpg" width="245" height="165">
</a>
<a href="test234.html" >
<img src="test567.jpg" width="245" height="165">
</a>
<a href="test345.html" >
<img src="test567.jpg" width="245" height="165">
</a>

Thanks.

No, this is not a job for CSS. You could do it with JavaScript, but really, that’s a bandaid approach, as the links should really be there in the HTML. How many pages does this apply to? In a code editor, you can do a search and replace, which would be my preference.