Multi-line image hover and border compatibility with IE7 +

Source: Internet
Author: User

Multi-line image hover and border compatibility with IE7 +


 
Problem: 

When an image is arranged in multiple rows and multiple columns, the hover adds a border to squeeze the following image elsewhere.

========================================================== ================================

Note: <喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> VcD4KPHA + logs/y809K7uPYxcHi1xLHfv/I8L3A + cjxwpjxpbwcgc3jjjpq = "" alt = "\">

Solution: Set border: none for the image.

========================================================== ==================================

Hover border adding solution:

Originally:

  • 1. Set transparent borders for elements (recommended ):

    li{border:2px solid transparent;}li:hover{border:2px solid red;}


    2. Enclose a div inside the element.

    After modification:

  • Style:

    li{wdith:468px;}div{width:468px;margin:2px;padding:10px;background-color:#fff;}div :hover{margin:0;border:2px solid red;}
    ========================================================== ====================================
    In addition:

    Outline IE 7 and 8 are not supported.

    However, it is displayed on the element without adding a border to the element. If IE compatibility is not considered, you can directly use outline instead of border.

    ========================================================== ==================================

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.