<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2210914315561174469</id><updated>2024-11-05T18:45:30.938-08:00</updated><category term="CSS"/><category term="Web design"/><category term="Tutorials"/><title type='text'>Andrea&#39;s Blogger Templates</title><subtitle type='html'>Web Design Resources</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://andrea-blogger-templates.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://andrea-blogger-templates.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Andrea</name><uri>http://www.blogger.com/profile/03133301827360493806</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>29</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2210914315561174469.post-8188678845327184153</id><published>2013-08-16T05:46:00.001-07:00</published><updated>2013-08-16T05:54:22.690-07:00</updated><title type='text'>How To Remove &#39;Showing Post With Label&#39; Message From Blogger</title><content type='html'>Steps To Follow To Remove &quot;Showing post with label XXXXXXX&quot; From Blogger:-&lt;br /&gt;
&lt;br /&gt;
1--&amp;gt; Login to your Blogger Account.&lt;br /&gt;
&lt;br /&gt;
2--&amp;gt; Go to Blogger Admin Page &amp;gt; Template &amp;gt; Click on Edit HTML.&lt;br /&gt;
&lt;br /&gt;
3--&amp;gt; Click Expand Widgets&lt;br /&gt;
&lt;br /&gt;
4--&amp;gt; Search for codes gven below&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&#39;code&#39;&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrea-blogger-templates.blogspot.com/feeds/8188678845327184153/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2013/08/how-to-remove-showing-post-with-label.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/8188678845327184153'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/8188678845327184153'/><link rel='alternate' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2013/08/how-to-remove-showing-post-with-label.html' title='How To Remove &#39;Showing Post With Label&#39; Message From Blogger'/><author><name>Andrea</name><uri>http://www.blogger.com/profile/03133301827360493806</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2210914315561174469.post-8449006881693041443</id><published>2012-09-08T10:37:00.001-07:00</published><updated>2012-09-08T10:38:46.136-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><title type='text'>IE and the box model</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Unfortunately, older versions of  Internet Explorer, along with IE 6 in quirks mode, use their own, nonstandard box model. Instead of measuring just the width of the content, these browsers take the  width property as the sum of the width of the content, padding, and borders. This actually makes a lot of sense, because in the real-world boxes have a fixed size, and the padding goes on the inside. The more padding you add, the less  room there will be for the content. However, despite the logic, the fact that these versions of IE disregard the specification can cause significant problems. For instance, in the previous example the total width of the box would only be 90 pixels in IE 5.x. This is because IE 5.x will consider the 5 pixels of padding on each side as part of the 70-pixel width, rather than in addition to it (see Figure 3-3).&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;The CSS 3 box-sizing property allows you to define which box model to use, although this feature is unlikely to be widely used except in some very specific circumstances.&lt;/blockquote&gt;&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaYUOm4khgu8MsaAbrBcuNdP_8zylO5vN4WHYcYpyxlfRa5wehEj6s6YgZeWltq_DCu6ghknLcqNKcna10-1s_EXGSig-vb1BTsSIKSaLb51-MaoQfveq4NgE95TelMh3ftSFgAnugq89X/s1600/fig3-3.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;IE and the box model&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaYUOm4khgu8MsaAbrBcuNdP_8zylO5vN4WHYcYpyxlfRa5wehEj6s6YgZeWltq_DCu6ghknLcqNKcna10-1s_EXGSig-vb1BTsSIKSaLb51-MaoQfveq4NgE95TelMh3ftSFgAnugq89X/s1600/fig3-3.jpg&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Figure 3-3. IE’s proprietary box model can cause elements to be smaller than intended.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Luckily, there are several ways you can tackle this issue, the details of which can be found in Chapter 9. However, by far the best solution is to avoid the problem altogether. You can do this by never adding padding to an element with a defined width. Instead, try adding padding or margins to the element’s parent or children.&lt;/div&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrea-blogger-templates.blogspot.com/feeds/8449006881693041443/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/09/ie-and-box-model.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/8449006881693041443'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/8449006881693041443'/><link rel='alternate' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/09/ie-and-box-model.html' title='IE and the box model'/><author><name>Andrea</name><uri>http://www.blogger.com/profile/03133301827360493806</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaYUOm4khgu8MsaAbrBcuNdP_8zylO5vN4WHYcYpyxlfRa5wehEj6s6YgZeWltq_DCu6ghknLcqNKcna10-1s_EXGSig-vb1BTsSIKSaLb51-MaoQfveq4NgE95TelMh3ftSFgAnugq89X/s72-c/fig3-3.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2210914315561174469.post-7706136799457061323</id><published>2012-09-08T10:07:00.001-07:00</published><updated>2012-09-08T10:24:47.112-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><title type='text'>Box model recap</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;The box model is one of the cornerstones of CSS and dictates how elements are displayed and, to a certain extent, how they interact with each other. Every element on the page is considered to be a rectangular box made up of the element’s content, padding, border, and margin (see Figure 3-1).&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEK5-FMjaOWisu54MVVybLDsd67IV659wX8t0Cesgk1Gj07uMtmvp8UfIiNhr6oApueckkcrVbTmvT3OHurYdrrlDTTVQ4HeJNW1dqbENj7UBMLQCN2KaUThMyJXFn001gjm1uG057TN5p/s1600/fig3-1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;css - Box model recap&quot; border=&quot;0&quot; height=&quot;277&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEK5-FMjaOWisu54MVVybLDsd67IV659wX8t0Cesgk1Gj07uMtmvp8UfIiNhr6oApueckkcrVbTmvT3OHurYdrrlDTTVQ4HeJNW1dqbENj7UBMLQCN2KaUThMyJXFn001gjm1uG057TN5p/s400/fig3-1.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Figure 3-1. An illustration of the box model&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Padding is applied around the content area. If &amp;nbsp;you add a background to an element, it will be applied to the area formed by the content and padding. As such, padding is often used to create a gutter around content so that it does not appear flush to the side of the background. Adding a border applies a line to the outside of the padded area. These lines come in various styles such as solid, dashed, or dotted. Outside the border is a margin. Margins are transparent and cannot be seen. They are generally used to control the spacing between elements.&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;CSS 2.1 also contains the &amp;nbsp;outline property. Unlike the border property, outlines are drawn over the top of an element’s box, so they don’t affect its size or positioning. Because of this, outlines can be useful when fixing bugs, because they won’t alter the layout of &amp;nbsp;your page. Outlines are supported by most modern browsers including IE 8 but are not supported in IE 7 and below.&lt;/blockquote&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Padding, borders, and margins are optional and default to zero. However, many elements will be given margins and padding by the user-agent style sheet. You can override these browser styles by setting the element’s margin or padding back to zero. You can do this on a case-by-case basis or for every element by using the universal selector:&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;* {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; margin: 0;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; padding: 0;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Just remember that this technique is fairly indiscriminant, so it can have adverse effects on elements like the option element. As such it’s probably safer to zero down the padding and margins explicitly using a global reset.&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;In CSS, &amp;nbsp;width and &amp;nbsp;height refer to the width and height of the content area. Adding padding, borders, and margins will not affect the size of the content area but will increase the overall size of an element’s box. If you wanted a box with a 10-pixel margin and a 5-pixel padding on each side to be 100 pixels wide, you would need to set the width of the content to be 70 pixels (see Figure 3-2):&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;#myBox {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; margin: 10px;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; padding: 5px;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; width: 70px;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5QZPnlydFFMLTPgpsPyqF1y9dzVQ3hwYBakfGrQZ3gfEoB21pu83M9BZvgoKWkLWsamg90Bro6cD3t8lvDAvMyzS2uOK21kPXJ-o_4xdRTfSieZKAg9ROVTv8IvSJXyqDod8crcqLROzu/s1600/fig3-2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Figure 3-2. The correct box model&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5QZPnlydFFMLTPgpsPyqF1y9dzVQ3hwYBakfGrQZ3gfEoB21pu83M9BZvgoKWkLWsamg90Bro6cD3t8lvDAvMyzS2uOK21kPXJ-o_4xdRTfSieZKAg9ROVTv8IvSJXyqDod8crcqLROzu/s1600/fig3-2.jpg&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Figure 3-2. The correct box model&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Padding, borders, and margins can be applied to &amp;nbsp;all sides of an element or individual sides. Margins can also be given a negative value and can be used in a variety of techniques.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrea-blogger-templates.blogspot.com/feeds/7706136799457061323/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/09/box-model-recap.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/7706136799457061323'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/7706136799457061323'/><link rel='alternate' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/09/box-model-recap.html' title='Box model recap'/><author><name>Andrea</name><uri>http://www.blogger.com/profile/03133301827360493806</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEK5-FMjaOWisu54MVVybLDsd67IV659wX8t0Cesgk1Gj07uMtmvp8UfIiNhr6oApueckkcrVbTmvT3OHurYdrrlDTTVQ4HeJNW1dqbENj7UBMLQCN2KaUThMyJXFn001gjm1uG057TN5p/s72-c/fig3-1.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2210914315561174469.post-6827633235070982530</id><published>2012-09-08T09:44:00.002-07:00</published><updated>2012-09-08T10:24:03.879-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><title type='text'>Visual Formatting Model Overview</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Three of the most important CSS concepts to grasp are floating, positioning, and the box model. These concepts control the way elements are arranged and displayed on a page, forming the basis of CSS layout. If you are used to controlling layout with tables, these concepts may seem strange at first. In fact, most people will have been developing sites using CSS for some time before they fully grasp the intricacies of the &amp;nbsp;box model, the difference between absolute and relative positioning, and how floating and clearing actually work. Once you have a firm grasp of these concepts, developing sites using CSS becomes that much easier.&lt;/div&gt;&lt;br /&gt;
&lt;b&gt;In this chapter you will learn about&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;The intricacies and peculiarities of the box model&lt;/li&gt;
&lt;li&gt;How and why margins collapse&lt;/li&gt;
&lt;li&gt;The difference between absolute and relative positioning&lt;/li&gt;
&lt;li&gt;How floating and clearing work&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;b&gt;Let&#39;s See:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;a href=&quot;http://andrea-blogger-templates.blogspot.com/2012/09/box-model-recap.html&quot;&gt;Box model recap&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrea-blogger-templates.blogspot.com/feeds/6827633235070982530/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/09/visual-formatting-model-overview.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/6827633235070982530'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/6827633235070982530'/><link rel='alternate' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/09/visual-formatting-model-overview.html' title='Visual Formatting Model Overview'/><author><name>Andrea</name><uri>http://www.blogger.com/profile/03133301827360493806</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2210914315561174469.post-9044174394426102282</id><published>2012-09-05T12:47:00.000-07:00</published><updated>2012-09-05T12:47:49.681-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><title type='text'>Removing comments and optimizing your style sheets</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Comments can increase the size of your CSS files quite considerably. Therefore, you may want to strip comments from your live style sheets. Many HTML/CSS and text editors have a search-and-replace option, making it pretty easy to remove comments from your code. Alternatively, you could use one of several online CSS optimizers such as the one found at &lt;a href=&quot;http://www.cssoptimiser.com/&quot;&gt;www.cssoptimiser.com&lt;/a&gt; Not only does an optimizer remove comments, but it also strips out whitespace, helping to shave off a few extra bytes from your code. If you do choose to strip comments from your live style sheets, remember to retain a commented version for your production environment. The best way of managing this process is to create a deployment script that strips comments automatically when you make your changes go live. However, as this is an advanced technique, it’s probably best left to fairly large, sophisticated sites.&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Instead, the best way of reducing file size would be to enable server-side compression. If you are using an Apache server, talk to your hosts about installing &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;mod_gzip&lt;/span&gt; or &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;mod_deflate&lt;/span&gt;. All modern browsers can handle files compressed with &lt;b&gt;GZIP&lt;/b&gt;, and decompress them on the fly. These Apache modules will detect whether your browser &amp;nbsp;can handle such files, and if it can, send a compressed version. Server-side compression can reduce your &lt;b&gt;HTML&lt;/b&gt; and &lt;b&gt;CSS&lt;/b&gt; files by around 80 percent, reducing your bandwidth and making your pages much faster to download. If you don’t have access to these Apache modules, you still may be able to compress your files by following the tutorial found at &lt;a href=&quot;http://tinyurl.com/8w9rp&quot;&gt;http://tinyurl.com/8w9rp&lt;/a&gt;.&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrea-blogger-templates.blogspot.com/feeds/9044174394426102282/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/09/removing-comments-and-optimizing-your.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/9044174394426102282'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/9044174394426102282'/><link rel='alternate' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/09/removing-comments-and-optimizing-your.html' title='Removing comments and optimizing your style sheets'/><author><name>Andrea</name><uri>http://www.blogger.com/profile/03133301827360493806</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2210914315561174469.post-2822880431125424972</id><published>2012-09-05T12:39:00.001-07:00</published><updated>2012-09-05T12:40:30.117-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><title type='text'>Note to self</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;With large, complicated projects, it is often useful to annotate your CSS files with temporary comments to aid development. These could be reminders of things you need to do before launch or look-up tables for common values such as column widths.&lt;/div&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;If there are a lot of colors in your design, you will probably find yourself constantly flicking back and forth between your graphics application and text editor to check hex values. This can be a pain at times so several people have suggested the need for CSS variables. While this is an interesting idea it would take CSS one step closer to a proper programming language and potentially alienate non-programmers. As such, I tend to use a low-fi approach instead. All I do is add a little &lt;a class=&quot;zem_slink&quot; href=&quot;http://en.wikipedia.org/wiki/Colour_look-up_table&quot; rel=&quot;wikipedia&quot; target=&quot;_blank&quot; title=&quot;Colour look-up table&quot;&gt;color look-up table&lt;/a&gt; at the top of my style sheet so I can constantly refer to it during development. Once I’m finished developing the page, I’ll usually strip this out.&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;/* Color Variables&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;@colordef #434343; &amp;nbsp;dark gray&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;@colordef #f2f6e4; &amp;nbsp;light green&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;@colordef #90b11f; dark green&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;@colordef #369; dark blue&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;*/&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;To make your comments more meaningful, you can use keywords to distinguish important comments. I use &amp;nbsp;@todo as a reminder that something needs to be changed, fixed, or revisited later on, @bugfix to document a problem with the code or a particular browser, and @workaround to explain a nasty workaround:&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;/* :@todo Remember to remove this rule before the site goes live */&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;/* @workaround: I managed to fix this problem in IE by setting a small&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;negative margin but it&#39;s not pretty */&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;/* @bugfix: Rule breaks in IE 5.2 Mac &amp;nbsp;*/&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;In programming terms, these keywords are called gotchas and can prove very helpful in the later stages of development. In fact, all these terms form part of a project known as CSSDoc (&lt;a href=&quot;http://cssdoc.net/&quot;&gt;http://cssdoc.net&lt;/a&gt;) that aims to develop a standardized &amp;nbsp;syntax for commenting your style sheets.&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;zemanta-pixie&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;zemanta-pixie-img&quot; src=&quot;http://img.zemanta.com/pixy.gif?x-id=7a0a6a84-caab-4408-ad78-005bddb30a2d&quot; /&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrea-blogger-templates.blogspot.com/feeds/2822880431125424972/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/09/note-to-self.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/2822880431125424972'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/2822880431125424972'/><link rel='alternate' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/09/note-to-self.html' title='Note to self'/><author><name>Andrea</name><uri>http://www.blogger.com/profile/03133301827360493806</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2210914315561174469.post-4521173629495554103</id><published>2012-09-05T12:25:00.000-07:00</published><updated>2012-09-05T12:25:51.611-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><title type='text'>Structuring your code</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;It is a good idea to break your style sheets down into sensible chucks for ease of maintenance. At Clearleft, we usually start with the most general styles first. These include styles that are applied to the body tag and should be inherited by everything on the site. Next are any global resets we may need, followed by links, headings, and other elements.&lt;/div&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Once the general styles are covered, we start to get a little more specific and tackle our helper styles. These are general classes that are used across the site and include things like forms and error messages. We then move onto structural elements like layout and navigation.&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;As we move through the style sheet, we slowly layer styles on top of each other, getting more and more specific as we go. Now that the page furniture is out of the way, we turn our attention to page-specific components. Lastly we include any overrides and exceptions at the bottom of the document. The whole document structure ends up looking like this:&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;General styles&lt;/b&gt;&lt;/div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Body styles&lt;/li&gt;
&lt;li&gt;Resets&lt;/li&gt;
&lt;li&gt;Links&lt;/li&gt;
&lt;li&gt;Headings&lt;/li&gt;
&lt;li&gt;Other elements&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;b&gt;Helper styles&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Forms&lt;/li&gt;
&lt;li&gt;Notifications and errors&lt;/li&gt;
&lt;li&gt;Consistent items&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;b&gt;Page structure&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Headers, footers, and navigation&lt;/li&gt;
&lt;li&gt;Layout&lt;/li&gt;
&lt;li&gt;Other page furniture&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;b&gt;Page components&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Individual pages&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;b&gt;Overrides&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
I use a large, stylized comment block to visually separate each section.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;/* @group general styles&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––*/&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;/* @group helper styles&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––*/&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;/* @group page structure&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––*/&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;/* @group page components&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––*/&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;/* @group overrides&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––*/&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Not everything naturally falls into a well-defined &amp;nbsp;block, so some judgment is required. Keep in mind that the more you can break up and objectify your code, the easier it is to understand and the quicker you can find the rules you are looking for.&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Because my style sheets tend to have a similar structure, I save time by creating my own precommented CSS templates to use on all my projects. You can save even more time by adding a few common rules that you use in all of your sites, to create a sort of prototype CSS file. That way, you will not have to reinvent the wheel each time you start a new project.&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrea-blogger-templates.blogspot.com/feeds/4521173629495554103/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/09/structuring-your-code.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/4521173629495554103'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/4521173629495554103'/><link rel='alternate' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/09/structuring-your-code.html' title='Structuring your code'/><author><name>Andrea</name><uri>http://www.blogger.com/profile/03133301827360493806</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2210914315561174469.post-8912549236190978582</id><published>2012-09-05T11:57:00.000-07:00</published><updated>2012-09-05T11:57:01.487-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><title type='text'>Applying styles to your document</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;You can add styles directly to the head &amp;nbsp;of a document by placing them between &amp;nbsp;style tags; however, this is not a very sensible way to apply styles to a document. If you want to create another page using the same styles, you would have to duplicate the CSS on the new page. If you then wanted to change a style, you would have to do it in two places rather than one. Luckily, CSS allows us to keep all our styles in one or more external style sheets. There are two ways to attach external style sheets to a web page. You can link to them or you can import them:&lt;/div&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;link href=&quot;/css/basic.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;style type=&quot;text/css&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;!--&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;@import url(&quot;/css/advanced.css&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;--&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;You do not have to confine importing to an HTML document. You can also import one &lt;a class=&quot;zem_slink&quot; href=&quot;http://en.wikipedia.org/wiki/Style_sheet_%28web_development%29&quot; rel=&quot;wikipedia&quot; target=&quot;_blank&quot; title=&quot;Style sheet (web development)&quot;&gt;style sheet&lt;/a&gt; from another style sheet. This allows you to link to your basic style sheet from the HTML page and then import your more complicated styles into that style sheet:&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;@import url(/css/layout.css);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;@import url(/css/typography.css);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;@import url(/css/color.css);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Breaking your CSS into multiple style sheets used to be a common approach and was the method I recommended in the first edition of this book. However, recent browser benchmarking has shown that importing style sheets can be slower than linking to them.&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;There are two other speed related problems when using multiple CSS files. First off, multiple files will result in more packets being sent from the server, and it’s the number, rather than the contents, of these packets that affects download time. Furthermore, browsers are only able to download a limited number of concurrent files from the same domain at any one time. For older browsers, this limit used to be a paltry two files, although modern browsers have upped this to eight. So in an older browser, if you have three style sheets, you would have to wait for the first two files to download before it starts downloading &amp;nbsp;the third. Because of these reasons, a single, well-structured CSS file can help improve download speeds considerably.&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;A single CSS file also allows you to keep all your code in one place. I used to recommend splitting up your code for easy maintenance. However, it was always difficult to decide if a specific declaration related to the layout or the typography of the site. Often, it could relate to both, and you’d end up making arbitrary decisions where to put them. This approach also meant having to keep multiple style sheets open and continually swapping between files. With features like code folding being built into most modern CSS editors, it’s now much easier to edit a single page than it used to be. So for these reasons, I tend to prefer a single CSS file over several smaller ones. That being said, it really does depend on the site in question, so there are no hard and fast rules here.&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;When writing your own style sheets, you will have a good idea how they are structured, what problems you have encountered, and why things have been done a certain way. But if you come back to that style sheet in six months, there is a good chance you will have forgotten much of this. Additionally, you may need to hand your CSS to somebody else for implementation, or another developer may have to edit your code in the future. It is therefore a good idea to comment your code.&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Adding comments in CSS is very simple. A CSS comment starts with /* and ends with */. This type of commenting is known as C-style commenting, as it is the type of comment used in the C programming language. Comments can be single or multiline and can appear anywhere within the code.&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;/* Body Styles */&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;body {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; font-size: 67.5%; /* Set the font size */&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;If your CSS files become very long, finding the style you want can be difficult. One way to speed things up is to add a flag to each of your comment headers. A &amp;nbsp;flag is simply an extra word preceding your header text that does not naturally appear in your CSS files. A search for your flag followed by the first couple of letters in your comment header will take you right to the part of the file you’re looking for. So in this example, a search for “@group typ” will take you straight to the typography section of your style sheet:&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;/* @group typography */&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;If you happen to use the &lt;a class=&quot;zem_slink&quot; href=&quot;http://www.apple.com/macosx/&quot; rel=&quot;homepage&quot; target=&quot;_blank&quot; title=&quot;Mac OS X&quot;&gt;OS X&lt;/a&gt; editor, CSS Edit, this format is used to create a simple yet effective means of navigating your style sheet.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;zemanta-pixie&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;zemanta-pixie-img&quot; src=&quot;http://img.zemanta.com/pixy.gif?x-id=efeb6952-531d-4413-a897-099f2155af16&quot; /&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrea-blogger-templates.blogspot.com/feeds/8912549236190978582/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/09/applying-styles-to-your-document.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/8912549236190978582'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/8912549236190978582'/><link rel='alternate' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/09/applying-styles-to-your-document.html' title='Applying styles to your document'/><author><name>Andrea</name><uri>http://www.blogger.com/profile/03133301827360493806</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2210914315561174469.post-4641272262682686906</id><published>2012-09-05T11:47:00.005-07:00</published><updated>2012-09-05T12:49:59.993-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><title type='text'>Planning, organizing, and maintaining your style sheets</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;The larger, more complicated, and graphically rich your sites become, the harder your CSS is to manage. In this section, I will look at ways to help you manage your code, including grouping your styles into logical sections and adding comments to make your code easier to read.&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;&lt;a href=&quot;http://andrea-blogger-templates.blogspot.com/2012/09/applying-styles-to-your-document.html&quot;&gt;Applying styles to your document&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;a href=&quot;http://andrea-blogger-templates.blogspot.com/2012/09/structuring-your-code.html&quot;&gt;Structuring your code&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;a href=&quot;http://andrea-blogger-templates.blogspot.com/2012/09/note-to-self.html&quot;&gt;Note to self&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;a href=&quot;http://andrea-blogger-templates.blogspot.com/2012/09/removing-comments-and-optimizing-your.html&quot;&gt;Removing comments and optimizing your style sheets&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrea-blogger-templates.blogspot.com/feeds/4641272262682686906/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/09/planning-organizing-and-maintaining.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/4641272262682686906'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/4641272262682686906'/><link rel='alternate' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/09/planning-organizing-and-maintaining.html' title='Planning, organizing, and maintaining your style sheets'/><author><name>Andrea</name><uri>http://www.blogger.com/profile/03133301827360493806</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2210914315561174469.post-1973937534671185291</id><published>2012-09-05T10:57:00.001-07:00</published><updated>2012-09-05T10:59:03.397-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><title type='text'>Inheritance</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;People often confuse inheritance with the cascade. Although they seem related at first glance, the two concepts are actually quite different. Luckily, inheritance is a much easier concept to grasp. Certain properties, such as color or font size, are inherited by the descendants of the elements those styles are applied to. For instance, if you were to give the body element a text color of black, all the descendants of the body element would also have black text. The same would be true of font sizes. If you gave the body a font size of 1.4 ems, everything on the page should inherit that font size. I say &amp;nbsp;should because IE for Windows and Netscape have problems inheriting font sizes in tables. To get around this, you will either have to specify that tables should inherit font sizes or set the font size on tables separately.&lt;/div&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;If you set the font size on the body, you will notice that this style is not picked up by any headings on the page. You may assume that headings do not inherit text size. But it is actually the browser default style sheet setting the heading size. Any style applied directly to an element will always override an inherited style. This is because inherited styles have a null specificity.&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Inheritance is very useful, as it lets you avoid having to add the same style to every descendant of an element. If the property you are trying to set is an inherited property, you may as well apply it to the parent element. After all, what is the point of writing this:&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;p, div, h1, h2, h3, ul, ol, dl, li {color: black;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
when you can just write this:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;body {color: black;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Just as sensible use of the cascade can help simplify your CSS, good use of inheritance can help to reduce the number and complexity of the selectors in your code. It you have lots of elements inheriting various styles, though, determining where the styles originate can become confusing.&lt;/div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrea-blogger-templates.blogspot.com/feeds/1973937534671185291/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/09/inheritance.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/1973937534671185291'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/1973937534671185291'/><link rel='alternate' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/09/inheritance.html' title='Inheritance'/><author><name>Andrea</name><uri>http://www.blogger.com/profile/03133301827360493806</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2210914315561174469.post-4185445162375834034</id><published>2012-09-02T03:42:00.001-07:00</published><updated>2012-09-02T03:48:17.575-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><title type='text'>Adding a class or an ID to the body tag</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;One interesting way to use specificity &amp;nbsp;is to apply a class or an ID to the body tag. By doing this, you can then override styles on a page-by-page or even a site-wide basis. For instance, if you wanted all your news pages to have a specific layout, you could add a class name to the body element and use it to target your styles:&lt;/div&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;body.news {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; /* do some stuff */&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;body class=&quot;news&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;lt;p&amp;gt;My, what a lovely body you have.&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Sometimes, you’ll need to override these styles on a particular page, such as your news archive page. In this case, you can add an ID to the body tag to target that specific page.&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;body.news {&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; /* do some stuff */&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;body#archive {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; /* do some different stuff */&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;body id=&quot;archive&quot; class=&quot;news&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;lt;p&amp;gt;My, what a lovely body you have.&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Using a class for the type of page and an ID for the specific page gives you a huge amount of control over the design and layout of your site. As such, this is one of my favorite techniques for writing maintainable code.&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrea-blogger-templates.blogspot.com/feeds/4185445162375834034/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/09/adding-class-or-id-to-body-tag.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/4185445162375834034'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/4185445162375834034'/><link rel='alternate' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/09/adding-class-or-id-to-body-tag.html' title='Adding a class or an ID to the body tag'/><author><name>Andrea</name><uri>http://www.blogger.com/profile/03133301827360493806</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2210914315561174469.post-7675133582661723806</id><published>2012-09-02T03:33:00.000-07:00</published><updated>2012-09-02T03:33:25.147-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><title type='text'>Using specificity in your style sheets</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Specificity is very useful when writing CSS, as it allows you to set general styles for common elements and then override them for more specific elements. For instance, say you want most of the text on your site black, except for your &amp;nbsp;intro text, which you want gray. You could do something like this:&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;p {color: black;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;p.intro &amp;nbsp;{color: grey;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;This is fine for smaller sites. However, on larger sites you will find more and more exceptions will start to creep in. Maybe you want to have the introductory text on your news stories blue and the introductory text on your home page on a gray background. Each time you create a more specific style, you will probably need to override some of the general rules. This can lead to quite a bit of extra code. It can also start to get very complicated, as one element may be picking up styles from a variety of places.&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;To avoid too much confusion, I try to make sure my general styles are very general while my specific styles are as specific as possible and never need to be overridden. If I find that I have to override general styles several times, it’s simpler to remove the declaration that needs to be overridden from the more general rules and apply it explicitly to each element that needs it.&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrea-blogger-templates.blogspot.com/feeds/7675133582661723806/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/09/using-specificity-in-your-style-sheets.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/7675133582661723806'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/7675133582661723806'/><link rel='alternate' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/09/using-specificity-in-your-style-sheets.html' title='Using specificity in your style sheets'/><author><name>Andrea</name><uri>http://www.blogger.com/profile/03133301827360493806</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2210914315561174469.post-4752914026050494181</id><published>2012-08-31T15:15:00.002-07:00</published><updated>2012-09-02T03:47:38.140-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><title type='text'>The cascade and specificity</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;With even a moderately complicated style sheet, it is likely that two or more rules will target the same element. CSS handles such conflicts through a process known as the &amp;nbsp;cascade. The cascade works by assigning an importance to each rule. Author style sheets are those written by the site developers and are considered the most important. Users can apply their own styles via the browser and these are considered the next most important. Finally, the default style sheets used by your browser or user agent are given &amp;nbsp;the least importance so you can always override them. To give users more control, they can override any rule by specifying it as !important even a rule flagged as !important by the author. This is to allow &amp;nbsp;for specific accessibility needs such as using a medium contrast user style sheet if you have a certain forms of dyslexia.&lt;/div&gt;&lt;br /&gt;
&lt;b&gt;In This Section&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;a href=&quot;http://andrea-blogger-templates.blogspot.com/2012/09/using-specificity-in-your-style-sheets.html&quot;&gt;Using specificity in your style sheets&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;a href=&quot;http://andrea-blogger-templates.blogspot.com/2012/09/adding-class-or-id-to-body-tag.html&quot;&gt;Adding a class or an ID to the body tag&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
So the cascade works in the following order of importance:&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;User styles flagged as !important&lt;/li&gt;
&lt;li&gt;Author styles flagged as !important&lt;/li&gt;
&lt;li&gt;Author styles&lt;/li&gt;
&lt;li&gt;User styles&lt;/li&gt;
&lt;li&gt;Styles applied by the browser/user agent&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Rules are then ordered by how specific the selector is. Rules with more specific selectors override those with less specific ones. If two rules are equally specific, the last one defined takes precedence.&lt;/div&gt;&lt;br /&gt;
&lt;b&gt;Specificity&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;To calculate how specific a rule is, each type  of selector is assigned a numeric value. The specificity of a rule is then  calculated by adding up the value of each of its selectors. Unfortunately, specificity is not calculated in base 10 but a high, unspecified, base number. This is to ensure that a highly specific selector, such as an ID selector, is never overridden by lots of less specific selectors, such as type selectors. However, if you have fewer than 10 selectors in a specific selector, you can calculate specificity in base 10 for simplicity’s sake.&lt;/div&gt;&lt;br /&gt;
The specificity of a selector is broken down into four constituent levels: a, b, c, and d.&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;If the style is an inline style, a equals 1.&lt;/li&gt;
&lt;li&gt;b equals the total number of ID selectors.&lt;/li&gt;
&lt;li&gt;c equals the number of class, pseudo-class, and attribute selectors.&lt;/li&gt;
&lt;li&gt;d equals the number of type selectors and pseudo-element selectors.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Using these rules, it is possible to calculate the specificity of any CSS selector. Table 2-1 shows a series of selectors, along with their associated specificity.&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table border=&quot;0&quot; cellspacing=&quot;1&quot;&gt;&lt;caption&gt;&lt;b&gt;Table 2-1. Specificity examples&lt;/b&gt;&lt;/caption&gt; &lt;tbody&gt;
&lt;tr&gt;  &lt;td&gt;&lt;b&gt;Selector&lt;/b&gt;&lt;/td&gt;  &lt;td&gt;&lt;b&gt;Specificity&lt;/b&gt;&lt;/td&gt;  &lt;td&gt;&lt;b&gt;Specificity in Base 10&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt;  &lt;td&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;Style=&quot;&quot;&lt;/span&gt;&lt;/td&gt;  &lt;td&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;1,0,0,0&lt;/span&gt;&lt;/td&gt;  &lt;td&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;1000&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt;  &lt;td&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;#wrapper #content {}&lt;/span&gt;&lt;/td&gt;  &lt;td&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;0,2,0,0 &lt;/span&gt;&lt;/td&gt;  &lt;td&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;200&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt;  &lt;td&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;#content .datePosted {}&lt;/span&gt;&lt;/td&gt;  &lt;td&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;0,1,1,0&lt;/span&gt;&lt;/td&gt;  &lt;td&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;110&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt;  &lt;td&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;div#content {}&lt;/span&gt;&lt;/td&gt;  &lt;td&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;0,1,0,1&lt;/span&gt;&lt;/td&gt;  &lt;td&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;101&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt;  &lt;td&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;#content {}&lt;/span&gt;&lt;/td&gt;  &lt;td&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;0,1,0,0&lt;/span&gt;&lt;/td&gt;  &lt;td&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;100&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt;  &lt;td&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;p.comment .dateposted {}&lt;/span&gt;&lt;/td&gt;  &lt;td&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;0,0,2,1&lt;/span&gt;&lt;/td&gt;  &lt;td&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;21&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt;  &lt;td&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;p.comment{}&lt;/span&gt;&lt;/td&gt;  &lt;td&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;0,0,1,1&lt;/span&gt;&lt;/td&gt;  &lt;td&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;11&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt;  &lt;td&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;div p {}&lt;/span&gt;&lt;/td&gt;  &lt;td&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;0,0,0,2&lt;/span&gt;&lt;/td&gt;  &lt;td&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;2&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt;  &lt;td&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;p {}&lt;/span&gt;&lt;/td&gt;  &lt;td&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;0,0,0,1&lt;/span&gt;&lt;/td&gt;  &lt;td&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;1&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;At first glance, all this talk of specificity and high but undefined based numbers may seem a little confusing, so here’s what you need to know. Essentially, a rule written in a style attribute will always be more specific than any other rule. A  rule with an ID will be more specific than one without an ID, and a rule with a class selector will be more specific than a rule with just type selectors. Finally, if two rules have the same specificity, the last one defined prevails.&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Specificity can be extremely important when fixing bugs, as you need to know which rules take precedence and why. For instance, say you had this set of rules. What color do you think the two headlines will be?&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;#content div#main-content h2 {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;color: gray;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;#content #main-content&amp;gt;h2 {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;color: blue;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;body #content div[id=&quot;main-content&quot;] h2 {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;color: green;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;#main-content div.news-story h2 {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;color: orange;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;#main-content [class=&quot;news-story&quot;] h2 {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;color: yellow;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;div#main-content div.news-story h2.first {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;color: red;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;div id=&quot;content&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;div id=&quot;main-content&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;h2&amp;gt;Strange Times&amp;lt;/h2&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;p&amp;gt;Here you can read bizarre news stories from around the globe.&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;div class=&quot;news-story&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;h2 class=&quot;first&quot;&amp;gt;Bog Snorkeling Champion Announced Today&amp;lt;/h2&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;p&amp;gt;The 2008 Bog Snorkeling Championship was won by Conor Murphy&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;with an impressive time of 1 minute 38 seconds.&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;The answer, surprisingly, is that both headlines are gray. The first selector has the highest specificity because it’s made up of two ID selectors. Some of the later selectors may look more complicated, but as they only contain one ID, they will always lose out against the more specific selectors.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;If you ever come across a CSS rule that just doesn’t seem to be working, you could be suffering from a specificity clash. Try making your selectors more specific by adding the ID of one of its parents. If that fixes the problem, you’ll probably find that there is a more specific rule somewhere in your style sheet overriding what you’re trying to do. If that’s the case, you’ll probably want to go back through your code and clean up the specificity clashes to keep your code as lean as possible.&lt;/div&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrea-blogger-templates.blogspot.com/feeds/4752914026050494181/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/08/the-cascade-and-specificity.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/4752914026050494181'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/4752914026050494181'/><link rel='alternate' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/08/the-cascade-and-specificity.html' title='The cascade and specificity'/><author><name>Andrea</name><uri>http://www.blogger.com/profile/03133301827360493806</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2210914315561174469.post-7411228676083766089</id><published>2012-08-30T15:45:00.000-07:00</published><updated>2012-08-30T15:45:51.575-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><title type='text'>Attribute selectors</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;As the name suggests, the attribute selector allows you to target an element based on the existence of an attribute or the attribute’s value. This allows you to do some very interesting and powerful things.&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;For example, when you hover over an element with a title attribute, most browsers will display a tooltip. You can use this behavior to expand the meaning of things such as acronyms and abbreviations:&lt;/div&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;p&amp;gt;The term &amp;lt;acronym title=&quot;self-contained underwater breathing&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;apparatus&quot;&amp;gt;SCUBA&amp;lt;/acronym&amp;gt; is an acronym rather than an abbreviation&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;as it is pronounced as a word.&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;However, there is no way to tell that this extra information exists without hovering over the element. To get around this problem, you can use the attribute selector to style acronym elements with titles differently from other elements—in this case, by giving them a dotted bottom border. You can provide more contextual information by changing the cursor from a pointer to a question mark when the cursor hovers over the element, indicating that this element is different from most.&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;acronym[title] {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; border-bottom: 1px dotted #999;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;acronym[title]:hover, acronym[title]:focus {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; cursor: help;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;In addition to styling an element based on the existence of an attribute, you can apply styles based on a particular value. For instance, sites that are linked to using a rel attribute of nofollow gain no added ranking benefit from Google. The following rule displays an image next to such links, possibly as a way of showing disapproval of the target site:&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;a[rel=&quot;nofollow&quot;] {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; background: url(nofollow.gif) no-repeat right center;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; padding-right: 20px;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;All modern browsers including IE 7 support these selectors. However, because IE 6 doesn’t support attribute selectors, you could potentially use them to apply one style to IE 6 and a different style to more capable browsers. For instance, Andy Clarke makes use of this technique by presenting black and white version of his site to IE 6 (see Figure 2-3) and a color one to all other browsers (see Figure 2-4).&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWVcdtwtHunwmt3SLeH3qwjFDhfA6NrjqANlmpqC0IpQ5LVsgR2i-NPw2ACOp93dcwLsB7u3OeEZxdF5TRdVkvVf9b5s_xpXQccNwK5SmEaM7b0eWg7_RgDYX8dHh3vgF5OyU7S18cOvPP/s1600/figure_2-3.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Andy Clarke serves up a black and white version of his site to IE 6 using attribute selectors, among other techniques.&quot; border=&quot;0&quot; height=&quot;342&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWVcdtwtHunwmt3SLeH3qwjFDhfA6NrjqANlmpqC0IpQ5LVsgR2i-NPw2ACOp93dcwLsB7u3OeEZxdF5TRdVkvVf9b5s_xpXQccNwK5SmEaM7b0eWg7_RgDYX8dHh3vgF5OyU7S18cOvPP/s400/figure_2-3.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;Figure 2-3. Andy Clarke serves up a black and white version of his site to IE 6 using attribute selectors, among other techniques.&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiy6RCjfv4Kj8AN9SCwBKWATLzJyk84A88maAKHVvMCmQDxE9gqzPszt118HAD6ztu8iJQG8mlrnez-gv-cY0SKPGhD_pe7HxwrjB-uhmdE6BGdG_XpmEKA2slbHommpbE6pMXWrTL7TRku/s1600/figure_2-4.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;More modern browsers get a color version.&quot; border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiy6RCjfv4Kj8AN9SCwBKWATLzJyk84A88maAKHVvMCmQDxE9gqzPszt118HAD6ztu8iJQG8mlrnez-gv-cY0SKPGhD_pe7HxwrjB-uhmdE6BGdG_XpmEKA2slbHommpbE6pMXWrTL7TRku/s400/figure_2-4.jpg&quot; width=&quot;255&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;Figure 2-4. More modern browsers get a color version.&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;#header {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; background: url(branding-bw.png) repeat-y left top;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;[id=&quot;header&quot;] {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; background: url(branding-color.png) repeat-y left top;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Some attributes can have more than one value, separated by spaces. The attribute selector allows you to target an element based on one of those values. For instance, the XFN microformat allows you to define the relationship you have with a site by adding keywords to the rel attribute of an anchor link. So I can say that a particular &amp;nbsp;site belongs to a work colleague of mine by adding the co-worker keyword to the links in my blogroll. I can then show readers that I work with that person by displaying a particular icon next to that co-worker’s name.&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;.blogroll a[rel~=&quot;co-worker&quot;] {&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; background: url(co-worker.gif) no-repeat left center;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;ul class=&quot;blogroll&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;lt;li&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;lt;a href=&quot;http://adactio.com/&quot; rel=&quot;friend met colleague co-worker&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;Jeremy Keith&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;lt;/li&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;lt;li&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;lt;a href=&quot;http://clagnut.com/&quot; rel=&quot;friend met colleague co-worker&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;Richard Rutter&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;lt;/li&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;lt;li&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;lt;a href=&quot;http://hicksdesign.com/&quot; rel=&quot;friend met colleague&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;John Hicks&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;lt;/li&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;lt;li&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;lt;a href=&quot;http:// stuffandnonsense.co.uk/&quot; rel=&quot;friend met colleague&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;Andy Clarke&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;lt;/li&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;/ul&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrea-blogger-templates.blogspot.com/feeds/7411228676083766089/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/08/attribute-selectors.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/7411228676083766089'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/7411228676083766089'/><link rel='alternate' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/08/attribute-selectors.html' title='Attribute selectors'/><author><name>Andrea</name><uri>http://www.blogger.com/profile/03133301827360493806</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWVcdtwtHunwmt3SLeH3qwjFDhfA6NrjqANlmpqC0IpQ5LVsgR2i-NPw2ACOp93dcwLsB7u3OeEZxdF5TRdVkvVf9b5s_xpXQccNwK5SmEaM7b0eWg7_RgDYX8dHh3vgF5OyU7S18cOvPP/s72-c/figure_2-3.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2210914315561174469.post-22021913276334977</id><published>2012-08-30T15:10:00.001-07:00</published><updated>2012-08-30T15:15:05.915-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><title type='text'>Child and adjacent sibling selectors</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;The first of these advanced selectors is the child selector. Whereas a descendant selector will select all the descendants of an element, a child selector only targets the element’s immediate descendants, or children. In the following example, the list items in the outer list will be given a custom icon while list items in the nested list will remain unaffected (see Figure 2-1):&lt;/div&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;#nav&amp;gt;li {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; background: url(folder.png) no-repeat left top;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; padding-left: 20px;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;ul id=&quot;nav&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;lt;li&amp;gt;&amp;lt;a href=&quot;/home/&quot;&amp;gt;Home&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;lt;li&amp;gt;&amp;lt;a href=&quot;/services/&quot;&amp;gt;Services&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;ul&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;li&amp;gt;&amp;lt;a href=&quot;/services/design/&quot;&amp;gt;Design&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;li&amp;gt;&amp;lt;a href=&quot;/services/development/&quot;&amp;gt;Development&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;li&amp;gt;&amp;lt;a href=&quot;/services/consultancy/&quot;&amp;gt;Consultancy&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/ul&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;lt;/li&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;lt;li&amp;gt;&amp;lt;a href=&quot;/contact/&quot;&amp;gt;Contact Us&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdr2lunHGTjqZNzXZDzDmnpt3daNHpJb-ahHYSVMORMCvMfRoqtpd5ADPNUZuo-nwTr_nH0g4gVZ2I-96lO2-RZ_roxlXDafYN_wDoNgZFDm9EusDqSe4dsKoloz4Q2JALLAxUO-961WaJ/s1600/figure_2-1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;The child selector styles the children of the list but not its grandchildren.&quot; border=&quot;0&quot; height=&quot;268&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdr2lunHGTjqZNzXZDzDmnpt3daNHpJb-ahHYSVMORMCvMfRoqtpd5ADPNUZuo-nwTr_nH0g4gVZ2I-96lO2-RZ_roxlXDafYN_wDoNgZFDm9EusDqSe4dsKoloz4Q2JALLAxUO-961WaJ/s320/figure_2-1.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;Figure 2-1. The child selector styles the children of the list but not its grandchildren.&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;The child selector is supported by IE 7 and above. However, there is a small bug in IE 7 that causes problems if there are HTML comments between the parent and child.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;It is possible to fake a child selector that works in IE 6 and below by using the universal selector. To do this, you first apply to all of the descendants the style you want the children to have. You then use the universal selector to override these styles on the children’s descendants. So to fake the previous child selector example you would do this:&lt;/div&gt;&lt;br /&gt;
&amp;nbsp;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;#nav li {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; background: url(folder.png) no-repeat left top;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; badding-left: 20px;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;#nav li * {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; background-image: none;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; padding-left: 0;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Sometimes, you may want to style an element based on its proximity to another element. The adjacent sibling selector allows you to target an element that is preceded by another element that shares the same parent. Using the sibling selector, you could make the first paragraph following a top-level heading bold, gray, and slightly larger than the subsequent paragraphs (see Figure 2-2):&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;h2 + p {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; font-size: 1.4em;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; font-weight: bold;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; color: #777;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;h2&amp;gt;Peru Celebrates Guinea Pig festival&amp;lt;/h2&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;lt;p&amp;gt;The guinea pig festival in Peru is a one day event to celebrate&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;these cute local animals. The festival included a fashion show where&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;animals are dressed up in various amusing costumes.&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;lt;p&amp;gt;Guinea pigs can be fried, roasted, or served in a casserole. Around&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;65 million guinea pigs are eaten in Peru each year.&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTg-o2aVWOEzkbPz63dyXRc0t6_j92FvpVZAny_trNsG-Zc0DjMLSlzIuOp_6mYfLJ0wsq_TvXQU90VQMsZrr62n43v77Ya78wt8PKuhYRyFvGOxcsHLa922h3WTj65ClOglnaB0oNUYl3/s1600/figure_2-2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;The adjacent sibling selector can be used to style the first paragraph after a headline, allowing you to do away with extraneous classes.&quot; border=&quot;0&quot; height=&quot;226&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTg-o2aVWOEzkbPz63dyXRc0t6_j92FvpVZAny_trNsG-Zc0DjMLSlzIuOp_6mYfLJ0wsq_TvXQU90VQMsZrr62n43v77Ya78wt8PKuhYRyFvGOxcsHLa922h3WTj65ClOglnaB0oNUYl3/s400/figure_2-2.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;Figure 2-2. The adjacent sibling selector can be used to style the first paragraph after a headline, allowing you to do away with extraneous classes.&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;As with the child selector, this fails in IE 7 if comments appear between the elements you are targeting.&lt;/div&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrea-blogger-templates.blogspot.com/feeds/22021913276334977/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/08/child-and-adjacent-sibling-selectors.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/22021913276334977'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/22021913276334977'/><link rel='alternate' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/08/child-and-adjacent-sibling-selectors.html' title='Child and adjacent sibling selectors'/><author><name>Andrea</name><uri>http://www.blogger.com/profile/03133301827360493806</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdr2lunHGTjqZNzXZDzDmnpt3daNHpJb-ahHYSVMORMCvMfRoqtpd5ADPNUZuo-nwTr_nH0g4gVZ2I-96lO2-RZ_roxlXDafYN_wDoNgZFDm9EusDqSe4dsKoloz4Q2JALLAxUO-961WaJ/s72-c/figure_2-1.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2210914315561174469.post-7803725538899077336</id><published>2012-08-30T14:57:00.002-07:00</published><updated>2012-08-30T15:48:38.087-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><title type='text'>Advanced selectors</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;CSS 2.1 and CSS 3 have a number of other useful selectors. Unfortunately, while most modern browsers support these advanced selectors, older browsers like IE 6 do not. Luckily, CSS was created with backward compatibility in mind. If a browser doesn’t understand a selector, it ignores the whole rule. That way, you can apply stylistic and usability embellishments in more modern browsers and not worry about it causing problems &amp;nbsp;in older browsers. Just remember to avoid using these more advanced selectors for anything critical to the function or layout of your site.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;a href=&quot;http://andrea-blogger-templates.blogspot.com/2012/08/child-and-adjacent-sibling-selectors.html&quot;&gt;Child and adjacent sibling selectors&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://andrea-blogger-templates.blogspot.com/2012/08/attribute-selectors.html&quot;&gt;Attribute selectors&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrea-blogger-templates.blogspot.com/feeds/7803725538899077336/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/08/advanced-selectors.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/7803725538899077336'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/7803725538899077336'/><link rel='alternate' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/08/advanced-selectors.html' title='Advanced selectors'/><author><name>Andrea</name><uri>http://www.blogger.com/profile/03133301827360493806</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2210914315561174469.post-4039896214605202800</id><published>2012-08-30T14:28:00.000-07:00</published><updated>2012-08-30T14:28:06.174-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><title type='text'>The universal selector *</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;The universal selector is possibly one of the most powerful and least used of all the selectors. The universal selector acts like a wild card, matching all the available elements. Like wild cards in other languages, the universal selector is denoted by an asterisk. The universal selector is often used to style every element on a page. For instance, you can remove the default browser padding and margin on every element using the following rule:&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;* {&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; padding: 0;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; margin: 0;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;When combined with other selectors, the universal selector can be used to style all the descendants of a particular element or skip a level of descendants. You will see how this can be put to practical effect a little later in this chapter.&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrea-blogger-templates.blogspot.com/feeds/4039896214605202800/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/08/the-universal-selector.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/4039896214605202800'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/4039896214605202800'/><link rel='alternate' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/08/the-universal-selector.html' title='The universal selector *'/><author><name>Andrea</name><uri>http://www.blogger.com/profile/03133301827360493806</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2210914315561174469.post-1867862573519890861</id><published>2012-08-30T14:17:00.000-07:00</published><updated>2012-08-30T14:17:24.060-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><title type='text'>Pseudo-classes</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;There are instances where you may want to style an element based on something other than the structure of the document—for instance, the state of a link or form element. This can be done using a pseudo-class selector.&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;/* makes all unvisited links blue */&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;a:link {color:blue;} &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;/* makes all visited links green */&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;a:visited {color:green;} &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;/* makes links red when hovered or activated.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;focus is added for keyboard support */&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;a:hover, a:focus, a:active {color:red;} &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;/* makes table rows red when hovered over */&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;tr:hover {background-color: red;} &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;/* makes input elements yellow when focus is applied */&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;input:focus {background-color:yellow;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;:link and &amp;nbsp;:visited are known as &amp;nbsp;link pseudo-classes and can only be applied to anchor elements. &amp;nbsp;:hover, &amp;nbsp;:active, and &amp;nbsp;:focus are known as &amp;nbsp;dynamic pseudo-classes and can theoretically be applied to any element. Most modern browsers support this functionality. Unsurprisingly, IE 6 only pays attention to the :active and :hover pseudo-classes when applied to an anchor link, and ignores :focus completely. IE7 supports :hover on arbitrary elements but ignores :active and :focus.&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Last, it’s worth pointing out that pseudo-classes can be strung together to create more complex behaviors, such as styling the hover effect on visited links different from those on unvisited links.&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;/* makes all visited linkes olive on hover */&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;a:visited:hover {color:olive;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrea-blogger-templates.blogspot.com/feeds/1867862573519890861/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/08/pseudo-classes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/1867862573519890861'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/1867862573519890861'/><link rel='alternate' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/08/pseudo-classes.html' title='Pseudo-classes'/><author><name>Andrea</name><uri>http://www.blogger.com/profile/03133301827360493806</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2210914315561174469.post-1647967475554813468</id><published>2012-08-30T03:35:00.000-07:00</published><updated>2012-08-30T03:35:57.518-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><title type='text'>Common selectors</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;The most common kinds of selectors are type and descendant selectors. Type selectors are used to target a particular type of element, such as a paragraph or a heading element. You do this by simply specifying the name of the element you wish to style. Type selectors are sometimes also referred to as element or simple selectors.&lt;/div&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;p {color: black;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;h1 {font-weight: bold;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Descendant selectors allow you to target the descendants of a particular element or group of elements. A descendant selector is indicated by &amp;nbsp;a space between two other selectors. In this example, only paragraph elements that are descendants of a blockquote will be indented, while all other paragraphs will remain unchanged.&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;blockquote p {padding-left: 2em;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;These two types of selector are great for applying generic styles that apply across the board. To be more specific and target selected elements, you can use ID and class selectors. As the names suggest, these selectors will target elements &amp;nbsp;with the corresponding ID or class name. ID selectors are identified using a hash character; class selectors are identified with a period. The first rule in this example will make the text in the introductory paragraph bold, and the second rule will make the date grey:&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;#intro {font-weight: bold;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;.date-posted {color: #ccc;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;p id=&quot;intro&quot;&amp;gt;Happy Birthday Andy&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;p class=&quot;date-posted&quot;&amp;gt;24/3/2009&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;As I mentioned previously, many CSS authors develop an overreliance on class and ID selectors. If they want to style headlines one way in &amp;nbsp;the main content area and another way in the secondary content area, there is the tendency to create two classes and apply a class to each headline. A much simpler approach is to use a combination of type, descendant, ID, and/or class selectors:&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;#main-content h2 {font-size: 1.8em;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;#secondaryContent h2 {font-size: 1.2em;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;div id=&quot;main-content&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;lt;h2&amp;gt;Articles&amp;lt;/h2&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; ...&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;div id=&quot;secondary-content&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;lt;h2&amp;gt;Latest news&amp;lt;/h2&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; ...&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;This is a very simple and obvious example. However, you will be surprised how many elements you can successfully target using just the four &amp;nbsp;selectors discussed so far. If you find yourself adding lots of extraneous classes to your document, it is probably a warning sign that your document is not well structured. Instead, think about how these elements differ from each other. Often, you will find that the only difference is where they appear on the page. Rather than give these elements different classes, think about applying a class or an ID to one of their ancestors, and then targeting them using a descendant selector.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrea-blogger-templates.blogspot.com/feeds/1647967475554813468/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/08/common-selectors.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/1647967475554813468'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/1647967475554813468'/><link rel='alternate' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/08/common-selectors.html' title='Common selectors'/><author><name>Andrea</name><uri>http://www.blogger.com/profile/03133301827360493806</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2210914315561174469.post-932697771993090637</id><published>2012-08-30T03:29:00.003-07:00</published><updated>2012-08-30T14:33:18.526-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><category scheme="http://www.blogger.com/atom/ns#" term="Web design"/><title type='text'>Getting Your Styles to Hit the Target</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;A valid and well-structured document provides the foundations to which your styles are applied. To be able to style a particular HTML element using CSS, you need to have some way of targeting that element. In CSS the part of a style rule that does this is called the selector.&amp;nbsp;&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;
In this chapter, you will learn about:&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;&lt;a href=&quot;http://andrea-blogger-templates.blogspot.com/2012/08/common-selectors.html&quot;&gt;Common selectors&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://andrea-blogger-templates.blogspot.com/2012/08/pseudo-classes.html&quot;&gt;Pseudo-classes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://andrea-blogger-templates.blogspot.com/2012/08/the-universal-selector.html&quot;&gt;The universal selector&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;Advanced selectors&lt;/li&gt;
&lt;li&gt;New CSS 3 selectors&lt;/li&gt;
&lt;li&gt;The wonderful world of specificity and the cascade&lt;/li&gt;
&lt;li&gt;Planning and maintaining your style sheets&lt;/li&gt;
&lt;li&gt;How to comment your code&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrea-blogger-templates.blogspot.com/feeds/932697771993090637/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/08/getting-your-styles-to-hit-target.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/932697771993090637'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/932697771993090637'/><link rel='alternate' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/08/getting-your-styles-to-hit-target.html' title='Getting Your Styles to Hit the Target'/><author><name>Andrea</name><uri>http://www.blogger.com/profile/03133301827360493806</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2210914315561174469.post-7922083028817967469</id><published>2012-08-30T00:00:00.000-07:00</published><updated>2012-08-30T00:00:18.660-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><category scheme="http://www.blogger.com/atom/ns#" term="Web design"/><title type='text'>Divs and spans</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;One element that can help add structure to a document is the &amp;nbsp;div element. Many people mistakenly believe that a div element has no semantic meaning. However, div actually stands for division and provides a way of dividing a document &amp;nbsp;into meaningful areas. So by wrapping your main content area in a div and giving it a class of content, you are adding structure and meaning to your document.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;To keep unnecessary markup to a minimum, you should only use a &amp;nbsp;div element if there is no existing element that will do the job. For instance, if you are using a list for your main navigation, there is no need to wrap it in a div.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;div class=&quot;nav&quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;lt;ul&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;li&amp;gt;&amp;lt;a href=&quot;/home/&quot;&amp;gt;Home&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;li&amp;gt;&amp;lt;a href=&quot;/about/&quot;&amp;gt;About Us&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;li&amp;gt;&amp;lt;a href=&quot;/contact/&quot;&amp;gt;Contact&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;lt;/ul&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;You can remove the div entirely and simply apply your class to the list instead:&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;ul class=&quot;nav&quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;li&amp;gt;&amp;lt;a href=&quot;/home/&quot;&amp;gt;Home&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;li&amp;gt;&amp;lt;a href=&quot;/about/&quot;&amp;gt;About Us&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;li&amp;gt;&amp;lt;a href=&quot;/contact/&quot;&amp;gt;Contact&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Using too many divs is often described as divitus and is usually a sign that your code is poorly structured and overly complicated. Some people new to CSS will try to replicate their old table structure using &amp;nbsp;divs. But this is just swapping one set of extraneous tags for another. Instead, divs should be used to group related items based on their meaning or function rather than their presentation or layout.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Whereas divs can be used to group block-level elements, spans can be used to group or identify inline elements:&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;h2&amp;gt;Andy wins an Oscar for his cameo in Iron Man &amp;lt;/h2&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;lt;p&amp;gt;Published on &amp;lt;span class=&quot;date&quot;&amp;gt;February 22nd, 2009&amp;lt;/span&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;by &amp;lt;span class=&quot;author&quot;&amp;gt;Harry Knowles&amp;lt;/span&amp;gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Although the goal is to keep your code as lean and mean(ingful) as possible, sometimes you cannot avoid adding an extra nonsemantic &amp;nbsp;div or span to get the page to display the way you want. If this is the case, don’t fret too much over it. We live in a transitional period, and CSS 3 will give us much greater control of our documents. In the meantime, real-world needs often have to come before theory. The trick is knowing when you have to make a compromise and if you are doing it for the right reasons.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrea-blogger-templates.blogspot.com/feeds/7922083028817967469/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/08/divs-and-spans.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/7922083028817967469'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/7922083028817967469'/><link rel='alternate' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/08/divs-and-spans.html' title='Divs and spans'/><author><name>Andrea</name><uri>http://www.blogger.com/profile/03133301827360493806</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2210914315561174469.post-2393781671470201760</id><published>2012-08-29T23:26:00.001-07:00</published><updated>2012-08-29T23:40:34.434-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><category scheme="http://www.blogger.com/atom/ns#" term="Web design"/><title type='text'>IDs or Classes?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;It is often difficult to decide if an element should have an ID or class name. As a general rule, classes should be applied to conceptually similar items that could appear in multiple places on the same page, whereas IDs should be applied to unique elements. However, you then get into a debate about which elements are conceptually similar and which elements are unique.&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;For instance, imagine you have a site that contains primary navigation in the header, page-based navigation at the bottom of the search results page, and tertiary navigation in the footer. Do you give each of these a separate ID like main-nav, page-nav, and footer-nav, or do you give them all a class of nav and style them based on their position in the document? I used to prefer the former approach, as it felt slightly more targeted. However, it comes with its own set of problems. What happens if I decide that I now need search results navigation at the  top and the bottom of the search page or that I need two levels of navigation in the footer?&lt;/div&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;If you use a lot of IDs, you will start to run out of unique names very quickly and end up creating extremely long and complicated naming conventions. So these days, I tend to prefer class names and only use IDs if I’m targeting something extremely specific and know that I’ll never want to use that name for something different elsewhere on the site. Or to put it another way, you should only use an ID if you’re absolutely sure the item will appear only once. If you think you will need similar items in the future, use a class. By keeping your naming conventions general and using classes you don’t end up with long chains of ID selectors all with very similar styles.&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;#andy, #rich, #jeremy, #james-box, #cennydd, #paul, #natalie, #sophie {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;font-size: 1.6em;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;font-weight: bold;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;border: 1px solid #ccc;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
You can simply create a generic class for them all.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;.staff {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;font-size: 1.6em;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;font-weight: bold;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;border: 1px solid #ccc;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Due to the flexibility of classes, they can be  very powerful. At the same time, they can be overused and even abused. Novice CSS authors often add classes to nearly everything in an attempt to get fine-grained control over their styles. Early WYSIWYG editors also had the tendency to add classes each time a style was applied. Many developers picked up this bad habit when using generated code to learn CSS. This affliction is described as classitis and is, in some respects, as bad as using table-based layout  because it adds meaningless code to your document.&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;h2 class=&quot;news-head&quot;&amp;gt;Andy wins an Oscar for his cameo in Iron Man&amp;lt;/h2&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;p class=&quot;news-text&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;Andy Budd wins the Oscar for best supporting actor in Iron Man&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;after his surprise cameo sets Hollywood a twitter with speculation.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;p class=&quot;news-text&quot;&amp;gt;&amp;lt;a href=&quot;news.php&quot; class=&quot;news-tink&quot;&amp;gt;More&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;In the preceding example, each element is identified as being part of a news story by using an individual news-related class name. This has been done to allow news headlines and text to be styled differently from the rest of the page. However, you don’t need all these extra classes to target each individual element. Instead, you can  identify the whole block as a news item by wrapping it in a div (code) with a class name of news. You can then target news headlines or text by simply using the cascade.&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;div class=&quot;news&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;h2&amp;gt;Andy wins an Oscar for his cameo in Iron Man &amp;lt;/h2&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;p&amp;gt;Andy Budd wins the Oscar for best supporting actor in Iron Man&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;after his surprise cameo sets Hollywood a twitter with speculation.&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;p&amp;gt;&amp;lt;a href=&quot;news.php&quot;&amp;gt;More&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Anytime you find yourself repeating words in your class names like news-head and news-link or section-head and section-foot, it would be worth looking to see if you can break those elements into their constituent parts. This makes your code much more componentized and hence much more flexible. &lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Removing extraneous classes in this way will help simplify your code and reduce page weight.I will discuss CSS selectors and targeting your styles shortly. However, this overreliance on class names is almost never necessary. If you find yourself adding lots of classes, it’s probably an indication that your HTML document is poorly structured.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrea-blogger-templates.blogspot.com/feeds/2393781671470201760/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/08/ids-or-classes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/2393781671470201760'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/2393781671470201760'/><link rel='alternate' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/08/ids-or-classes.html' title='IDs or Classes?'/><author><name>Andrea</name><uri>http://www.blogger.com/profile/03133301827360493806</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2210914315561174469.post-6601944342622099183</id><published>2012-08-29T17:27:00.002-07:00</published><updated>2012-08-29T23:41:35.941-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><category scheme="http://www.blogger.com/atom/ns#" term="Web design"/><title type='text'>Naming your elements</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;When naming your IDs and classes, it is important that you keep the names as “unpresentational” as possible. For instance, if you want all of your form notification messages to be red, you could give them a class of red. This is fine as long as there are no other red elements on the page. However, say you wanted to style required form labels red as well. You are now forced to guess to which element that class could refer, and things are already starting to get confusing. Imagine how confusing the code could become if you used presentational elements across the whole site? This gets even more complicated if you decide to change the presentation of your form notifications from red to yellow. Now, you either have to go back and change all your class names, or you have an element called red that looks yellow.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Instead, it makes sense to name your elements  based on what they are rather than how they look. That way your code will have more meaning and never go out of sync with your designs. So in the previous example, rather than giving your notifications a class of red, you should give them a more meaningful name like .warning or .notification (see Figure below). The great thing about meaningful class names is that you can reuse them across your site. For instance, you could also use the class of .notification on other types of messages, and style them completely differently based on where they are in the document.&lt;/div&gt;&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNXdueHUQQGJy5Syq59b3OiggqRFSUoja3EiguF3FoHb4gMDkPFc87HA5VsqvGj9yAK_OF__2buPBeOt0TvbDB8KwAet6VonCSsaalEB7yqDI65AmrbSzpZjwE6B7Ag9vqbYuCqNaCOAhv/s1600/css_good-names_bad-names.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot; css - Naming your elements&quot; border=&quot;0&quot; height=&quot;254&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNXdueHUQQGJy5Syq59b3OiggqRFSUoja3EiguF3FoHb4gMDkPFc87HA5VsqvGj9yAK_OF__2buPBeOt0TvbDB8KwAet6VonCSsaalEB7yqDI65AmrbSzpZjwE6B7Ag9vqbYuCqNaCOAhv/s400/css_good-names_bad-names.jpg&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;b&gt;Good and bad ID names&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrea-blogger-templates.blogspot.com/feeds/6601944342622099183/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/08/naming-your-elements.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/6601944342622099183'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/6601944342622099183'/><link rel='alternate' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/08/naming-your-elements.html' title='Naming your elements'/><author><name>Andrea</name><uri>http://www.blogger.com/profile/03133301827360493806</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNXdueHUQQGJy5Syq59b3OiggqRFSUoja3EiguF3FoHb4gMDkPFc87HA5VsqvGj9yAK_OF__2buPBeOt0TvbDB8KwAet6VonCSsaalEB7yqDI65AmrbSzpZjwE6B7Ag9vqbYuCqNaCOAhv/s72-c/css_good-names_bad-names.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2210914315561174469.post-5394435291475107461</id><published>2012-08-29T17:13:00.001-07:00</published><updated>2012-08-29T23:42:27.232-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><category scheme="http://www.blogger.com/atom/ns#" term="Web design"/><title type='text'>IDs and class names</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Meaningful elements provide an excellent foundation, but the list  of available elements isn’t exhaustive. HTML 4 was created as a simple document markup language rather than an interface language. Because of this, dedicated elements for  things such as content areas or navigation bars just don’t exist. You could create your  own elements using XML, but for reasons too complicated to go into, it’s not very practical.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;HTML 5 hopes to solve some of these problems by providing developers with a richer set of elements to work with. These include structural elements like header, nav, article, section, and footer as well as well as new UI features like data inputs and the menu element. In preparation for HTML 5, many developers have started adopting these as naming conventions for their ID and class names.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;The next best thing is to take existing elements and give them extra meaning with the addition of an ID or a class name. This adds additional structure to your document and provides useful hooks for your styles. So you could take a simple list of links, and by giving it an ID of nav, create your own custom navigation element.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;ul id=&quot;nav&quot;&amp;gt; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;li&amp;gt;&amp;lt;a href=&quot;/home/&quot;&amp;gt;Home&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;li&amp;gt;&amp;lt;a href=&quot;/about/&quot;&amp;gt;About Us&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;li&amp;gt;&amp;lt;a href=&quot;/contact/&quot;&amp;gt;Contact&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;An ID is used to identify a specific element, such as the site navigation, and must be unique to that page. IDs are useful for identifying persistent structural elements such as the main navigation or content areas. They are also useful for identifying one-off elements—a particular link or form element, for example.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;While a single ID name can only be applied to one element on a page, the same class name can be applied to any number of elements on a page. This makes classes much more powerful. Classes are useful for identifying types of content or similar items. For instance, you may have a page that contains multiple news stories.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;div id=&quot;story-id-1&quot;&amp;gt; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;h2&amp;gt;Salter Cane win Best British Newcomer award&amp;lt;/h2&amp;gt; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;p&amp;gt;In a surprise turn of events, alt folk group, Salter Cane, won&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;Best British Newcomer and the Grammys this week…&amp;lt;/p&amp;gt; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;lt;div id=&quot;story-id-2&quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;h2&amp;gt;Comic Sans: The Movie wins best documentary at the BAFTAs &amp;lt;/h2&amp;gt; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;p&amp;gt;The story of this beloved typeface one the best documentary&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;category. Director Richard Rutter was reported to be speechless…&amp;lt;/p&amp;gt; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Rather than giving each story a separate ID, you would give them all a class of news.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;div class=&quot;news&quot;&amp;gt; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;h2&amp;gt;Salter Cane win Best British Newcomer award&amp;lt;/h2&amp;gt; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;p&amp;gt;In a surprise turn of events, alt folk group, Salter Cane, won&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;Best British Newcomer and the Grammys this week…&amp;lt;/p&amp;gt; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;lt;div class=&quot;news&quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;h2&amp;gt;&quot;Comic Sans: The Movie&quot; wins best documentary at the BAFTAs &amp;lt;/h2&amp;gt; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;p&amp;gt;The story of this beloved typeface one the best documentary&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;category. Director Richard Rutter was reported to be speechless…&amp;lt;/p&amp;gt; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrea-blogger-templates.blogspot.com/feeds/5394435291475107461/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/08/ids-and-class-names.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/5394435291475107461'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/5394435291475107461'/><link rel='alternate' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/08/ids-and-class-names.html' title='IDs and class names'/><author><name>Andrea</name><uri>http://www.blogger.com/profile/03133301827360493806</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2210914315561174469.post-3884792969253262837</id><published>2012-08-29T16:54:00.001-07:00</published><updated>2012-08-29T23:43:01.344-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><category scheme="http://www.blogger.com/atom/ns#" term="Web design"/><title type='text'>The power of meaning </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Meaningful markup provides the developer with several important benefits. Meaningful pages are much easier to work with than presentational ones. For example, say you need to change a quotation on a page. If the quotation is marked up correctly, it is easy to scan through the code until you find the first  blockquote element. However, if the quotation is just another paragraph element, it will be a lot harder to find. For a more complicated, but no less realistic example, say that you needed to add an extra column to your homepage. You could simply drop the content in at the right point and then update the widths in your CSS. To do the same in a table-based layout you’d need to add an extra column in your table, change the colspan settings, alter the widths on all the cells, and change the widths of all your shim gifs. In effect, you’d have to change the entire structure of your page to accommodate this simple change.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;As well as being easy for humans to understand, meaningful markup—otherwise known as semantic markup—can be understood by programs and other devices. Search engines, for instance, can recognize a headline because it is wrapped in h1 tags and assign more importance to it. Screen reader users can rely on headings as supplemental page navigation.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Most importantly for the context of this book, meaningful markup provides you with a simple way of targeting the elements you wish to style.  It adds structure to a document and creates an underlying framework to build upon. You can style elements directly without needing to add other identifiers, and thus avoid unnecessary code bloat.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;HTML includes a rich variety of meaningful elements, such as&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;h1, h2, and so on&lt;/li&gt;
&lt;li&gt;ul, ol, and dl&lt;/li&gt;
&lt;li&gt;strong and em&lt;/li&gt;
&lt;li&gt;blockquote and cite&lt;/li&gt;
&lt;li&gt;abbr, acronym, and code&lt;/li&gt;
&lt;li&gt;fieldset, legend, and label&lt;/li&gt;
&lt;li&gt;caption, thead, tbody, and tfoot&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;As such, it is always a good idea to use an appropriate meaningful element where one exists.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Every few years the CSS versus tables argument  seems to flare up on blogs, mailing lists, or developer forums. The discussion is usually sparked when developers who have grown accustomed to the table-based approach rebel against the idea of having to learn a new skill. I can sympathies with this reaction, as CSS-based  layout does seem difficult at first, especially when your current process seems to work. However, the benefits of CSS have been debated numerous times and include things like less code bloat, faster downloads, and easier maintenance to name just three. Most professional developers have come to see the benefits of web standards, and it’s rare to see an agency of any size or quality doing things the old-fashioned way. So if you’re still using table based layout, you’re going to find it increasingly difficult to get work with agencies. Thankfully, these old habits are dying out, and there is a whole new generation of developers who have never had to suffer the inconvenience of table-based layout.&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrea-blogger-templates.blogspot.com/feeds/3884792969253262837/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/08/the-power-of-meaning.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/3884792969253262837'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2210914315561174469/posts/default/3884792969253262837'/><link rel='alternate' type='text/html' href='http://andrea-blogger-templates.blogspot.com/2012/08/the-power-of-meaning.html' title='The power of meaning '/><author><name>Andrea</name><uri>http://www.blogger.com/profile/03133301827360493806</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>