Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialEnrique de Larrazabal
3,595 PointsHow did the old CSS-Tricks do thing were the heading and the button was the same link
I'm not sure if anyone can remember the old CSS-Tricks where the heading and the read more button shared the same link but there was a paragraph in the center that was not a link, in the last version before this one. If it was done with CSS could you please explain.
Thanks.
3 Answers
Mark Flavin
10,199 PointsIs this the version you are talking about? http://web.archive.org/web/20120724124147/http://css-tricks.com/
Sean Gaffney
Front End Web Development Techdegree Student 2,560 PointsHey Enrique, it's because of this little bit of CSS-trickery () right here:
article {
position: relative;
}
article h2 a span {
position: absolute !important;
bottom: 0;
top: auto !important;
left: 0;
}
If you look at the HTML, it has the button inside of the h2 a
, which Chris then absolutely positions at the bottom of the article
section. So, when you hover over the button, it triggers the :hover
pseudo-class on the link.
<article class="post" id="post-17588">
<h2>
<a href="/a-discussion-about-css-reusability/">
A Discussion About CSS Reusability
<span class="button">Read on! →</span>
</a>
</h2>
...
</article>
Pretty neat little trick, eh?
Enrique de Larrazabal
3,595 PointsOH!!!!!!! I see now, thanks, that's awesome!!!