大家好。
有几个页面具有相似的代码,以免受苦并到处放置链接,我决定为此使用 jquery(我希望使用这种方法的浏览器不会出现陷阱)
你需要什么 ?您需要从顶部的 div 获取链接,并将下面的 div 中的图像包装在 href 标记中。也就是说,结果我们得到了一个可点击的标题和一张图片。但我不知道 jquery,因此我向您寻求解决此问题的方法。
这是一个示例代码
<div class="col-md-12"><a class="test1" href="http://www.site.com/bla">Test Link</a></div>
<div class="col-md-12 description"><img class="left" src="http://www.site.com/images/image_test.jpg" alt="Test" />t is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English</div>
<div class="col-md-12"><a class="test1" href="http://www.site.com/bla">Test Link</a></div>
<div class="col-md-12 description"><img class="left" src="http://www.site.com/images/image_test.jpg" alt="Test" />t is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English</div>
1 个回答