如何实现点击切换图

想要实现如下效果:图片描述

当点击右边的其中一栏时,增加选中效果,如图:图片描述

部分代码:`<div id="pic-right">

                <div class="right" id="right1">
                    <div class="pic1">PIC</div>
                    <div class="jieshao">
                        <h3>TITLE OF HIGHLIGHT</h3>
                        <h4>Short descriptions of the highlight on the left.</h4>
                    </div>
                    <div class="xiajiao">
                        <img src="images/xiajiao.png">
                    </div>
                </div>
                <div class="right" id="right2">
                    <div class="pic1">PIC</div>
                    <div class="jieshao">
                        <h3>TITLE OF HIGHLIGHT</h3>
                        <h4>Short descriptions of the highlight on the left.</h4>

                    </div>
                    <div class="xiajiao">
                        <img src="images/xiajiao.png">
                    </div>
                </div>
                <div class="right" id="right3">
                    <div class="pic1">PIC</div>
                    <div class="jieshao">
                        <h3>TITLE OF HIGHLIGHT</h3>
                        <h4>Short descriptions of the highlight on the left.</h4>

                    </div>
                    <div class="xiajiao">
                        <img src="images/xiajiao.png">
                    </div>
                </div>
            </div>`
阅读 2.7k
1 个回答

个人觉着选中右侧缩略图+描述左侧增加小三角可以使用伪元素:after或者:before进行绝对定位不占用原有空间的。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题