Quasi-nested links

by oilvier

HTML

<div class="post-link">

    <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, <a href="https://www.google.com">feugiat vitae</a>, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. <a href="http://www.apple.com/">Aenean fermentum</a>, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque <a href="https://www.facebook.com/">id cursus faucibus</a>, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus.</p>

    <a href="http://csswizardry.com/2013/02/introducing-csswizardry-grids/" class="post-link__read-more">Read more&hellip;</a>

</div>

SCSS

/**
 * Quasi-nested post links.
 */
.post-link {
    position: relative;

    /**
     * Position any links in the post excerpt at the top of the `z-index` stack.
     */
    a {
        position: relative;
        z-index: 1;
    }

}

    /**
     * Stretch the ‘read more’ link over the whole of the post.
     * Hide the ‘read more’ link’s text.
     */
    .post-link__read-more {
        top:    0;
        right:  0;
        bottom: 0;
        left:   0;
        overflow: hidden;
        text-indent: 100%;
        white-space: nowrap;

        /**
         * Needs a heightened specificity to trump `.post-link a`.
         * Stack it under all other links in the post text.
         */
        a& {
            position: absolute;
            z-index: 0;
        }

    }








































/**
 * Housekeeping
 */
a {
    color: #c00;
    text-decoration: none;
    
    &:hover {
        text-decoration: underline;
    }

}

JavaScript

/**
 * Provide a large ‘read more’ hit area for clicking anywhere in the article
 * excerpt whilst preserving the ability to click on links within the text of the
 * article itself.
 *
 * Check the URL in your status bar as you hover the text/links.
 */