<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="https://shazwazza.com/rss/xslt"?>
<rss xmlns:a10="http://www.w3.org/2005/Atom" version="2.0">
  <channel>
    <title>Shazwazza</title>
    <link>https://shazwazza.com/</link>
    <description>My blog which is pretty much just all about coding</description>
    <generator>Articulate, blogging built on Umbraco</generator>
    <image>
      <url>/media/0libq25y/frog.png?rmode=max&amp;v=1da0e911f4e6890</url>
      <title>Shazwazza</title>
      <link>https://shazwazza.com/</link>
    </image>
    <item>
      <guid isPermaLink="false">1325</guid>
      <link>https://shazwazza.com/post/css3-using-the-fun-stuff-in-real-life/</link>
      <category>Web Development</category>
      <title>CSS3: Using the fun stuff in real life</title>
      <description>&lt;h2&gt;Sweep IE6 under the carpet&lt;/h2&gt; &lt;p&gt;Do whatever you can to remove IE6 support from your website’s build spec. Proper CSS selectors like the direct child (&lt;code&gt;ul &amp;gt; li&lt;/code&gt;), the &lt;code&gt;:hover&lt;/code&gt; state for elements other than anchors, and attribute selectors (&lt;code&gt;a[href*=”http://”]&lt;/code&gt;)&amp;nbsp; &lt;strong&gt;do not work &lt;/strong&gt;in IE6. Then, add &lt;a href="http://ie6update.com/"&gt;ie6update&lt;/a&gt;in a &lt;a href="http://www.quirksmode.org/css/condcom.html"&gt;conditional comment&lt;/a&gt; and voila! IE6 users see a totally legit looking alert bar across the top of their screen telling them that the page below looks horrible because they have an old browser and need to upgrade. Now you are ready to begin.&lt;/p&gt; &lt;h2&gt;CSS3 is only sort of supported&lt;/h2&gt; &lt;p&gt;&lt;a href="http://www.css3.info/preview/"&gt;CSS3&lt;/a&gt; is currently a &lt;a href="http://www.w3.org/TR/css3-roadmap/"&gt;working draft&lt;/a&gt;. Microsoft hence decided to implement barely any of its features in IE8, and as a result your CSS3 magic is restricted to ‘modern’ (real) rendering engines, like &lt;a href="http://webkit.org/"&gt;WebKit&lt;/a&gt; (Google Chrome, Safari) and &lt;a href="https://developer.mozilla.org/en/Gecko"&gt;Gecko&lt;/a&gt; (Firefox). However, the developers of these engines understand that CSS3 is a draft and as such the interface can be changed without warning. As a safeguard they apply a prefix to the drafted properties they want to support. These are known as:&lt;/p&gt; &lt;h3&gt;&lt;a href="http://www.w3.org/TR/CSS2/syndata.html#vendor-keywords"&gt;Vendor-specific extensions&lt;/a&gt;&lt;/h3&gt; &lt;p&gt;If you’ve ever seen anything like &lt;code&gt;-moz-border-radius: 6px;&lt;/code&gt; you know what I mean. Vendor-specific extensions are a standardised and accepted (however &lt;a href="http://www.css3.info/vendor-specific-extensions-to-css3/"&gt;occasionally non-validating&lt;/a&gt;) way of implementing future rules without fear of breaking anything. If you want to use CSS3 properties you will most likely have to include the same property with a prefix right after (excepting the few properties like &lt;code&gt;opacity&lt;/code&gt; and &lt;code&gt;border-radius&lt;/code&gt;). Your rules will look something like this:&lt;/p&gt;&lt;pre&gt;.box {
	-webkit-box-shadow:2px 2px 5px gray;
	-moz-box-shadow:2px 2px 5px gray;
	box-shadow:2px 2px 5px gray;
	}&lt;/pre&gt;
&lt;p&gt;I know that hurts, but at least your repitition of code is localised.&amp;nbsp; And it is future-friendly – as browsers start supporting CSS3 your advanced styles will begin to appear!&amp;nbsp; A shadow on a header here, a rounded corner there, an opacity somewhere. Patience.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;You’ll notice there’s no &lt;code&gt;-ie-border-radius&lt;/code&gt; property above. This is very sad. This leads us to our next restriction in using CSS3:&lt;/p&gt;
&lt;h3&gt;Don't force a design&lt;/h3&gt;
&lt;p&gt;Think about it - why must the design for a site look the same in IE as Chrome? What if they looked different? Someone who sees the site in IE is not going to know what they're missing. If a design feature can't be implemented in IE that's no reason not to implement it in WebKit, so long as it degrades gracefully.&lt;/p&gt;
&lt;p&gt;For this to work you need to be close to the designers (or be the designer) and have laid back superiors - it can't really be done when you're dealing with long chains of design approval. Convince everyone that the site is going to look &lt;em&gt;better&lt;/em&gt; in Chrome (happy face!), not &lt;em&gt;worse&lt;/em&gt; in IE (ANGRY FACE). &lt;/p&gt;
&lt;h3&gt;Validating CSS3&lt;/h3&gt;
&lt;p&gt;By default, the W3C's &lt;a href="http://jigsaw.w3.org/css-validator/"&gt;CSS Validator&lt;/a&gt; does not recognise CSS3. You must specify that you are validating CSS3 by clicking "More Options" on the validator page and selecting the &lt;em&gt;CSS level 3&lt;/em&gt; profile.&lt;/p&gt;
&lt;p&gt;That’s it! Go forth and play:&lt;/p&gt;
&lt;h2&gt;CSS3 Goodies you have &lt;em&gt;got&lt;/em&gt; to check out: &lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.css3.info/preview/rgba/"&gt;Colours with alpha values!&lt;/a&gt; 
&lt;li&gt;&lt;a href="http://www.css3.info/preview/multiple-backgrounds/"&gt;Multiple background images!&lt;/a&gt; 
&lt;li&gt;&lt;a href="http://www.w3.org/TR/2001/CR-css3-selectors-20011113/"&gt;New selectors!&lt;/a&gt; 
&lt;li&gt;&lt;a href="http://www.w3.org/TR/css3-fonts/#font-resources"&gt;Embedded fonts!&lt;/a&gt; 
&lt;li&gt;&lt;a href="http://developer.apple.com/safari/library/documentation/InternetWeb/Conceptual/SafariVisualEffectsProgGuide/Transforms/Transforms.html"&gt;3D transforms!&lt;/a&gt; 
&lt;li&gt;&lt;a href="http://webkit.org/blog/138/css-animation/"&gt;Animations!&lt;/a&gt; &lt;/li&gt;&lt;/ul&gt;
&lt;h2&gt;Note on this site&lt;/h2&gt;
&lt;p&gt;This post is pretty much a press release for the recent redesign of &lt;strong&gt;FARMCode.org&lt;/strong&gt; – CSS3 allowed me to code the site exactly how I wanted in Google Chrome, translate it across to Firefox in like 5 minutes and then conduct quick damage control for IE (no rounded corners there).&lt;/p&gt;</description>
      <pubDate>Thu, 23 Mar 2023 15:08:14 Z</pubDate>
      <a10:updated>2023-03-23T15:08:14Z</a10:updated>
    </item>
  </channel>
</rss>