我想通过向父容器添加一个类来更改图像路径目录或附加图像文件。
示例:如果我向父容器添加一个“大”类img
,我希望它附加img
文件名或更改img
路径。
src="/images/services/image.jpg" changed to src="/images/services/image-large.jpg"
or
src="/images/services/image.jpg" changed to src="/images/services/large/image.jpg"
...............................................................................
default, no class:
<div>
<img src="/images/services/image.jpg" alt="" />
</div>
Option 1, with class:
<div class="large-image">
<img src="/images/services/image-large.jpg" alt="" />
</div>
Option 2, with class:
<div class="large-image">
<img src="/images/services/large/image.jpg" alt="" />
</div>