<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Atlantic BT &#187; CSS</title>
	<atom:link href="http://www.atlanticbt.com/blog/tag/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.atlanticbt.com/blog</link>
	<description>Our Thoughts</description>
	<lastBuildDate>Fri, 03 Sep 2010 14:24:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Beyond HTML 5 and CSS 3: Sample of Suggestions</title>
		<link>http://www.atlanticbt.com/blog/beyond-html-5-and-css-3-sample-of-suggestions/</link>
		<comments>http://www.atlanticbt.com/blog/beyond-html-5-and-css-3-sample-of-suggestions/#comments</comments>
		<pubDate>Tue, 12 May 2009 17:03:15 +0000</pubDate>
		<dc:creator>Mark Caron</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS 3]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[microformats]]></category>
		<category><![CDATA[W3C]]></category>
		<category><![CDATA[Web Standards]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://74.84.218.58/blog/?p=205</guid>
		<description><![CDATA[Since HTML 5 and CSS 3 are still in the working drafts, I thought I would propose a few ideas I&#8217;ve been cooking up that would make my life easier and perhaps add an edge to the constantly evolving standards. Although, I hope these ideas never become a piece of proprietary junk that Internet Explorer [...]]]></description>
			<content:encoded><![CDATA[<p>Since <acronym title="HyperText Mark-up Language">HTML</acronym> 5 and <a href="http://www.w3.org/TR/css3-roadmap/"><acronym title="Cascading Style Sheets">CSS</acronym> 3</a> are still in the working drafts, I thought I would propose a few ideas I&#8217;ve been cooking up that would make my life easier and perhaps add an edge to the constantly evolving standards. Although, I hope these ideas never become a piece of proprietary junk that Internet Explorer or Mozilla latches onto on their own. I would hate to aid non-standards.</p>
<p>I realize some of my ideas may go beyond the so-called &#8220;scope&#8221; of the original intentions of CSS and HTML/<abbr title="Extensible Hypertext Markup Language">XHTML</abbr>. But my hope, like all &#8220;<dfn title="A web developer who is actively involved in the creation, adoption, and/or promotion of web standards." (Source: Wikipedia - slang term)">standardistas</dfn>,&#8221; is to get a focused set of standards for all browsers to comply with (does such a Utopia exist?) and for these standards to give more power to semantic markup and provide more advantages to CSS.</p>
<p>I&#8217;ll begin with HTML first, since semantic markup is the most important:</p>
<h4>1. Custom Elements</h4>
<p>I&#8217;ve read some of the <a href="http://www.w3.org/TR/html5/">working draft for HTML 5</a> and I must say that I&#8217;m impressed with some of the ideas that have been added. It&#8217;s going to give more meaning to HTML code, which is precisely what web developers need! However, I did cringe at the proposed &#8220;header&#8221; and &#8220;footer&#8221; elements. I understand their purpose, but aren&#8217;t the words header and footer presentational? For instance, what if at first I designed the footer to be at the bottom of the document. In the markup, perhaps it is. But later (for some odd reason) the client decides he/she wants that info to be moved to the top? Would this still be considered the &#8220;footer?&#8221; I&#8217;m sure there are several sides to the argument, but I&#8217;ve also read accounts where people like Andy Clarke have <a href="http://forabeautifulweb.com/blog/about/more_on_developing_naming_conventions_microformats_and_html5/">proposed the same</a>. Footers should be &#8220;siteinfo&#8221; and headers should be &#8220;branding&#8221; or &#8220;masthead.&#8221; In contrast, Dan Cederholm and Andy Budd still use &#8220;header&#8221; and &#8220;footer&#8221; on their personal sites. But regardless of who uses what, I still feel these names are presentational and HTML is for content not for its appearance or layout.</p>
<p>I really like most of the other elements like &#8220;menu,&#8221; &#8220;section,&#8221; &#8220;dialog,&#8221; &#8220;aside,&#8221; &#8220;datagrid,&#8221; etc. They really give more meaning to the markup in place of the generic div&#8217;s with id&#8217;s. This will definitely give more power to CSS and more meaning to the document at the same time. Specifically it allows you to separate your styles with semantic element names and giving them unique rules with really low specificity instead of making them arbitrary div&#8217;s. Simply put, this will give you more control with id&#8217;s when they&#8217;re needed.</p>
<p>But what I&#8217;m proposing is that instead of giving set element names that will always be debated on their semantic merit, why not give that power over to the developer? If a developer could declare his/her own elements in the head of the document, he/she could have more control. I envision it working something like this:</p>
<pre><code>
		&lt;head&gt;
			&lt;elements type="elements/text"&gt;
				section : div;
				dialog : div;
				menu : ul;
				masthead : div;
				<em>newelementname : baseelementbehavior;</em>
			&lt;/elements&gt;
		&lt;/head&gt;

				</code></pre>
<p>In this element named &#8220;elements&#8221; the code would be handled by the browser. It would read each line, separated by a semi-colon, and take note of the custom elements being declared and determine their base behavior off of the base element listed after the colon. For instance, the first custom item &#8220;section&#8221; would behave like a &#8220;div.&#8221; This would give ultimate control to the developer to make his/her document follow its purpose semantically. This will also open up the possibilities for more <a href="http://www.microformats.org">microformats</a>! A developer could utilize this to create &lt;tel&gt; elements, &lt;adr&gt; elements, &lt;product&gt; elements, and more, replacing the annoying &lt;div class=&#8221;product&#8221;&gt; and more nested, loosely based &#8220;classitis.&#8221;</p>
<h4>2. Definition List Item</h4>
<p><del>I can&#8217;t recall where I saw the &lt;di&gt; element once, but I&#8217;ve been unable to relocate it through my web searches.</del><ins><a href="http://www.w3.org/TR/xhtml2/mod-list.html#edef_list_di">XHTML 2&#8242;s working draft describes a definition list item</a>,</ins> but I wonder why this element is still not supported well, if at all. And I didn&#8217;t see any proposed plans for it in the HTML 5 working drafts. I feel that this would be a good addition because it provides one more &#8220;hook&#8221; for styling and more meaning as well. The definition item would separate definition terms and their descriptions from others. If I was creating a list of definitions, each term and its description or descriptions should be separated logically from its siblings. Thus the &lt;di&gt; element would encase and separate each item.</p>
<h4>3. CSS Snap Declaration</h4>
<p>My third proposal is for a CSS 3 style declaration called &#8220;snap.&#8221; This can replace the need to use javascript to snap elements to non-parental elements. This &#8220;snapping&#8221; has been done via javascript on many old versions of dropdown menus. Now with CSS and better standards, the snap is no longer needed for menus. But the need for snap in other presentational ways is still warranted. What if I wanted to &#8220;snap&#8221; one element in the lower portion of the document to another element that was completely unrelated? I could simply add it to the style rule:</p>
<pre><code>
		#snapping-element {
			display: block;
			width: 300px;
			<strong>snap: #host-element;</strong>
			left: 0; top: 10px;
			…
		}
				</code></pre>
<p>In this example, the element with the id &#8220;snapping-element&#8221; will be snapped to the element with the id of &#8220;host-element.&#8221; Host-element, however, probably should be positioned relative; and the snapping-element&#8217;s position will be based off host-element&#8217;s relative state. Much like how absolute works, except that absolute is limited to basing itself off of ancestral elements.</p>
<h4>4. Column Hovers</h4>
<p>Placing a hover on a table row is a cinch. But what if I wanted to create a triangulation effect for the rows and columns with a different hover state color? I can&#8217;t! I&#8217;ve seen others mention it in posts, but I haven&#8217;t seen any plans to integrate this into CSS. Why not? This would provide another layer of accessibility/legibility to users with a simple col:hover rule. Of course the colgroup elements must all be declared in order for this to work.</p>
<h4>5. Javascript-type Psuedo-classes</h4>
<p>My last proposal to CSS 3 is probably the most CSS-scope-defying of them all. What if there were more pseudo-classes available other than just visited, hover, active, focus, etc? Why not onclick? I realize focus is currently a bit of a Mozilla proprietary state, but it&#8217;s a really good one! If javascript already handles onmouseover (hover) and onblur and onfocus (focus), why not onclick?! Man would this be powerful! All javascript toggling could be handled in CSS! But this event catching is a bit more daring for CSS&#8217;s scope of just styling. But why not, eh?</p>
<h4>Conclusion</h4>
<p>Perhaps some of this has been mentioned before me. I&#8217;m not sure. If not, then I&#8217;m glad to be able to provide some recommendations. If so, I apologize for assuming credit, that&#8217;s not my intention. I do however feel that these would provide a lot more meaning to HTML 5 and more power and control for the visual and presentational experience to CSS 3.</p>
<p>Any comments, suggestions, critiques are happily welcomed. Just some food for thought.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.atlanticbt.com/blog/beyond-html-5-and-css-3-sample-of-suggestions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS 2.1 Selector Specificity</title>
		<link>http://www.atlanticbt.com/blog/css-21-selector-specificity/</link>
		<comments>http://www.atlanticbt.com/blog/css-21-selector-specificity/#comments</comments>
		<pubDate>Fri, 08 May 2009 12:46:40 +0000</pubDate>
		<dc:creator>Mark Caron</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[specificity]]></category>

		<guid isPermaLink="false">http://74.84.218.58/blog/?p=202</guid>
		<description><![CDATA[I&#8217;m probably the 100th person to write about CSS 2.1&#8242;s selector specificity, but I&#8217;m going to take a stab at it anyway since it seems to be such a stumbling block for so many people. I&#8217;m not writing this to take away from the brilliant explanations of Andy Clarke, Patrick Griffiths, Eric Meyer, or Molly [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m probably the 100th person to write about CSS 2.1&#8242;s selector specificity, but I&#8217;m going to take a stab at it anyway since it seems to be such a stumbling block for so many people.</p>
<div id="attachment_246" class="wp-caption alignright" style="width: 310px"><a href="http://www.stuffandnonsense.co.uk/archives/css_specificity_wars.html"><img class="size-medium wp-image-246" title="specificitywars-04" src="http://74.84.218.58/blog/wp-content/uploads/2009/04/specificitywars-04-300x300.jpg" alt="Specificity Wars by Andy Clarke" width="300" height="300" /></a><p class="wp-caption-text">Specificity Wars by Andy Clarke</p></div>
<p>I&#8217;m not writing this to take away from the brilliant explanations of <a href="http://www.stuffandnonsense.co.uk/archives/css_specificity_wars.html">Andy Clarke</a>, <a href="http://www.htmldog.com/guides/cssadvanced/specificity/">Patrick Griffiths</a>, <a href="http://meyerweb.com/eric/css/link-specificity.html">Eric Meyer</a>, or <a href="http://www.molly.com/2005/10/06/css2-and-css21-specificity-clarified/">Molly E. Holzschlag</a>, but to merely supplement their posts with, perhaps, another angle. Many people feel the need to re-explain this topic in layman&#8217;s terms rather than enduring <a href="http://www.w3.org/TR/CSS21/cascade.html#specificity">W3C&#8217;s overly technical explanation about specificity</a>.</p>
<h3>What is specificity?</h3>
<p>To be brief, it&#8217;s the applied calculation of the priorities of CSS selectors and how they cascade through a stylesheet. Simply put, selectors with a higher specificity will overrule other selectors in the <a href="http://www.w3.org/TR/REC-CSS2/cascade.html#cascading-order">cascading order</a>.</p>
<h3>How it works</h3>
<p>There are two ways to determine specificity — the &#8220;right&#8221; way and the &#8220;quick and dirty&#8221; way. According to W3C, the specificity is officially calculated using four numbers concatenated, like: <code>a</code>, <code>b</code>, <code>c</code>, <code>d</code> . The &#8220;quick and dirty&#8221; technique is to assign values to each type of selector and add the values up. For example, general elements have a value of 1, classes have a value of 10, ID&#8217;s have a value of 100, and inline styles have a value of 1000. However, this value-based &#8220;quick addition&#8221; technique is a bit misleading because it presumes that 10 of any value will override the next highest selector. Following that logic if you have 10 ID&#8217;s in a style declaration those will override an inline style, because 10 ID&#8217;s are worth 100 x 10 which equals 1000 — inline styles being worth 1000. <strong>This statement is far from true.</strong> However, it can still be used as an easy way to get an idea of the specificity of a particular selector in a declaration; but it should never be fully relied upon.</p>
<p>The <a href="http://www.w3.org/TR/CSS21/cascade.html#specificity"><cite id="w3c">W3C</cite></a> states that <q cite="w3c">Concatenating the four numbers a-b-c-d (in a number system with a large base) gives the specificity.</q> <strong>This is the correct method to rely on</strong>. The reason is because it separates the values into 4 categories: <code>a</code>, <code>b</code>, <code>c</code>, &amp; <code>d</code>. The variable <code>a</code> is reserved for the number of inline styles and has the highest priority. While <code>b</code> is for the number of ID&#8217;s, <code>c</code> is for the number of other attributes (including class, but not ID&#8217;s) and pseudo-classes, and <code>d</code> is the number of elements. This is the correct order of specificity and pseudo-elements are to be ignored.</p>
<p>Let&#8217;s focus on <code>b</code> and <code>c</code> since these are the subjects of confusion. ID selectors (<code>b</code>)  are the most valuable asset to CSS, so they are given the second highest priority, next to inline styles (<code>a</code>). ID selectors are written with a # in front of the name given to the ID. So, <code>#content</code> is referencing <code>&lt;div id="content"&gt; which</code> has a value of 100 using the &#8220;quick and dirty&#8221; method. These selectors, like all selectors, can be used in combination with any other selectors. For instance, <code>#main-area #content</code> would add up to 200.</p>
<p>Class selectors and other attribute selectors are assigned the variable <code>c</code>. These are each given a value of 10 using the &#8220;quick and dirty&#8221; method. Class selectors are denoted with a dot (.) before the name of the class, like <code>.box</code>. Attribute selectors are declared with the attribute name inside a set of brackets — <code>a[rel="friend"]</code>. It is not necessary to include the value of the attribute. Additionally, the <code>=</code> can be replaced with <code>~=</code>, <code>*=</code>, <code>^=</code>, or <code>$=</code> depending on how you&#8217;re equating the value. A better concept of these equations can be found on <a href="http://www.456bereastreet.com/archive/200601/css_3_selectors_explained/">456 Berea St&#8217;s CSS 3 selectors explained</a> post.</p>
<p><em>Note: Attribute selectors of CSS 2.1 are supported by most modern browsers, and when I say modern browsers I do not mean Internet Explorer 6. </em></p>
<p>Initially what confused me about attribute selectors and their specificity was whether or not  using <code>class=</code> or <code>id=</code> in the attribute selector made it behave like the <code>#</code> (ID) or <code>.</code> (class) of its CSS 2 predecessors. After doing some testing and reading, I found that the attribute selector has the exact same specificity as the class selector (.), regardless of whether it says <code>id=</code> within its little brackets. It will always have a value of 10. Thus, <code>div[id="content"]</code> is less specific than <code>div#content</code>.</p>
<p>Here&#8217;s an easy way to visualize all of this (in a poorly misunderstood table element):</p>
<table border="0" summary="This table illustrates the specificity of the examples">
<thead>
<tr>
<th id="th-example">example</th>
<th id="th-style">inline <code>style</code></th>
<th id="th-id-select">ID selectors</th>
<th id="th-class-select">class/attribute selectors</th>
<th id="th-element-select">element/type selectors</th>
<th id="th-quick-add">&#8220;quick and dirty&#8221; value</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>style=""</code></td>
<td>1,</td>
<td>0,</td>
<td>0,</td>
<td>0</td>
<td>1000</td>
</tr>
<tr>
<td><code>p</code></td>
<td>0,</td>
<td>0,</td>
<td>0,</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td><code>p em<br />
</code></td>
<td>0,</td>
<td>0,</td>
<td>0,</td>
<td>2</td>
<td>2</td>
</tr>
<tr>
<td><code>p.whatever</code></td>
<td>0,</td>
<td>0,</td>
<td>1,</td>
<td>1</td>
<td>11</td>
</tr>
<tr>
<td><code>p[id="whatever"]</code></td>
<td>0,</td>
<td>0,</td>
<td>1,</td>
<td>1</td>
<td>11</td>
</tr>
<tr>
<td><code>p[href="whatever"]</code></td>
<td>0,</td>
<td>0,</td>
<td>1,</td>
<td>1</td>
<td>11</td>
</tr>
<tr>
<td><code>#whatever p</code></td>
<td>0,</td>
<td>1,</td>
<td>0,</td>
<td>1</td>
<td>101</td>
</tr>
<tr>
<td><code>#whatever p.whatever</code></td>
<td>0,</td>
<td>1,</td>
<td>1,</td>
<td>1</td>
<td>111</td>
</tr>
<tr>
<td><code>#whatever1 #whatever2 p.whatever</code></td>
<td>0,</td>
<td>2,</td>
<td>1,</td>
<td>1</td>
<td>211</td>
</tr>
</tbody>
</table>
<p>If you haven&#8217;t seen any specificity charts before I hope my interpretation helped explain it further. Be sure to check out the other explanations too, because <a href="http://www.stuffandnonsense.co.uk/archives/css_specificity_wars.html">Andy Clarke</a> has an awesome example using siths from Star Wars. Maybe I&#8217;ll make a diagram of my own someday.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.atlanticbt.com/blog/css-21-selector-specificity/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
