{"id":5369,"date":"2019-03-19T20:49:15","date_gmt":"2019-03-19T19:49:15","guid":{"rendered":"https:\/\/monodes.com\/predaelli\/?p=5369"},"modified":"2019-03-19T08:14:00","modified_gmt":"2019-03-19T07:14:00","slug":"8-useful-css-tricks-parallax-images-sticky-footers-and-more","status":"publish","type":"post","link":"https:\/\/monodes.com\/predaelli\/2019\/03\/19\/8-useful-css-tricks-parallax-images-sticky-footers-and-more\/","title":{"rendered":"8 useful CSS tricks: Parallax images, sticky footers and more"},"content":{"rendered":"<p><em><a href=\"https:\/\/medium.com\/@bretcameron\/parallax-images-sticky-footers-and-more-8-useful-css-tricks-eef12418f676\">8 useful CSS tricks: Parallax images, sticky footers and more<\/a><\/em><\/p>\n<blockquote><p>This article shares some of my most satisfying \u201cah-hah!\u201d moments learning CSS, and I hope it can prompt some \u201cah-hah!\u201d moments for you too.<\/p>\n<ol class=\"postList\">\n<li id=\"3d43\" class=\"graf graf--li graf-after--h3\"><a class=\"markup--anchor markup--li-anchor\" href=\"https:\/\/medium.com\/p\/eef12418f676#4212\" data-href=\"https:\/\/medium.com\/p\/eef12418f676#4212\"><em class=\"markup--em markup--li-em\">Sticky Footer<\/em><\/a><\/li>\n<li id=\"f2ae\" class=\"graf graf--li graf-after--li\"><a class=\"markup--anchor markup--li-anchor\" href=\"https:\/\/medium.com\/p\/eef12418f676#c870\" data-href=\"https:\/\/medium.com\/p\/eef12418f676#c870\"><em class=\"markup--em markup--li-em\">Zoom-on-Hover Images<\/em><\/a><\/li>\n<li id=\"8d34\" class=\"graf graf--li graf-after--li\"><a class=\"markup--anchor markup--li-anchor\" href=\"https:\/\/medium.com\/p\/eef12418f676#3a78\" data-href=\"https:\/\/medium.com\/p\/eef12418f676#3a78\"><em class=\"markup--em markup--li-em\">Instant Night Mode<\/em><\/a><\/li>\n<li id=\"72a0\" class=\"graf graf--li graf-after--li\"><a class=\"markup--anchor markup--li-anchor\" href=\"https:\/\/medium.com\/p\/eef12418f676#3586\" data-href=\"https:\/\/medium.com\/p\/eef12418f676#3586\"><em class=\"markup--em markup--li-em\">Custom Bullet Points<\/em><\/a><\/li>\n<li id=\"85a3\" class=\"graf graf--li graf-after--li\"><a class=\"markup--anchor markup--li-anchor\" href=\"https:\/\/medium.com\/p\/eef12418f676#ea57\" data-href=\"https:\/\/medium.com\/p\/eef12418f676#ea57\"><em class=\"markup--em markup--li-em\">Parallax Images<\/em><\/a><\/li>\n<li id=\"9eaa\" class=\"graf graf--li graf-after--li\"><a class=\"markup--anchor markup--li-anchor\" href=\"https:\/\/medium.com\/p\/eef12418f676#9861\" data-href=\"https:\/\/medium.com\/p\/eef12418f676#9861\"><em class=\"markup--em markup--li-em\">Animation with Cropped Images<\/em><\/a><\/li>\n<li id=\"f3b9\" class=\"graf graf--li graf-after--li\"><a class=\"markup--anchor markup--li-anchor\" href=\"https:\/\/medium.com\/p\/eef12418f676#9386\" data-href=\"https:\/\/medium.com\/p\/eef12418f676#9386\"><em class=\"markup--em markup--li-em\">Blend Modes<\/em><\/a><\/li>\n<li id=\"302d\" class=\"graf graf--li graf-after--li\"><a class=\"markup--anchor markup--li-anchor\" href=\"https:\/\/medium.com\/p\/eef12418f676#8405\" data-href=\"https:\/\/medium.com\/p\/eef12418f676#8405\"><em class=\"markup--em markup--li-em\">Pinterest-style Image Board<\/em><\/a><\/li>\n<\/ol>\n<\/blockquote>\n<p><!--more--><!--nextpage--><\/p>\n<blockquote>\n<h1 id=\"4d70\" class=\"graf graf--h3 graf--leading graf--title\">8 useful CSS tricks: Parallax images, sticky footers and\u00a0more<\/h1>\n<div class=\"uiScale uiScale-ui--regular uiScale-caption--regular u-flexCenter u-marginVertical24 u-fontSize15 js-postMetaLockup\">\n<div class=\"u-flex0\"><a class=\"link u-baseColor--link avatar\" dir=\"auto\" href=\"https:\/\/medium.com\/@bretcameron?source=post_header_lockup\" data-action=\"show-user-card\" data-action-source=\"post_header_lockup\" data-action-value=\"d4a4110b5d57\" data-action-type=\"hover\" data-user-id=\"d4a4110b5d57\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"avatar-image u-size50x50\" src=\"https:\/\/i0.wp.com\/cdn-images-1.medium.com\/fit\/c\/100\/100\/0%2Ae8PK5po6URKflV8I.jpg?w=910&#038;ssl=1\" alt=\"Go to the profile of Bret Cameron\" \/><\/a><\/div>\n<div class=\"u-flex1 u-paddingLeft15 u-overflowHidden\">\n<div class=\"u-paddingBottom3\"><a class=\"ds-link ds-link--styleSubtle ui-captionStrong u-inlineBlock link link--darken link--darker\" dir=\"auto\" href=\"https:\/\/medium.com\/@bretcameron\" data-action=\"show-user-card\" data-action-value=\"d4a4110b5d57\" data-action-type=\"hover\" data-user-id=\"d4a4110b5d57\">Bret Cameron<\/a><\/div>\n<\/div>\n<\/div>\n<div class=\"ui-caption u-noWrapWithEllipsis js-testPostMetaInlineSupplemental\"><time datetime=\"2019-03-01T11:44:06.784Z\">Mar 1<\/time><\/div>\n<figure id=\"cc85\" class=\"graf graf--figure graf--layoutFillWidth graf-after--h3\" data-scroll=\"native\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"aspectRatioPlaceholder-fill\"><\/div>\n<div class=\"progressiveMedia js-progressiveMedia graf-image is-canvasLoaded is-imageLoaded\" data-image-id=\"1*5_QSQauGElzmvYRyjl1Ofw.png\" data-width=\"3165\" data-height=\"1620\" data-is-featured=\"true\" data-scroll=\"native\"><\/div>\n<\/div>\n<\/figure>\n<div class=\"section-inner sectionLayout--fullWidth\">\n<figure id=\"cc85\" class=\"graf graf--figure graf--layoutFillWidth graf-after--h3\" data-scroll=\"native\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"progressiveMedia js-progressiveMedia graf-image is-canvasLoaded is-imageLoaded\" data-image-id=\"1*5_QSQauGElzmvYRyjl1Ofw.png\" data-width=\"3165\" data-height=\"1620\" data-is-featured=\"true\" data-scroll=\"native\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"progressiveMedia-image js-progressiveMedia-image\" src=\"https:\/\/i0.wp.com\/cdn-images-1.medium.com\/max\/2600\/1%2A5_QSQauGElzmvYRyjl1Ofw.png?w=910&#038;ssl=1\" data-src=\"https:\/\/cdn-images-1.medium.com\/max\/2600\/1*5_QSQauGElzmvYRyjl1Ofw.png\" \/><\/div>\n<\/div>\n<\/figure>\n<\/div>\n<div class=\"section-inner sectionLayout--insetColumn\">\n<p id=\"cc40\" class=\"graf graf--p graf-after--figure\"><em class=\"markup--em markup--p-em\">This article shares some of my most satisfying \u201cah-hah!\u201d moments learning CSS, and I hope it can prompt some \u201cah-hah!\u201d moments for you too.<\/em><\/p>\n<p id=\"9d67\" class=\"graf graf--p graf-after--p\">CSS is a unique language. At first glance, it can seem very simple. But certain effects that look simple in theory are often a little less obvious in practice.<\/p>\n<p id=\"0be7\" class=\"graf graf--p graf-after--p\">In this article, I\u2019ll share several useful tips and tricks that represent key developments in my own journey learning CSS. This article isn\u2019t about demonstrating how complex CSS can get. Rather, it shares several useful tricks that you\u2019re unlikely to find in most CSS tutorials.<\/p>\n<p id=\"b841\" class=\"graf graf--p graf-after--p\">If you\u2019ve got any CSS tips of your own, I\u2019d love if you shared them in the comments!<\/p>\n<h3 id=\"de9a\" class=\"graf graf--h3 graf-after--p\">Contents<\/h3>\n<ol class=\"postList\">\n<li id=\"3d43\" class=\"graf graf--li graf-after--h3\"><a class=\"markup--anchor markup--li-anchor\" href=\"https:\/\/medium.com\/p\/eef12418f676#4212\" data-href=\"https:\/\/medium.com\/p\/eef12418f676#4212\"><em class=\"markup--em markup--li-em\">Sticky Footer<\/em><\/a><\/li>\n<li id=\"f2ae\" class=\"graf graf--li graf-after--li\"><a class=\"markup--anchor markup--li-anchor\" href=\"https:\/\/medium.com\/p\/eef12418f676#c870\" data-href=\"https:\/\/medium.com\/p\/eef12418f676#c870\"><em class=\"markup--em markup--li-em\">Zoom-on-Hover Images<\/em><\/a><\/li>\n<li id=\"8d34\" class=\"graf graf--li graf-after--li\"><a class=\"markup--anchor markup--li-anchor\" href=\"https:\/\/medium.com\/p\/eef12418f676#3a78\" data-href=\"https:\/\/medium.com\/p\/eef12418f676#3a78\"><em class=\"markup--em markup--li-em\">Instant Night Mode<\/em><\/a><\/li>\n<li id=\"72a0\" class=\"graf graf--li graf-after--li\"><a class=\"markup--anchor markup--li-anchor\" href=\"https:\/\/medium.com\/p\/eef12418f676#3586\" data-href=\"https:\/\/medium.com\/p\/eef12418f676#3586\"><em class=\"markup--em markup--li-em\">Custom Bullet Points<\/em><\/a><\/li>\n<li id=\"85a3\" class=\"graf graf--li graf-after--li\"><a class=\"markup--anchor markup--li-anchor\" href=\"https:\/\/medium.com\/p\/eef12418f676#ea57\" data-href=\"https:\/\/medium.com\/p\/eef12418f676#ea57\"><em class=\"markup--em markup--li-em\">Parallax Images<\/em><\/a><\/li>\n<li id=\"9eaa\" class=\"graf graf--li graf-after--li\"><a class=\"markup--anchor markup--li-anchor\" href=\"https:\/\/medium.com\/p\/eef12418f676#9861\" data-href=\"https:\/\/medium.com\/p\/eef12418f676#9861\"><em class=\"markup--em markup--li-em\">Animation with Cropped Images<\/em><\/a><\/li>\n<li id=\"f3b9\" class=\"graf graf--li graf-after--li\"><a class=\"markup--anchor markup--li-anchor\" href=\"https:\/\/medium.com\/p\/eef12418f676#9386\" data-href=\"https:\/\/medium.com\/p\/eef12418f676#9386\"><em class=\"markup--em markup--li-em\">Blend Modes<\/em><\/a><\/li>\n<li id=\"302d\" class=\"graf graf--li graf-after--li\"><a class=\"markup--anchor markup--li-anchor\" href=\"https:\/\/medium.com\/p\/eef12418f676#8405\" data-href=\"https:\/\/medium.com\/p\/eef12418f676#8405\"><em class=\"markup--em markup--li-em\">Pinterest-style Image Board<\/em><\/a><\/li>\n<\/ol>\n<p id=\"544f\" class=\"graf graf--p graf-after--li\"><em class=\"markup--em markup--p-em\">+ <\/em><a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/medium.com\/p\/eef12418f676#24b1\" data-href=\"https:\/\/medium.com\/p\/eef12418f676#24b1\"><em class=\"markup--em markup--p-em\">Additional Resources<\/em><\/a><\/p>\n<h3 id=\"4212\" class=\"graf graf--h3 graf-after--p\">1. Sticky\u00a0Footer<\/h3>\n<p id=\"84dd\" class=\"graf graf--p graf-after--h3\">This very common requirement can be a puzzle for beginners.<\/p>\n<p id=\"42b4\" class=\"graf graf--p graf-after--p\">For the most projects, you\u2019ll want a footer that stays at the bottom of the screen, regardless of the size of the content\u200a\u2014\u200aif the page\u2019s content goes past the view-port, the footer should adapt.<\/p>\n<p id=\"1939\" class=\"graf graf--p graf-after--p\">Before CSS3, it was very difficult to achieve this effect without knowing the exact height of your footer. And, although we call it a sticky footer, you can\u2019t simply solve this with <code class=\"\" data-line=\"\">position: sticky<\/code>\u00a0, because that can block content.<\/p>\n<p id=\"439a\" class=\"graf graf--p graf-after--p\">Today, the most compatible solution is to use Flexbox. The key is to use the less well-known <code class=\"\" data-line=\"\">flex-grow<\/code> property on the <code class=\"\" data-line=\"\">div<\/code> containing the main content of the page; in the example below, I\u2019m using the <code class=\"\" data-line=\"\">main<\/code> tag.<\/p>\n<p id=\"65d5\" class=\"graf graf--p graf-after--p\"><code class=\"\" data-line=\"\">flex-grow<\/code> controls how much a flex item fills its container, relative to other flex elements. With a value of <code class=\"\" data-line=\"\">0<\/code>, it won\u2019t grow at all, and so we need to set it to <code class=\"\" data-line=\"\">1<\/code> or more. In the example below, I\u2019ve used the shorthand property <code class=\"\" data-line=\"\">flex: auto<\/code>\u00a0, which sets <code class=\"\" data-line=\"\">flex-grow<\/code> to <code class=\"\" data-line=\"\">1<\/code> by default.<\/p>\n<p id=\"29fb\" class=\"graf graf--p graf-after--p\">To prevent any unwanted behaviour, we can also add <code class=\"\" data-line=\"\">flex-shrink: 0<\/code> to the <code class=\"\" data-line=\"\">footer<\/code> tag. <code class=\"\" data-line=\"\">flex-shrink<\/code> is effectively the opposite of the <code class=\"\" data-line=\"\">flex-grow<\/code> property, controlling the amount a flex element shrinks to fit into its container, and setting it to <code class=\"\" data-line=\"\">0<\/code> will prevent the footer from shrinking at all\u200a\u2014\u200aensuring that it retains its dimensions.<\/p>\n<figure id=\"1757\" class=\"graf graf--figure graf--iframe graf-after--p\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"aspectRatioPlaceholder-fill\"><\/div>\n<div class=\"progressiveMedia js-progressiveMedia is-canvasLoaded is-imageLoaded\" data-scroll=\"native\"><\/div>\n<\/div>\n<\/figure>\n<\/div>\n<figure id=\"1757\" class=\"graf graf--figure graf--iframe graf-after--p\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"progressiveMedia js-progressiveMedia is-canvasLoaded is-imageLoaded\" data-scroll=\"native\">\n<div class=\"iframeContainer\"><iframe loading=\"lazy\" class=\"progressiveMedia-iframe js-progressiveMedia-iframe\" src=\"https:\/\/medium.com\/media\/a436c5e1daf3457a971d7a07451af195?postId=eef12418f676\" width=\"700\" height=\"525\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\" data-width=\"800\" data-height=\"600\" data-src=\"\/media\/a436c5e1daf3457a971d7a07451af195?postId=eef12418f676\" data-media-id=\"a436c5e1daf3457a971d7a07451af195\" data-thumbnail=\"https:\/\/i.embed.ly\/1\/image?url=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F2941039.oVNYKR.small.5e0a90e8-1603-4f82-ad7f-50f47e9b1d9a.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07\" data-mce-fragment=\"1\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<\/figure>\n<p id=\"357b\" class=\"graf graf--p graf-after--figure\"><strong class=\"markup--strong markup--p-strong\"><em class=\"markup--em markup--p-em\">Update<\/em><\/strong><em class=\"markup--em markup--p-em\">: Duc Hong suggested in the comments that the above solution may not work correctly in Internet Explorer 11. I tested my code in IE11 and it seemed to work fine. However, if you run into any compatibility issues, I would recommend trying out <\/em><a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/medium.com\/@duchong\/hi-11539d16bd54\" target=\"_blank\" rel=\"noopener noreferrer\" data-href=\"https:\/\/medium.com\/@duchong\/hi-11539d16bd54\"><em class=\"markup--em markup--p-em\">his solution<\/em><\/a><em class=\"markup--em markup--p-em\">.<\/em><\/p>\n<h3 id=\"c870\" class=\"graf graf--h3 graf-after--p\">2. Zoom-on-Hover Images<\/h3>\n<p id=\"0709\" class=\"graf graf--p graf-after--h3\">The zoom-on-hover effect is a great way to draw attention to a clickable image. When a user hovers over it, the image scales up slightly, but its dimensions remain the same.<\/p>\n<p id=\"8e3b\" class=\"graf graf--p graf-after--p\">To achieve this effect, we need a wrapper <code class=\"\" data-line=\"\">div<\/code> to go around our normal <code class=\"\" data-line=\"\">img<\/code> tag in the HTML.<\/p>\n<p id=\"6869\" class=\"graf graf--p graf-after--p\">To make this effect work, you need to set the <code class=\"\" data-line=\"\">width<\/code> and <code class=\"\" data-line=\"\">height<\/code> of the parent element, and make sure <code class=\"\" data-line=\"\">overflow<\/code> is set to <code class=\"\" data-line=\"\">hidden<\/code>\u00a0. Then you can apply any kind of transform animations to the inner image.<\/p>\n<figure id=\"d027\" class=\"graf graf--figure graf--iframe graf-after--p\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"aspectRatioPlaceholder-fill\"><\/div>\n<div class=\"progressiveMedia js-progressiveMedia is-canvasLoaded is-imageLoaded\" data-scroll=\"native\"><\/div>\n<\/div>\n<\/figure>\n<figure id=\"d027\" class=\"graf graf--figure graf--iframe graf-after--p\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"progressiveMedia js-progressiveMedia is-canvasLoaded is-imageLoaded\" data-scroll=\"native\">\n<div class=\"iframeContainer\"><iframe loading=\"lazy\" class=\"progressiveMedia-iframe js-progressiveMedia-iframe\" src=\"https:\/\/medium.com\/media\/cacf3bbb77d9176baba683b4d536336f?postId=eef12418f676\" width=\"700\" height=\"525\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\" data-width=\"800\" data-height=\"600\" data-src=\"\/media\/cacf3bbb77d9176baba683b4d536336f?postId=eef12418f676\" data-media-id=\"cacf3bbb77d9176baba683b4d536336f\" data-thumbnail=\"https:\/\/i.embed.ly\/1\/image?url=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F2941039.NJWdoM.small.b3346a31-8cce-4c04-8d06-633c3966c600.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07\" data-mce-fragment=\"1\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<\/figure>\n<h3 id=\"3a78\" class=\"graf graf--h3 graf-after--figure\">3. Instant Night\u00a0Mode<\/h3>\n<p id=\"3a0d\" class=\"graf graf--p graf-after--h3\">If you are looking for a quick way to apply a \u201cnight mode\u201d skin to your website, try using the <code class=\"\" data-line=\"\">invert<\/code> and <code class=\"\" data-line=\"\">hue-rotate<\/code> filters.<\/p>\n<p id=\"e485\" class=\"graf graf--p graf-after--p\"><code class=\"\" data-line=\"\">filter: invert()<\/code> is on a scale from <code class=\"\" data-line=\"\">0<\/code> to <code class=\"\" data-line=\"\">1<\/code>\u200a\u2014\u200awhere <code class=\"\" data-line=\"\">1<\/code> changes white to black.<\/p>\n<p id=\"1c7d\" class=\"graf graf--p graf-after--p\"><code class=\"\" data-line=\"\">filter: hue-rotate()<\/code> alters the color-content of your elements in such a way that they more-or-less retain the same level of separation from one another. Its values range from <code class=\"\" data-line=\"\">0deg<\/code> to <code class=\"\" data-line=\"\">360deg<\/code>.<\/p>\n<p id=\"febb\" class=\"graf graf--p graf-after--p\">By combining these effects on the <code class=\"\" data-line=\"\">body<\/code> tag, you can quickly trial a dark version of your site. (Note that, to affect the background, you must give it a colour.)<\/p>\n<p id=\"71a3\" class=\"graf graf--p graf-after--p\">Here\u2019s an example:<\/p>\n<pre id=\"7746\" class=\"graf graf--pre graf-after--p\">body {\n    background: #FFF;\n    filter: invert(1) hue-rotate(210deg);\n}<\/pre>\n<p id=\"1478\" class=\"graf graf--p graf-after--pre\">Using these settings, we can give Google\u2019s homepage an instant makeover:<\/p>\n<figure id=\"09e8\" class=\"graf graf--figure graf-after--p\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"aspectRatioPlaceholder-fill\"><\/div>\n<div class=\"progressiveMedia js-progressiveMedia graf-image is-canvasLoaded is-imageLoaded\" data-image-id=\"1*fZIBkkNgo11XZiFhmLumvg.jpeg\" data-width=\"7680\" data-height=\"3328\" data-action=\"zoom\" data-action-value=\"1*fZIBkkNgo11XZiFhmLumvg.jpeg\" data-scroll=\"native\"><\/div>\n<\/div>\n<\/figure>\n<figure id=\"09e8\" class=\"graf graf--figure graf-after--p\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"progressiveMedia js-progressiveMedia graf-image is-canvasLoaded is-imageLoaded\" data-image-id=\"1*fZIBkkNgo11XZiFhmLumvg.jpeg\" data-width=\"7680\" data-height=\"3328\" data-action=\"zoom\" data-action-value=\"1*fZIBkkNgo11XZiFhmLumvg.jpeg\" data-scroll=\"native\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"progressiveMedia-image js-progressiveMedia-image\" src=\"https:\/\/i0.wp.com\/cdn-images-1.medium.com\/max\/1600\/1%2AfZIBkkNgo11XZiFhmLumvg.jpeg?w=910&#038;ssl=1\" data-src=\"https:\/\/cdn-images-1.medium.com\/max\/1600\/1*fZIBkkNgo11XZiFhmLumvg.jpeg\" \/><\/div>\n<\/div><figcaption class=\"imageCaption\">In Chrome or Firefox, press F12 to open up the Developer Tools. From there, you can edit any website\u2019s CSS.<\/figcaption><\/figure>\n<h3 id=\"3586\" class=\"graf graf--h3 graf-after--figure\">4. Custom Bullet\u00a0Points<\/h3>\n<p id=\"d01a\" class=\"graf graf--p graf-after--h3\">To create custom bullet points for an unordered list, you can use the <code class=\"\" data-line=\"\">content<\/code> property, together with the\u00a0<code class=\"\" data-line=\"\">::before<\/code> pseudo-element.<\/p>\n<p id=\"5f94\" class=\"graf graf--p graf-after--p\">In the CSS below, I\u2019m using two classes\u00a0<code class=\"\" data-line=\"\">.complete<\/code> and\u00a0<code class=\"\" data-line=\"\">.incomplete<\/code> to distinguish two different types of bullet point.<\/p>\n<pre id=\"a9fa\" class=\"graf graf--pre graf-after--p\">ul {\n  list-style: none;\n}<\/pre>\n<pre id=\"2d6d\" class=\"graf graf--pre graf-after--pre\">ul.complete li::before {\n  content: '\ud83d\uddf9 '<code class=\"\" data-line=\"\">;<\/code> }<\/pre>\n<pre id=\"f253\" class=\"graf graf--pre graf-after--pre\">ul.incomplete li::before {\n  content: '\u2610 ';<code class=\"\" data-line=\"\">;<\/code> }<\/pre>\n<figure id=\"95cb\" class=\"graf graf--figure graf--iframe graf-after--pre\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"aspectRatioPlaceholder-fill\"><\/div>\n<div class=\"progressiveMedia js-progressiveMedia is-canvasLoaded is-imageLoaded\" data-scroll=\"native\"><\/div>\n<\/div>\n<\/figure>\n<figure id=\"95cb\" class=\"graf graf--figure graf--iframe graf-after--pre\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"progressiveMedia js-progressiveMedia is-canvasLoaded is-imageLoaded\" data-scroll=\"native\">\n<div class=\"iframeContainer\"><iframe loading=\"lazy\" class=\"progressiveMedia-iframe js-progressiveMedia-iframe\" src=\"https:\/\/medium.com\/media\/5f4482bde0f24f0fd2fd6ea1e95fa3c8?postId=eef12418f676\" width=\"700\" height=\"525\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\" data-width=\"800\" data-height=\"600\" data-src=\"\/media\/5f4482bde0f24f0fd2fd6ea1e95fa3c8?postId=eef12418f676\" data-media-id=\"5f4482bde0f24f0fd2fd6ea1e95fa3c8\" data-thumbnail=\"https:\/\/i.embed.ly\/1\/image?url=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F2941039.MxWpVY.small.f79a5155-5be9-43e6-8bcd-cc117bafcd06.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07\" data-mce-fragment=\"1\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<\/figure>\n<h4 id=\"dc7a\" class=\"graf graf--h4 graf-after--figure\">Bonus Use: Navigation Breadcrumbs<\/h4>\n<p id=\"6074\" class=\"graf graf--p graf-after--h4\">There are many more useful ways to take advantage of the <code class=\"\" data-line=\"\">content<\/code> property, and I couldn\u2019t resist adding one more.<\/p>\n<p id=\"3e8f\" class=\"graf graf--p graf-after--p\">Since the slashes and other symbols used to separate breadcrumbs are stylistic, it makes a lot of sense to define them in CSS. Like many of the examples in this article, this effect relies on a pseudo-class\u200a\u2014\u200a<code class=\"\" data-line=\"\">last-child<\/code>\u200a\u2014\u200aonly made available in CSS3:<\/p>\n<pre id=\"45e6\" class=\"graf graf--pre graf-after--p\"><code class=\"\" data-line=\"\">.breadcrumb a:first-child::before {\n  content: &quot; \u00bb &quot;;\n}<\/code><\/pre>\n<pre id=\"66d6\" class=\"graf graf--pre graf-after--pre\"><code class=\"\" data-line=\"\">.breadcrumb a::after {\n  content: &quot; \/&quot;;\n}<\/code><\/pre>\n<pre id=\"5a00\" class=\"graf graf--pre graf-after--pre\"><code class=\"\" data-line=\"\">.breadcrumb a:last-child::after {\n  content: &quot;&quot;;\n}<\/code><\/pre>\n<figure id=\"c569\" class=\"graf graf--figure graf--iframe graf-after--pre\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"aspectRatioPlaceholder-fill\"><\/div>\n<div class=\"progressiveMedia js-progressiveMedia is-canvasLoaded is-imageLoaded\" data-scroll=\"native\"><\/div>\n<\/div>\n<\/figure>\n<figure id=\"c569\" class=\"graf graf--figure graf--iframe graf-after--pre\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"progressiveMedia js-progressiveMedia is-canvasLoaded is-imageLoaded\" data-scroll=\"native\">\n<div class=\"iframeContainer\"><iframe loading=\"lazy\" class=\"progressiveMedia-iframe js-progressiveMedia-iframe\" src=\"https:\/\/medium.com\/media\/625b0af45eb7c56f2eed2925341f3ae3?postId=eef12418f676\" width=\"700\" height=\"525\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\" data-width=\"800\" data-height=\"600\" data-src=\"\/media\/625b0af45eb7c56f2eed2925341f3ae3?postId=eef12418f676\" data-media-id=\"625b0af45eb7c56f2eed2925341f3ae3\" data-thumbnail=\"https:\/\/i.embed.ly\/1\/image?url=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F2941039.LaYWgz.small.f4c7e426-7fe2-4cbd-b4dd-87e3ae89e077.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07\" data-mce-fragment=\"1\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<\/figure>\n<h3 id=\"ea57\" class=\"graf graf--h3 graf-after--figure\"><strong class=\"markup--strong markup--h3-strong\">5. Parallax\u00a0Images<\/strong><\/h3>\n<p id=\"2952\" class=\"graf graf--p graf-after--h3\">This eye-catching effect is increasingly popular, and it can be used to bring life to a page as the user scrolls through it.<\/p>\n<p id=\"af1d\" class=\"graf graf--p graf-after--p\">While normal images of a page move as the user scrolls, the parallax image appears to stays fixed\u200a\u2014\u200aonly the window through which it is visible moves.<\/p>\n<h4 id=\"6aba\" class=\"graf graf--h4 graf-after--p\">CSS-only Example<\/h4>\n<p id=\"3702\" class=\"graf graf--p graf-after--h4\">The must-have property for this effect is <code class=\"\" data-line=\"\">background-attachment: fixed<\/code>\u00a0, which fixes the background image\u2019s position within the view-port. (The opposite effect is achieved using <code class=\"\" data-line=\"\">background-attachment: scroll<\/code> ).<\/p>\n<figure id=\"0a63\" class=\"graf graf--figure graf--iframe graf-after--p\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"aspectRatioPlaceholder-fill\"><\/div>\n<div class=\"progressiveMedia js-progressiveMedia is-canvasLoaded is-imageLoaded\" data-scroll=\"native\"><\/div>\n<\/div>\n<\/figure>\n<figure id=\"0a63\" class=\"graf graf--figure graf--iframe graf-after--p\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"progressiveMedia js-progressiveMedia is-canvasLoaded is-imageLoaded\" data-scroll=\"native\">\n<div class=\"iframeContainer\"><iframe loading=\"lazy\" class=\"progressiveMedia-iframe js-progressiveMedia-iframe\" src=\"https:\/\/medium.com\/media\/12471613afd77588be07de487ea96f90?postId=eef12418f676\" width=\"700\" height=\"525\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\" data-width=\"800\" data-height=\"600\" data-src=\"\/media\/12471613afd77588be07de487ea96f90?postId=eef12418f676\" data-media-id=\"12471613afd77588be07de487ea96f90\" data-thumbnail=\"https:\/\/i.embed.ly\/1\/image?url=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F2941039.JzjNXp.small.988be5aa-9dcd-40f9-bec9-3aec25b5af62.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07\" data-mce-fragment=\"1\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<\/figure>\n<h4 id=\"5c6b\" class=\"graf graf--h4 graf-after--figure\">CSS + JavaScript Example<\/h4>\n<p id=\"574d\" class=\"graf graf--p graf-after--h4\">For a more advanced effect, you can use JavaScript to add movement to the image as the user scrolls. Credit to Renan Breno, for this CodePen, which demonstrates some of what\u2019s possible:<\/p>\n<figure id=\"2cf1\" class=\"graf graf--figure graf--iframe graf-after--p\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"aspectRatioPlaceholder-fill\"><\/div>\n<div class=\"progressiveMedia js-progressiveMedia is-canvasLoaded is-imageLoaded\" data-scroll=\"native\"><\/div>\n<\/div>\n<\/figure>\n<figure id=\"2cf1\" class=\"graf graf--figure graf--iframe graf-after--p\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"progressiveMedia js-progressiveMedia is-canvasLoaded is-imageLoaded\" data-scroll=\"native\">\n<div class=\"iframeContainer\"><iframe loading=\"lazy\" class=\"progressiveMedia-iframe js-progressiveMedia-iframe\" src=\"https:\/\/medium.com\/media\/16b8c17d6388a6117768b832086131f3?postId=eef12418f676\" width=\"700\" height=\"525\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\" data-width=\"800\" data-height=\"600\" data-src=\"\/media\/16b8c17d6388a6117768b832086131f3?postId=eef12418f676\" data-media-id=\"16b8c17d6388a6117768b832086131f3\" data-thumbnail=\"https:\/\/i.embed.ly\/1\/image?url=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F295665.GZeBNg.small.a00adc7b-ecb8-45ff-81af-d46c74551883.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07\" data-mce-fragment=\"1\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<\/figure>\n<h3 id=\"9861\" class=\"graf graf--h3 graf-after--figure\">6. Animation with Cropped\u00a0Images<\/h3>\n<p id=\"b527\" class=\"graf graf--p graf-after--h3\">Like the sticky footer, it was very tricky to crop images before CSS3. Now, we have two properties which make cropping easy, <code class=\"\" data-line=\"\">object-fit<\/code> and <code class=\"\" data-line=\"\">object-position<\/code>, which together allow you to change an image\u2019s dimensions without affecting it\u2019s aspect ratio.<\/p>\n<p id=\"e984\" class=\"graf graf--p graf-after--p\">Before, it was always possible to crop your images in a photo editor, but a big advantage of cropping them in a browser is the ability to resize images as part of an animation.<\/p>\n<p id=\"a6a9\" class=\"graf graf--p graf-after--p\">To demonstrate this effect as simply as possible, the following example triggers the effect using an <code class=\"\" data-line=\"\">&lt;input type=&quot;checkbox&quot;&gt;<\/code> tag. That way, we can take advantage of CSS\u2019s\u00a0<code class=\"\" data-line=\"\">:checked<\/code> pseudo-class, and we won\u2019t need to use any JavaScript:<\/p>\n<figure id=\"b1b4\" class=\"graf graf--figure graf--iframe graf-after--p\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"aspectRatioPlaceholder-fill\"><\/div>\n<div class=\"progressiveMedia js-progressiveMedia is-canvasLoaded is-imageLoaded\" data-scroll=\"native\"><\/div>\n<\/div>\n<\/figure>\n<figure id=\"b1b4\" class=\"graf graf--figure graf--iframe graf-after--p\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"progressiveMedia js-progressiveMedia is-canvasLoaded is-imageLoaded\" data-scroll=\"native\">\n<div class=\"iframeContainer\"><iframe loading=\"lazy\" class=\"progressiveMedia-iframe js-progressiveMedia-iframe\" src=\"https:\/\/medium.com\/media\/2bb39e8d6bde60a253146d01e18a6d57?postId=eef12418f676\" width=\"700\" height=\"525\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\" data-width=\"800\" data-height=\"600\" data-src=\"\/media\/2bb39e8d6bde60a253146d01e18a6d57?postId=eef12418f676\" data-media-id=\"2bb39e8d6bde60a253146d01e18a6d57\" data-thumbnail=\"https:\/\/i.embed.ly\/1\/image?url=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F2941039.bZdYeV.small.fe2e5afc-ecf0-4c23-8ba2-26edbbb18c26.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07\" data-mce-fragment=\"1\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<\/figure>\n<h3 id=\"9386\" class=\"graf graf--h3 graf-after--figure\">7. Blend\u00a0Modes<\/h3>\n<p id=\"1f77\" class=\"graf graf--p graf-after--h3\">If you\u2019ve got experience using Photoshop, you likely know how powerful its different blend modes can be to create interesting effects. But did you know that most of Photoshop\u2019s blend modes are also available in CSS?<\/p>\n<p id=\"ed2e\" class=\"graf graf--p graf-after--p\">Here\u2019s what Medium\u2019s homepage looks like when the images are given a <code class=\"\" data-line=\"\">background-color<\/code> of lightblue, and a <code class=\"\" data-line=\"\">blend-mode<\/code> of <code class=\"\" data-line=\"\">difference<\/code>\u00a0:<\/p>\n<figure id=\"cb4d\" class=\"graf graf--figure graf-after--p\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"aspectRatioPlaceholder-fill\"><\/div>\n<div class=\"progressiveMedia js-progressiveMedia graf-image is-canvasLoaded is-imageLoaded\" data-image-id=\"1*0tW3PYLlt0PytC3XGlC25w.png\" data-width=\"1284\" data-height=\"484\" data-action=\"zoom\" data-action-value=\"1*0tW3PYLlt0PytC3XGlC25w.png\" data-scroll=\"native\"><\/div>\n<\/div>\n<\/figure>\n<figure id=\"cb4d\" class=\"graf graf--figure graf-after--p\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"progressiveMedia js-progressiveMedia graf-image is-canvasLoaded is-imageLoaded\" data-image-id=\"1*0tW3PYLlt0PytC3XGlC25w.png\" data-width=\"1284\" data-height=\"484\" data-action=\"zoom\" data-action-value=\"1*0tW3PYLlt0PytC3XGlC25w.png\" data-scroll=\"native\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"progressiveMedia-image js-progressiveMedia-image\" src=\"https:\/\/i0.wp.com\/cdn-images-1.medium.com\/max\/1600\/1%2A0tW3PYLlt0PytC3XGlC25w.png?w=910&#038;ssl=1\" data-src=\"https:\/\/cdn-images-1.medium.com\/max\/1600\/1*0tW3PYLlt0PytC3XGlC25w.png\" \/><\/div>\n<\/div>\n<\/figure>\n<p id=\"041b\" class=\"graf graf--p graf-after--figure\">Plus, backgrounds aren\u2019t the only way you can take advantage of blend modes. The <span class=\"markup--quote markup--p-quote is-other\" data-creator-ids=\"anon\"><code class=\"\" data-line=\"\">mix-blend-mode<\/code><\/span> property allows you to blend elements with their existing background. So, for example, you can create effects like this, with uses a <code class=\"\" data-line=\"\">mix-blend-mode<\/code> of <code class=\"\" data-line=\"\">color-dodge<\/code> and a background of <code class=\"\" data-line=\"\">lightsalmon<\/code>\u00a0.<\/p>\n<figure id=\"545d\" class=\"graf graf--figure graf-after--p\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"aspectRatioPlaceholder-fill\"><\/div>\n<div class=\"progressiveMedia js-progressiveMedia graf-image is-canvasLoaded is-imageLoaded\" data-image-id=\"1*N1hQszg6o3H_tNWA18yn9Q.png\" data-width=\"1920\" data-height=\"799\" data-action=\"zoom\" data-action-value=\"1*N1hQszg6o3H_tNWA18yn9Q.png\" data-scroll=\"native\"><\/div>\n<\/div>\n<\/figure>\n<figure id=\"545d\" class=\"graf graf--figure graf-after--p\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"progressiveMedia js-progressiveMedia graf-image is-canvasLoaded is-imageLoaded\" data-image-id=\"1*N1hQszg6o3H_tNWA18yn9Q.png\" data-width=\"1920\" data-height=\"799\" data-action=\"zoom\" data-action-value=\"1*N1hQszg6o3H_tNWA18yn9Q.png\" data-scroll=\"native\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"progressiveMedia-image js-progressiveMedia-image\" src=\"https:\/\/i0.wp.com\/cdn-images-1.medium.com\/max\/1600\/1%2AN1hQszg6o3H_tNWA18yn9Q.png?w=910&#038;ssl=1\" data-src=\"https:\/\/cdn-images-1.medium.com\/max\/1600\/1*N1hQszg6o3H_tNWA18yn9Q.png\" \/><\/div>\n<\/div><figcaption class=\"imageCaption\">Before CSS3, it was hard to believe that websites could look like\u00a0this!<\/figcaption><\/figure>\n<p id=\"47f8\" class=\"graf graf--p graf-after--figure\"><em class=\"markup--em markup--p-em\">Note: <\/em>there is currently a bug with Chrome 58+ where <code class=\"\" data-line=\"\">mix-blend-mode<\/code> won\u2019t render on elements set on transparent <code class=\"\" data-line=\"\">&lt;body&gt;<\/code> or <code class=\"\" data-line=\"\">&lt;html&gt;<\/code> tags. A quick fix is to give them both these tags a <code class=\"\" data-line=\"\">background-color<\/code> of <code class=\"\" data-line=\"\">white<\/code>\u00a0.<\/p>\n<figure id=\"9072\" class=\"graf graf--figure graf--iframe graf-after--p\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"aspectRatioPlaceholder-fill\"><\/div>\n<div class=\"progressiveMedia js-progressiveMedia is-canvasLoaded is-imageLoaded\" data-scroll=\"native\"><\/div>\n<\/div>\n<\/figure>\n<figure id=\"9072\" class=\"graf graf--figure graf--iframe graf-after--p\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"progressiveMedia js-progressiveMedia is-canvasLoaded is-imageLoaded\" data-scroll=\"native\">\n<div class=\"iframeContainer\"><iframe loading=\"lazy\" class=\"progressiveMedia-iframe js-progressiveMedia-iframe\" src=\"https:\/\/medium.com\/media\/ecf068146c2a56d6914a5d34bcfe93ab?postId=eef12418f676\" width=\"700\" height=\"525\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\" data-width=\"800\" data-height=\"600\" data-src=\"\/media\/ecf068146c2a56d6914a5d34bcfe93ab?postId=eef12418f676\" data-media-id=\"ecf068146c2a56d6914a5d34bcfe93ab\" data-thumbnail=\"https:\/\/i.embed.ly\/1\/image?url=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fm.cdpn.io%2Fscreenshot-coming-soon-small.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07\" data-mce-fragment=\"1\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<\/figure>\n<h3 id=\"8405\" class=\"graf graf--h3 graf-after--figure\">8. Pinterest-style Image\u00a0Board<\/h3>\n<p id=\"d700\" class=\"graf graf--p graf-after--h3\">CSS Grid and Flexbox have made it much easier to achieve many different types of responsive layouts, and allow us to easily centre elements vertically on a page\u200a\u2014\u200awhich was very difficult before.<\/p>\n<p id=\"69d9\" class=\"graf graf--p graf-after--p\">However, one style of layout they are not well suited to is the one used by Pinterest, where the vertical positioning of each element changes based on the height of the element above it.<\/p>\n<figure id=\"dfe7\" class=\"graf graf--figure graf-after--p\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"aspectRatioPlaceholder-fill\"><\/div>\n<div class=\"progressiveMedia js-progressiveMedia graf-image is-canvasLoaded is-imageLoaded\" data-image-id=\"1*dcMN4fUddq6KWlXmIUYISA.png\" data-width=\"1841\" data-height=\"655\" data-action=\"zoom\" data-action-value=\"1*dcMN4fUddq6KWlXmIUYISA.png\" data-scroll=\"native\"><\/div>\n<\/div>\n<\/figure>\n<figure id=\"dfe7\" class=\"graf graf--figure graf-after--p\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"progressiveMedia js-progressiveMedia graf-image is-canvasLoaded is-imageLoaded\" data-image-id=\"1*dcMN4fUddq6KWlXmIUYISA.png\" data-width=\"1841\" data-height=\"655\" data-action=\"zoom\" data-action-value=\"1*dcMN4fUddq6KWlXmIUYISA.png\" data-scroll=\"native\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"progressiveMedia-image js-progressiveMedia-image\" src=\"https:\/\/i0.wp.com\/cdn-images-1.medium.com\/max\/1600\/1%2AdcMN4fUddq6KWlXmIUYISA.png?w=910&#038;ssl=1\" data-src=\"https:\/\/cdn-images-1.medium.com\/max\/1600\/1*dcMN4fUddq6KWlXmIUYISA.png\" \/><\/div>\n<\/div><figcaption class=\"imageCaption\">https:\/\/www.pinterest.co.uk\/<\/figcaption><\/figure>\n<p id=\"e2db\" class=\"graf graf--p graf-after--figure\">The best way to achieve this is to use CSS\u2019s suite of column properties. These are most commonly used to create multiple newspaper-style columns of text, but this is another great use-case.<\/p>\n<p id=\"7487\" class=\"graf graf--p graf-after--p\">For this to work, you need to wrap your elements in a <code class=\"\" data-line=\"\">div<\/code> and give this wrapper a <code class=\"\" data-line=\"\">column-width<\/code> and <code class=\"\" data-line=\"\">column-gap<\/code> property.<\/p>\n<p id=\"7603\" class=\"graf graf--p graf-after--p\">Then, to prevent any elements being split between two columns, add <code class=\"\" data-line=\"\">column-break-inside: avoid<\/code> to the individual elements.<\/p>\n<p id=\"be12\" class=\"graf graf--p graf-after--p\">I owe my understanding of this effect to the following CodePen, by Dudley Storey, which demonstrates it very effectively.<\/p>\n<figure id=\"8a91\" class=\"graf graf--figure graf--iframe graf-after--p\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"aspectRatioPlaceholder-fill\"><\/div>\n<div class=\"progressiveMedia js-progressiveMedia is-canvasLoaded is-imageLoaded\" data-scroll=\"native\"><\/div>\n<\/div>\n<\/figure>\n<section class=\"section section--body section--first\">\n<div class=\"section-content\">\n<div class=\"section-inner sectionLayout--insetColumn\">\n<figure id=\"8a91\" class=\"graf graf--figure graf--iframe graf-after--p\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"progressiveMedia js-progressiveMedia is-canvasLoaded is-imageLoaded\" data-scroll=\"native\">\n<div class=\"iframeContainer\"><iframe loading=\"lazy\" class=\"progressiveMedia-iframe js-progressiveMedia-iframe\" src=\"https:\/\/medium.com\/media\/25903f4e77e400a5732fb64d4ce90810?postId=eef12418f676\" width=\"700\" height=\"525\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\" data-width=\"800\" data-height=\"600\" data-src=\"\/media\/25903f4e77e400a5732fb64d4ce90810?postId=eef12418f676\" data-media-id=\"25903f4e77e400a5732fb64d4ce90810\" data-thumbnail=\"https:\/\/i.embed.ly\/1\/image?url=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F4273.yqrhw.small.cd4d885a-6fb8-46d3-bf43-a55a03cf334b.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07\" data-mce-fragment=\"1\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<\/figure>\n<p id=\"70de\" class=\"graf graf--p graf-after--figure\">The above example is also a great example of CSS\u2019s\u00a0<code class=\"\" data-line=\"\">:not()<\/code> pseudo-class. He uses it with\u00a0<code class=\"\" data-line=\"\">:hover<\/code>\u00a0, so that all but the hovered element fade out.<\/p>\n<h3 id=\"24b1\" class=\"graf graf--h3 graf-after--p\">Additional Resources<\/h3>\n<p id=\"c2ae\" class=\"graf graf--p graf-after--h3\">Overall, I hope the following examples have clarified some useful CSS effects\u200a\u2014\u200aand maybe even drew attention to a few features you weren\u2019t aware of.<\/p>\n<p id=\"b6d3\" class=\"graf graf--p graf-after--p\">It was difficult to decide on my top 8 CSS tricks, since there have been several other CSS effects that really enhanced my understanding of it. These include features like animation using keyframes, scroll-snapping, more complex navigation bars, 3D effects, CSS for printing.<\/p>\n<p id=\"7061\" class=\"graf graf--p graf-after--p\">Features like these don\u2019t really fall into the category of \u201csimple tricks\u201d, and they can be explored in considerable depth by themselves. so instead of describing them here, I\u2019ll direct you to some of my favourite resources to learn about them:<\/p>\n<h4 id=\"0263\" class=\"graf graf--h4 graf-after--p\">Keyframe animation<\/h4>\n<ul class=\"postList\">\n<li id=\"85d5\" class=\"graf graf--li graf-after--h4\"><a class=\"markup--anchor markup--li-anchor\" href=\"https:\/\/css-tricks.com\/snippets\/css\/keyframe-animation-syntax\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" data-href=\"https:\/\/css-tricks.com\/snippets\/css\/keyframe-animation-syntax\/\">https:\/\/css-tricks.com\/snippets\/css\/keyframe-animation-syntax\/<\/a><\/li>\n<\/ul>\n<h4 id=\"5dcf\" class=\"graf graf--h4 graf-after--li\">Scroll-snapping<\/h4>\n<ul class=\"postList\">\n<li id=\"ffad\" class=\"graf graf--li graf-after--h4\"><a class=\"markup--anchor markup--li-anchor\" href=\"https:\/\/css-tricks.com\/practical-css-scroll-snapping\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" data-href=\"https:\/\/css-tricks.com\/practical-css-scroll-snapping\/\">https:\/\/css-tricks.com\/practical-css-scroll-snapping\/<\/a><\/li>\n<\/ul>\n<h4 id=\"950f\" class=\"graf graf--h4 graf-after--li\">Multi-level navigation<\/h4>\n<ul class=\"postList\">\n<li id=\"2890\" class=\"graf graf--li graf-after--h4\"><a class=\"markup--anchor markup--li-anchor\" href=\"http:\/\/bradfrost.com\/blog\/post\/complex-navigation-patterns-for-responsive-design\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" data-href=\"http:\/\/bradfrost.com\/blog\/post\/complex-navigation-patterns-for-responsive-design\/\">http:\/\/bradfrost.com\/blog\/post\/complex-navigation-patterns-for-responsive-design\/<\/a><\/li>\n<\/ul>\n<h4 id=\"b1cd\" class=\"graf graf--h4 graf-after--li\">3D effects<\/h4>\n<ul class=\"postList\">\n<li id=\"ddd6\" class=\"graf graf--li graf-after--h4\"><a class=\"markup--anchor markup--li-anchor\" href=\"https:\/\/www.the-art-of-web.com\/css\/3d-transforms\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" data-href=\"https:\/\/www.the-art-of-web.com\/css\/3d-transforms\/\">https:\/\/www.the-art-of-web.com\/css\/3d-transforms\/<\/a><\/li>\n<\/ul>\n<h4 id=\"6a64\" class=\"graf graf--h4 graf-after--li\">CSS for\u00a0print<\/h4>\n<ul class=\"postList\">\n<li id=\"2352\" class=\"graf graf--li graf-after--h4\"><a class=\"markup--anchor markup--li-anchor\" href=\"https:\/\/www.smashingmagazine.com\/2018\/05\/print-stylesheets-in-2018\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" data-href=\"https:\/\/www.smashingmagazine.com\/2018\/05\/print-stylesheets-in-2018\/\">https:\/\/www.smashingmagazine.com\/2018\/05\/print-stylesheets-in-2018\/<\/a><\/li>\n<li id=\"de85\" class=\"graf graf--li graf-after--li\"><a class=\"markup--anchor markup--li-anchor\" href=\"http:\/\/edutechwiki.unige.ch\/en\/CSS_for_print_tutorial\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" data-href=\"http:\/\/edutechwiki.unige.ch\/en\/CSS_for_print_tutorial\">http:\/\/edutechwiki.unige.ch\/en\/CSS_for_print_tutorial<\/a><\/li>\n<\/ul>\n<h4 id=\"e300\" class=\"graf graf--h4 graf-after--li\"><strong class=\"markup--strong markup--h4-strong\">Design principles<\/strong><\/h4>\n<ul class=\"postList\">\n<li id=\"ccba\" class=\"graf graf--li graf-after--h4 graf--trailing\"><a class=\"markup--anchor markup--li-anchor\" href=\"https:\/\/material.io\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" data-href=\"https:\/\/material.io\/\">https:\/\/material.io\/<\/a><\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/section>\n<section class=\"section section--body section--last\">\n<div class=\"section-divider\">\n<hr class=\"section-divider\" \/>\n<\/div>\n<div class=\"section-content\">\n<div class=\"section-inner sectionLayout--insetColumn\">\n<p id=\"c591\" class=\"graf graf--p graf--leading\">If you have any CSS tips and tricks of your own, feel free to share them in the comments!<\/p>\n<p id=\"1a96\" class=\"graf graf--p graf-after--p\"><em class=\"markup--em markup--p-em\">Thanks to Konstantin Rouda for his useful clarification about <\/em><code class=\"\" data-line=\"\">&lt;em class=&quot;markup--em markup--p-em&quot;&gt;flex-grow&lt;\/em&gt;<\/code><em class=\"markup--em markup--p-em\"> and <\/em><code class=\"\" data-line=\"\">&lt;em class=&quot;markup--em markup--p-em&quot;&gt;flex-shrink&lt;\/em&gt;<\/code><em class=\"markup--em markup--p-em\">\u00a0.<\/em><\/p>\n<\/div>\n<\/div>\n<\/section>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p class=\"excerpt\">8 useful CSS tricks: Parallax images, sticky footers and more This article shares some of my most satisfying \u201cah-hah!\u201d moments learning CSS, and I hope it can prompt some \u201cah-hah!\u201d moments for you too. Sticky Footer Zoom-on-Hover Images Instant Night Mode Custom Bullet Points Parallax Images Animation with Cropped Images Blend Modes Pinterest-style Image Board<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"https:\/\/monodes.com\/predaelli\/2019\/03\/19\/8-useful-css-tricks-parallax-images-sticky-footers-and-more\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"link","meta":{"inline_featured_image":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[127,50],"tags":[],"class_list":["post-5369","post","type-post","status-publish","format-link","hentry","category-html","category-javascript","post_format-post-format-link"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p6daft-1oB","jetpack-related-posts":[{"id":8217,"url":"https:\/\/monodes.com\/predaelli\/2021\/03\/01\/a-table-with-both-a-sticky-header-and-a-sticky-first-column\/","url_meta":{"origin":5369,"position":0},"title":"A table with both a sticky header and a sticky first column","author":"Paolo Redaelli","date":"2021-03-01","format":"link","excerpt":"https:\/\/css-tricks.com\/a-table-with-both-a-sticky-header-and-a-sticky-first-column\/","rel":"","context":"In &quot;HTML&quot;","block_context":{"text":"HTML","link":"https:\/\/monodes.com\/predaelli\/category\/html\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10748,"url":"https:\/\/monodes.com\/predaelli\/2023\/08\/30\/my-little-printer-friendly-css\/","url_meta":{"origin":5369,"position":1},"title":"My little printer-friendly CSS","author":"Paolo Redaelli","date":"2023-08-30","format":false,"excerpt":"Here is my little \"Printer friendly CSS\" that I add to each and every page using Simple Custom CSS and JS \/* override styles when printing *\/ @media print { @page { margin: 2cm; @top-center { font-family: sans-serif; font-weight: bold; font-size: 2em; content: counter(page); } } \/* target the first\u2026","rel":"","context":"In &quot;Tricks&quot;","block_context":{"text":"Tricks","link":"https:\/\/monodes.com\/predaelli\/category\/documentations\/tricks\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":9114,"url":"https:\/\/monodes.com\/predaelli\/2022\/02\/26\/svgcode-for-live-tracing-raster-images-css-tricks\/","url_meta":{"origin":5369,"position":2},"title":"SVGcode for Live Tracing Raster Images | CSS-Tricks","author":"Paolo Redaelli","date":"2022-02-26","format":false,"excerpt":"A free online tool called SVGcode by Thomas Steiner is capable of an effect called \"Live Trace\" that converts a raster image into a vector image. Source: SVGcode for Live Tracing Raster Images | CSS-Tricks Also https:\/\/svgco.de\/","rel":"","context":"In &quot;Senza categoria&quot;","block_context":{"text":"Senza categoria","link":"https:\/\/monodes.com\/predaelli\/category\/senza-categoria\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":8400,"url":"https:\/\/monodes.com\/predaelli\/2021\/05\/04\/5-awesome-css-tricks\/","url_meta":{"origin":5369,"position":3},"title":"5 Awesome CSS tricks","author":"Paolo Redaelli","date":"2021-05-04","format":false,"excerpt":"Do awesome things in fewer code lines with CSS Source: 5 Awesome CSS tricks every developer should know | by FAM | Apr, 2021 | Level Up Coding Smooth scrolling: html { scroll-behavior: smooth; } Resize images to fit img { max-width:100%; height:auto; } #3: Setting an image as cursor\u2026","rel":"","context":"In &quot;HTML&quot;","block_context":{"text":"HTML","link":"https:\/\/monodes.com\/predaelli\/category\/html\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":8729,"url":"https:\/\/monodes.com\/predaelli\/2021\/09\/29\/minding-the-gap-css-tricks\/","url_meta":{"origin":5369,"position":4},"title":"Minding the &#8220;gap&#8221; | CSS-Tricks","author":"Paolo Redaelli","date":"2021-09-29","format":"link","excerpt":"You might already know about the CSS gap property. It isn\u2019t exactly new, but it did gain an important new ability last year: it now works in Flexbox in Source: Minding the \"gap\" | CSS-Tricks","rel":"","context":"In &quot;HTML&quot;","block_context":{"text":"HTML","link":"https:\/\/monodes.com\/predaelli\/category\/html\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10151,"url":"https:\/\/monodes.com\/predaelli\/2022\/12\/26\/css-infinite-3d-sliders\/","url_meta":{"origin":5369,"position":5},"title":"CSS Infinite 3D Sliders","author":"Paolo Redaelli","date":"2022-12-26","format":false,"excerpt":"CSS Infinite 3D Sliders CSS-Tricks is really a huge treasure","rel":"","context":"In &quot;HTML&quot;","block_context":{"text":"HTML","link":"https:\/\/monodes.com\/predaelli\/category\/html\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/5369","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/comments?post=5369"}],"version-history":[{"count":0,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/5369\/revisions"}],"wp:attachment":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/media?parent=5369"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/categories?post=5369"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/tags?post=5369"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}