<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>CSS on HTML5 in 24 Hours</title>
    <link>https://www.html5in24hours.com/tags/css/</link>
    <description>CSS on HTML5 in 24 Hours</description>
    <generator>Hugo</generator>
    <language>en-us</language><copyright>Jennifer Kyrnin</copyright><lastBuildDate>Sun, 10 Jul 2016 01:19:47 +0000</lastBuildDate>
    <atom:link href="https://www.html5in24hours.com/tags/css/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Clip Your Images with CSS clip-path</title>
      <link>https://www.html5in24hours.com/posts/css-clip-path/</link>
      <pubDate>Sun, 10 Jul 2016 01:19:47 +0000</pubDate>
      <guid>https://www.html5in24hours.com/posts/css-clip-path/</guid><description>&lt;p&gt;I used to try to clip images using the CSS clip property, but that was so difficult that I typically gave up and got out my image editor. What is the point of spending four hours trying to force an image to clip in CSS when I can do the same thing in &lt;a href=&#34;http://flyingmeat.com/acorn/&#34;&gt;Acorn&lt;/a&gt; in less than five minutes? But now that clip is deprecated, I don&amp;rsquo;t have to use it anymore. But better yet, the new CSS &lt;strong&gt;&lt;code&gt;clip-path&lt;/code&gt;&lt;/strong&gt; property works so much better!&lt;/p&gt;&#xA;&lt;p&gt;The clip-path property includes features like:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You can apply it to any element, not just absolutely positioned ones&lt;/li&gt;&#xA;&lt;li&gt;You can use &lt;a href=&#34;https://www.html5in24hours.com/posts/im-loving-svg/&#34;&gt;SVG&lt;/a&gt; to define the clipping path&lt;/li&gt;&#xA;&lt;li&gt;It actually works!&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;That last one is the kicker. Yes, I know the clip property worked too. But it was so hard to use that it might as well have not worked. As I mentioned above, I could spend hours just trying to get the image cropped the way I wanted it to. And I&amp;rsquo;m not talking about minor adjustments. I&amp;rsquo;m talking, I would attempt to clip the upper left corner, and the clip property would cut out something in the lower right. WTF?!?&lt;/p&gt;&#xA;&lt;p&gt;So when I started playing with the CSS &lt;code&gt;clip-path&lt;/code&gt;  property I didn&amp;rsquo;t have high hopes. I figured at best it would be a little easier to use. Five minutes later I had clipped exactly the portion of the image I wanted, clipped it in a circle shape (not a rectangle!) and placed that circle on my web page.&lt;/p&gt;&#xA;&lt;p&gt;CSS hooked me again!&lt;/p&gt;&#xA;&lt;p&gt;So, since, like &lt;a href=&#34;https://www.html5in24hours.com/posts/excited-image-set-notation/&#34;&gt;the &lt;code&gt;image-set()&lt;/code&gt; notation&lt;/a&gt;, I thought this was super cool. I decided to create a video for you. The video covers how to create a rectangular clipping path for an image step-by-step. I also give you a tip about a site (&lt;a href=&#34;http://bennettfeely.com/clippy/&#34;&gt;Clippy CSS Clip Maker&lt;/a&gt;) that will help you create your own clipping paths.&lt;/p&gt;&#xA;&lt;h3 id=&#34;watch-my-css-clip-path-video&#34;&gt;Watch My CSS Clip-Path Video&lt;/h3&gt;&#xA;&lt;div style=&#34;position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;&#34;&gt;&#xA;&#x9;&#x9;&#x9;&lt;iframe allow=&#34;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen&#34; loading=&#34;eager&#34; referrerpolicy=&#34;strict-origin-when-cross-origin&#34; src=&#34;https://www.youtube.com/embed/U8GZSu_-FEA?autoplay=0&amp;amp;controls=1&amp;amp;end=0&amp;amp;loop=0&amp;amp;mute=0&amp;amp;start=0&#34; style=&#34;position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;&#34; title=&#34;YouTube video&#34;&gt;&lt;/iframe&gt;&#xA;&#x9;&#x9;&lt;/div&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&#34;https://youtu.be/U8GZSu_-FEA&#34;&gt;https://youtu.be/U8GZSu_-FEA&lt;/a&gt;&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>So Excited about image-set() Notation!</title>
      <link>https://www.html5in24hours.com/posts/excited-image-set-notation/</link>
      <pubDate>Fri, 24 Jun 2016 19:45:31 +0000</pubDate>
      <guid>https://www.html5in24hours.com/posts/excited-image-set-notation/</guid><description>&lt;p&gt;As I&amp;rsquo;ve been writing my next book on forgotten features of CSS, I have been coming across some &lt;strong&gt;really cool&lt;/strong&gt; things. It&amp;rsquo;s been hard to keep up the writing as I get so excited about actually using the features that CSS provides. Today I was working on image-set()  and in doing my testing I realized that my dual monitor setup was well equipped for testing this tool.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-isimage-set&#34;&gt;What is &lt;code&gt;Image-Set()&lt;/code&gt;?&lt;/h2&gt;&#xA;&lt;p&gt;You&amp;rsquo;re probably asking what the heck  &lt;code&gt;image-set()&lt;/code&gt;  even is as it isn&amp;rsquo;t used very often and most designers don&amp;rsquo;t know much about it. In a nutshell: it is a CSS notation that allows you to define multiple image sources based on the resolution of those sources. The most common usage is for providing a Retina image and a non-Retina image. This way Retina devices see a crisp clean image, and non-Retina devices can show an image that is (hopefully) smaller and better optimized for their viewing.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-use-image-set&#34;&gt;How to Use &lt;code&gt;Image-Set()&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;p&gt;You use the  &lt;code&gt;image-set()&lt;/code&gt;  notation where ever you would use images in your CSS. It has the format:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;image-set( imageURL resolution,&#xA;           imageURL resolution )&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Add as many images as you need, separated by commas.&lt;/p&gt;&#xA;&lt;p&gt;The imageURL is written how you normally write URLs in CSS &lt;code&gt;url(&#39;image.png&#39;)&lt;/code&gt;  and the resolution can be written as 1x  for standard resolution, 2x  for Retina and other high-resolution displays, and even specific DPI like &lt;code&gt;600dpi&lt;/code&gt;  for a 600 dots-per-inch printer version of the image.&lt;/p&gt;&#xA;&lt;h3 id=&#34;image-set-best-practices&#34;&gt;&lt;code&gt;Image-Set()&lt;/code&gt; Best Practices&lt;/h3&gt;&#xA;&lt;p&gt;To make your &lt;code&gt;image-set()&lt;/code&gt;  images work best you should always do the following:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Set a default image first. Browsers that don&amp;rsquo;t support  &lt;code&gt;image-set()&lt;/code&gt; will load that and ignore the other style properties&lt;br&gt;&#xA;&lt;code&gt;background-image: url(&#39;image.png&#39;);&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Use browser prefixes&lt;br&gt;&#xA;&lt;code&gt;-webkit-image-set -moz-image-set -o-image-set -ms-image-set&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Place the standard property last&lt;br&gt;&#xA;&lt;code&gt;image-set( url 1x, url2 2x )&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;example-of-image-set&#34;&gt;Example of &lt;code&gt;Image-Set()&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;p&gt;Here is a video I did demonstrating the  &lt;code&gt;image-set()&lt;/code&gt; notation. And below the video is the source CSS I used.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://youtu.be/_G1ZtlQ-nNs&#34;&gt;https://youtu.be/_G1ZtlQ-nNs&lt;/a&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;       #box {&#xA;         background-image: url(image-set-example-none.png);&#xA;         background-image: -webkit-image-set(url(image-set-example-1x.png) 1x,&#xA;                url(image-set-example-2x.png) 2x);&#xA;         background-image: -moz-image-set(url(image-set-example-1x.png) 1x,&#xA;                url(image-set-example-2x.png) 2x);&#xA;         background-image: -o-image-set(url(image-set-example-1x.png) 1x,&#xA;                url(image-set-example-2x.png) 2x);&#xA;         background-image: -ms-image-set(url(image-set-example-1x.png) 1x,&#xA;                url(image-set-example-2x.png) 2x);&#xA;         width:800px;&#xA;         height:800px;&#xA;       }&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;To create the shape, I included a &lt;code&gt;div&lt;/code&gt; with the ID &lt;code&gt;box&lt;/code&gt; in the HTML.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>All the CSS You Need to Know (not as much as you think) - Infographic</title>
      <link>https://www.html5in24hours.com/posts/css-need-know-much-think/</link>
      <pubDate>Tue, 05 Aug 2014 05:04:47 +0000</pubDate>
      <guid>https://www.html5in24hours.com/posts/css-need-know-much-think/</guid><description>&lt;p&gt;&lt;a href=&#34;https://www.html5in24hours.com/all-the-css-you-need-to-know.html&#34;&gt;&lt;img src=&#34;https://www.html5in24hours.com/images/css-infographic.png&#34; alt=&#34;All the CSS You Need to Know &#34;&gt;&lt;/a&gt; All the CSS You Need to Know&lt;br&gt;&#xA;(not as much as you think!)&lt;/p&gt;&#xA;&lt;p&gt;Don&amp;rsquo;t worry if you don&amp;rsquo;t feel confident with CSS. There are really only a few properties you need to know out of the more than 200 that are available. The first 23 properties are all the CSS you need to know to style most web designs. The second group of 24 properties gives you the more advanced CSS you need to know to get fancier.&lt;/p&gt;&#xA;&lt;h2 id=&#34;if-you-liked-this-infographic-please-pin-it-share-it-with-your-friends-and-let-other-people-know-about-it-and-dont-hesitate-to-comment-on-what-you-think-even-if-you-disagree-what-properties-do-you-think-are-the-css-you-need-to-know&#34;&gt;If you liked this infographic, please Pin it, share it with your friends, and let other people know about it. And don&amp;rsquo;t hesitate to comment on what you think even if you disagree. What properties do &lt;em&gt;you&lt;/em&gt; think are the CSS you need to know?&lt;/h2&gt;&#xA;&lt;h3 id=&#34;comments&#34;&gt;Comments:&lt;/h3&gt;&#xA;&lt;h4&gt;&lt;/h4&gt;&#xA;&lt;p&gt;&lt;a href=&#34;%22carcher2011@gmail.com%22&#34;&gt;Cecily&lt;/a&gt; - Aug 2, 2014&lt;/p&gt;&#xA;&lt;p&gt;Please sign me up for your newsletter&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h4&gt;&lt;/h4&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://www.htmljenn.com/&#34; title=&#34;jenn@html5in24hours.com&#34;&gt;Jennifer Kyrnin&lt;/a&gt; - Aug 2, 2014&lt;/p&gt;&#xA;&lt;p&gt;Thanks Cecily, I don&amp;rsquo;t feel comfortable signing up people for my newsletter because I want it to be completely your own choice whether you subscribe (although I hope everyone who does enjoys the free chapter!). You can fill out the form in the right column of any page on my site to be signed up. Or you can go to the sign up page here: &lt;a href=&#34;https://www.html5in24hours.com/rwd-free/&#34;&gt;https://www.html5in24hours.com/rwd-free/&lt;/a&gt; either way will get you the free chapter for help planning your website and access to my newsletter. I hope that helps!&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;</description>
    </item>
  </channel>
</rss>
