<?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>The Mac Attack</title>
	<atom:link href="http://themacattack.net/feed" rel="self" type="application/rss+xml" />
	<link>http://themacattack.net</link>
	<description>The Mac Attack</description>
	<lastBuildDate>Sat, 22 Oct 2011 00:10:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>A Look at Text-Level HTML Semantics</title>
		<link>http://themacattack.net/a-look-at-text-level-html-semantics</link>
		<comments>http://themacattack.net/a-look-at-text-level-html-semantics#comments</comments>
		<pubDate>Tue, 08 Mar 2011 06:42:40 +0000</pubDate>
		<dc:creator>The Mac Attack</dc:creator>
				<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://themacattack.net/?p=81</guid>
		<description><![CDATA[It&#8217;s amazing what you can discover by actually reading the W3C&#8217;s specification documents. I would assume that most web-developers-in-training actually don&#8217;t do this. It&#8217;s a shame though, as many other resources don&#8217;t give you the full picture on what the &#8230; <a href="http://themacattack.net/a-look-at-text-level-html-semantics">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s amazing what you can discover by actually reading the W3C&#8217;s specification documents. I would assume that most <i>web-developers-in-training</i> actually don&#8217;t do this. It&#8217;s a shame though, as many other resources don&#8217;t give you the full picture on what the capabilities of the HTML standard is.</p>
<p>I&#8217;ve been looking into text-level semantics recently, browsing over the relevant <a href="http://www.w3.org/TR/html5/text-level-semantics.html">HTML5 specification document</a>. As a result, I thought I&#8217;d share some information on text-level elements that you probably weren&#8217;t aware of.<span id="more-81"></span></p>
<h2 class="aboutTextSubHead">The <code>&lt;em&gt;</code> Element</h2>
<p>Knowing when to use <code>&lt;em&gt;</code> or <code>&lt;i&gt;</code> &#8211; and similarly, <code>&lt;strong&gt;</code> instead of <code>&lt;b&gt;</code> &#8211; can be somewhat confusing, and result in debate amongst developers. Many people act as if <code>&lt;i&gt;</code> and <code>&lt;b&gt;</code> are deprecated, and should be avoided. However, <em>they are far from deprecated</em>: each remains with its own distinct legitimate application that&#8217;s important to recognise.</p>
<p>Firstly, let&#8217;s consider the <code>&lt;em&gt;</code> element. <code>&lt;em&gt;</code> should be used for stress emphasis. Think of it as making a point or giving a particular impacted meaning to a word or phrase. The use of this changes the meaning of the enclosed text, but does not change the importance.</p>
<p>An example given by the W3C is refuting a claim made by someone else. Consider the following:<br />
<code><br />
&lt;p&gt;<br />
John said that our local government spending has has tripled over the past few years. &lt;em&gt;Spending has actually halfed!&lt;/em&gt;<br />
&lt;/p&gt;<br />
</code></p>
<p>The second sentence here has been stressed through the use of <code>&lt;em&gt;</code>. </p>
<p>Something you may not have known as well is that <strong><code>&lt;em&gt;</code>, amongst other text-level elements, can be nested</strong>. Consider the following:</p>
<p><code><br />
&lt;p&gt;<br />
John said that our local government spending has has tripled over the past few years. &lt;em&gt;Spending has actually &lt;em&gt;halfed&lt;/em&gt;!&lt;/em&gt;<br />
&lt;/p&gt;<br />
</code></p>
<p>In the above, because &#8216;halfed&#8217; has been encased in another <code>&lt;em&gt;</code> element, it receives additional emphasis. In terms of browser rending though, you&#8217;re unlikely to see a difference unless you specify what an <code>&lt;em&gt;</code> inside an <code>&lt;em&gt;</code> should look like in your CSS.</p>
<h2 class="aboutTextSubHead">The <code>&lt;i&gt;</code> Element</h2>
<p>The <code>&lt;em&gt;</code> element and <code>&lt;i&gt;</code> element are often confused, understandably, due to browsers rendering them both in italics as default. <code>&lt;i&gt;</code> should represent text that&#8217;s somehow in a different voice or mood from the surrounding text. It might be a technical term, a phrase from another language, a thought or anything else that&#8217;s typically emphasised.</p>
<p>Consider the following examples:<br />
<code><br />
&lt;p&gt;It has a certain &lt;i&gt;Je ne sais quoi&lt;/i&gt; to it, you could could say.&lt;/p&gt;<br />
&lt;p&gt;&lt;i&gt;Surely they weren't speaking about me&lt;/i&gt;, Jared thought.&lt;/p&gt;<br />
</code></p>
<p>You&#8217;ll notice in the above that the text encompassed in &lt;i&gt; holds a slightly different voice to the text around it, but does not place emphasis on the text.</p>
<h2 class="aboutTextSubHead">The <code>&lt;strong&gt;</code> Element</h2>
<p>To indicate strong importance of your text, <code>&lt;strong&gt;</code> should be used. Similarly to <code>&lt;em&gt;</code>, <code>&lt;strong&gt;</code> can also be nested to add additional importance to a piece of text that’s already strong. Consider the following:</p>
<p><code><br />
&lt;strong&gt;Warning: this substance is &lt;strong&gt;highly corrosive&lt;/strong&gt;.&lt;/strong&gt;<br />
</code></p>
<p>In this example &#8216;highly corrosive&#8217; carries additional importance in an already important piece of text.</p>
<p>Note that unlike <code>&lt;em&gt;</code>, <code>&lt;strong&gt;</code> does not change the meaning of a sentence.</p>
<h2 class="aboutTextSubHead">The <code>&lt;b&gt;</code> Element</h2>
<p>Like the relationship between the <code>&lt;em&gt;</code> and <code>&lt;i&gt;</code> elements, the use of <code>&lt;b&gt;</code> is often debated against <code>&lt;strong&gt;</code>.</p>
<p>The <code>&lt;b&gt;</code> elements should be used to indicate text that is stylistically offset from surrounding text, without adding extra importance. You might use it to stylistically mark the first paragraph of a news item or indicate a product name, as in the example below:</p>
<p><code><br />
&lt;p&gt;My favourite movie of all time is &lt;b&gt;Citizen Kane&lt;/b&gt;.<br />
</code></p>
<p><code>&lt;b&gt;</code> is only recommended to be used a last resort, where no other element is appropriate. </p>
<p>The question remains though: if <code>&lt;b&gt;</code> is purely about making some kind of presentational change, why does it even exist? Could the same effect not be achieved by using a <code>&lt;span&gt;</code> and associated CSS?</p>
<p>I don&#8217;t have an official answer on the issue, but my thinking is this: screen readers and the like would still need some way to identify this text as being different from the text that surrounds it. <code>&lt;span&gt;</code> carries no meaning with it, and so a screen reader would not know that the text inside is any different: using <code>&lt;b&gt;</code> however, the difference will be indicated.</p>
<h2 class="aboutTextSubHead">The <code>&lt;small&gt;</code> Element</h2>
<p>The <code>&lt;small&gt;</code> element should be used for side comments: like the name suggests, think of it as being like the &#8216;small print&#8217;. Note that if this is used within <code>&lt;em&gt;</code> or <code>&lt;strong&gt;</code>, it won&#8217;t affect their emphasis or importance.</p>
<h2 class="aboutTextSubHead">The <code>&lt;s&gt;</code> Element</h2>
<p>The <code>&lt;s&gt;</code> element should be used to indicate information that is no longer accurate or relevant. It&#8217;s important to note though it does not represent a document edit (as <code>&lt;del&gt;</code> and <code>&lt;ins&gt;</code> would do). A common example might be a change in price of a product.</p>
<h2 class="aboutTextSubHead">The <code>&lt;cite&gt;</code> Element</h2>
<p><code>&lt;cite&gt;</code> can be used to indicate the title of a work. The text within <code>&lt;cite&gt;</code> should be the exact name of the referenced work e.g. <code>&lt;cite&gt;HTML&gt;</code> rather than <code>&lt;cite&gt;Wikipedia's article on HTML&lt;/cite&gt;</code>.</p>
<p>It&#8217;s important to note that <code>&lt;cite&gt;</code> should not be used on a person’s name (e.g. an author of a book), and nor should it be used for quotes (<code>&lt;q&gt;</code> should be used in that case). To mark a person’s name along with <code>&lt;cite&gt;</code>, the W3C suggests using the <code>&lt;b&gt;</code> element.</p>
<h2 class="aboutTextSubHead">The <code>&lt;q&gt;</code> Element</h2>
<p>The <code>&lt;q&gt;</code> element can be used to indicate quotes that originate from another source. If you&#8217;re going to use this, <em>be sure <em>not</em> to include the quotation marks</em> one would normally write. The browser will output these for you.</p>
<p>The element comes with a <code>cite</code> attribute that can be used to indicate the source of the quote. This should be a URL to the source.</p>
<p>Quotes can be used within quotes. Consider the following:</p>
<p><code><br />
&lt;p&gt;My uncle once said &lt;q&gt;a man is someone who can stand up and say &lt;q&gt;I am indeed a man&lt;/q&gt;&lt;/q&gt;&lt;p&gt;<br />
</code></p>
<p>In the above, the inner set of quotes will be presented with single quotation marks, whilst the outer uses double quotation marks, as a default.</p>
<h2 class="aboutTextSubHead">The <code>&lt;dfn&gt;</code> Element</h2>
<p>In your text, if you&#8217;re defining a term (giving meaning to some terminology), you can use the <code>&lt;dfn&gt;</code> element to indicate which term is being defined in your text. The meaning should be given in the text that follows.</p>
<p><code><br />
&lt;p&gt;In music, &lt;dfn&gt;scherzando&lt;/dfn&gt; means to perform lively and playfully.&lt;/p&gt;<br />
</code></p>
<p>In the example above the term is indicated, and then immediately defined afterwards.</p>
<h2 class="aboutTextSubHead">The <code>&lt;abbr&gt;</code> Element</h2>
<p>This element is now a catch-all for indicating abbreviations, initialisms and acronyms. Acronyms are now included here rather than <code>&lt;acronym&gt;</code> as they were thought to be too confusing for developers to use correctly.</p>
<p>A <code>title</code> attribute can be used to indicate the full text that has been shortened, as in the following example:</p>
<p><code><br />
&lt;p&gt;My main area of expertise is &lt;abbr title="HyperText Markup Language"&gt;HTML&lt;/abbr&gt;.&lt;/p&gt;<br />
</code></p>
<h2 class="aboutTextSubHead">The <code>&lt;time&gt;</code> Element</h2>
<p>One of the elements new to HTML5, &lt;time&gt; is used for indicating precise dates. It cannot be used to indicate inexact time periods e.g. the Mesozoic Era, the 90s, or &#8216;Yesterday&#8217;.</p>
<p>I would recommend looking at the specification on <a href="http://www.w3.org/TR/html5/text-level-semantics.html#the-time-element"><code>&lt;time&gt;</code></a> to get a further understanding of it&#8217;s use.</p>
<h2 class="aboutTextSubHead">The <code>&lt;code&gt;</code> Element</h2>
<p><code>&lt;code&gt;</code> can be used to represent a fragment of computer code. It could an actual snippet of code, or even something like a HTML tag, a file name, a computer program or anything else a computer might recognise. For example, you might represent a <code>&lt;div&gt;</code> tag as <code>&lt;code&gt;&lt;div&gt;&lt;/code&gt;</code>.</p>
<p>Should you be indicating something programmed in a particular language, there is no formal way of indicating what language that is.</p>
<h2 class="aboutTextSubHead">The <code>&lt;var&gt;</code> Element</h2>
<p>A variable can be represented by the <code>&lt;var&gt;</code> element. It can be a mathematical variable, a programmatic variable, or anything else that might be a placeholder e.g. <code>We're going to meet at the &lt;var&gt;XYZ Company&lt;/var&gt; offices</code>.</p>
<h2 class="aboutTextSubHead">The <code>&lt;samp&gt;</code> Element</h2>
<p><code>&lt;samp&gt;</code> represents sample output from a program or computer system e.g. <code>the browser read &lt;samp&gt;HTTP 404: Not Found&lt;/samp&gt;</code>.</p>
<h2 class="aboutTextSubHead">The <code>&lt;kbd&gt;</code> Element</h2>
<p><code>&lt;kbd&gt;</code> can be used to represent user input &#8211; it is not restricted to keyboard input however, as voice input, and a sequence of mouse clicks might also be acceptable.</p>
<p>When used inside <code>&lt;samp&gt;</code>, <code>&lt;kbd&gt;</code> will represent input that was given by the user, and then outputted back to them in some form. <code>&lt;kbd&gt;</code> can be nested: doing so represents a single unit of input or a key e.g. <code>&lt;kbd&gt;&lt;kbd&gt;F12&lt;/kbd&gt;&lt;/kbd&gt;</code>.</p>
<h2 class="aboutTextSubHead">The <code>&lt;sup&gt;</code> and <code>&lt;sub&gt;</code> Elements</h2>
<p>These represent superscript and subscript respectively. There&#8217;s not much to speak of with these, but take care to avoid using them as a means of achieving an inappropriate presentational effect.</p>
<h2 class="aboutTextSubHead">The <code>&lt;mark&gt;</code> Element</h2>
<p>The <code>&lt;mark&gt;</code> element can be used to indicate text that&#8217;s marked or highlighted for reference purposes. The marked text should be relevant in some other context than that of the presented text. It should be something that has relevancy to the current user in an outside context.</p>
<p>An example might be indicating search terms in a document the user searched for. When used in combination with a quote, it indicates something that wasn&#8217;t originally marked and may be under scrutiny.</p>
<h2 class="aboutTextSubHead">The <code>&lt;bdi&gt;</code> and <code>&lt;bdo&gt;</code> Elements</h2>
<p>The <code>&lt;bdi&gt;</code> element is used to hold text isolated from its surroundings, which could be either in a left-to-right format, or in a right-to-left format e.g. in Arabic. <code>&lt;bdi&gt;</code> is useful when working with user-generated content that could go in either direction.</p>
<p><code>&lt;bdo&gt;</code> is similarly used for text direction, yet explicitly indicates the direction through its DIR attribute (values &#8216;ltr&#8217; or &#8216;rtl&#8217;).</p>
<h2 class="aboutTextSubHead">The <code>&lt;br&gt;</code> Element</h2>
<p>The <code>&lt;br&gt;</code> element is quite well known as representing a line break. However, something interesting to note here is that the styles for this can theoritically be overwritten so that the browser renders this &#8216;line break&#8217; in a different way e.g. just by generating a space.</p>
<h2 class="aboutTextSubHead">The <code>&lt;wbr&gt;</code> Element</h2>
<p>This element indicates acceptable places within a word that the browser can break a line at. Consider the example below:</p>
<p><code><br />
Super&lt;wbr&gt;cali&lt;wbr&gt;fragilistic&lt;wbr&gt;expialidocious<br />
</code></p>
<p>Should the browser not have the necessary space to fully output the word within one line, it can carry the word over in to the next line at any of the opportunities marked with <code>&lt;wbr&gt;</code>.</p>
<h2 class="aboutTextSubHead">In Closing</h2>
<p>Even though many of these elements have existed for quite a while, it&#8217;s only now that we&#8217;re starting to take note of the significance of semantic markup. Knowing the above will hopefully allow you to make some smarter choices when marking up your content and help contribute to the <a href="http://en.wikipedia.org/wiki/Semantic_Web">Semantic Web</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://themacattack.net/a-look-at-text-level-html-semantics/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Conditional Comments Quick Tip</title>
		<link>http://themacattack.net/conditional-comments-quick-tip</link>
		<comments>http://themacattack.net/conditional-comments-quick-tip#comments</comments>
		<pubDate>Sun, 27 Feb 2011 01:09:01 +0000</pubDate>
		<dc:creator>The Mac Attack</dc:creator>
				<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://themacattack.net/?p=65</guid>
		<description><![CDATA[Many web developers are already aware of conditional comments. These forms of comments within HTML allow developers to cater content to specific versions of Internet Explorer, thus allowing them to overcome some of the rendering bugs found in the likes &#8230; <a href="http://themacattack.net/conditional-comments-quick-tip">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Many web developers are already aware of <a href="http://www.quirksmode.org/css/condcom.html">conditional comments</a>. These forms of comments within HTML allow developers to cater content to specific versions of Internet Explorer, thus allowing them to overcome some of the rendering bugs found in the likes of IE7 and IE6. And yet, are developers using these comments appropriately?<span id="more-65"></span></p>
<p>The answer in most cases I&#8217;ve seen is yes, but in some cases the implementations haven&#8217;t been particularly forward thinking.</p>
<p>My recommended best practice with conditional comments is to <strong>always specify particular IE versions</strong>. The following is an example of a conditional comment implementation I&#8217;ve seen on a few sites recently:<br />
<code><br />
&lt;!--[if IE]&gt;<br />
	&lt;link rel="stylesheet" type="text/css" href="iestyles.css" /&gt;<br />
&lt;![endif]--&gt;<br />
</code></p>
<p>The above will add all the styles from iestyles.css into the page for any user using Internet Explorer. This is a poor implementation as it assumes that Internet Explorer will never change. Even with the many rendering improvements with Internet Explorer 9, users will still have the additional rules from iestyles.css used on the page. This can create an undesired effect e.g. a padding specification might be double what it was intended.</p>
<p>A more recommended implementation would be something like this:<br />
<code><br />
&lt;!--[if lte IE 8]><br />
	&lt;link rel="stylesheet" type="text/css" href="iestyles.css" /&gt;<br />
&lt;![endif]--><br />
</code></p>
<p>The above would only use the extra stylesheet if the IE vesion is less than or equal to version 8.</p>
<p>Therefore, to summarise, don&#8217;t assume that IE rendering behavior will remain a constant: use conditional comments that specify versions to ensure your website is prepared for a better future.</p>
]]></content:encoded>
			<wfw:commentRss>http://themacattack.net/conditional-comments-quick-tip/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Another WordPress Blog</title>
		<link>http://themacattack.net/wordpress-blog1</link>
		<comments>http://themacattack.net/wordpress-blog1#comments</comments>
		<pubDate>Thu, 17 Feb 2011 06:14:24 +0000</pubDate>
		<dc:creator>The Mac Attack</dc:creator>
				<category><![CDATA[Site News]]></category>

		<guid isPermaLink="false">http://themacattack.net/?p=58</guid>
		<description><![CDATA[A blog? What on earth is this doing here?? <a href="http://themacattack.net/wordpress-blog1">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Welcome to my blog! I say that with some reluctance however, as I know that the only people visiting this page at the moment would be crawlers, and a few potential employers wanting to see what I&#8217;m up to.</p>
<p>Nevertheless, I thought I&#8217;d take the opportunity to explain why this thing&#8217;s actually here&#8230;</p>
<p><span id="more-58"></span>This blog is intended to be an all-encompassing publishing mechanism to accompany my personal website. Being a front end web developer, you&#8217;ll see me cover related topics such as HTML, CSS and JavaScript. I&#8217;ll discuss concepts such as best practice and provide examples of some cool little things I think up of.</p>
<p>I do have other areas of interest and expertise however, so don&#8217;t be surprised if you see me post about music composition, or Microsoft Excel (I&#8217;ve got a project I&#8217;ve been sitting on involving both of these things incidentally).</p>
<p>This is actually my first foray into the world of blogging, so setting up WordPress has been a bit of an adventure for me. It seems to hold many of the traits that often irk me about CMSs in general: bloated and confusing styles/files for something that should be relatively simple.</p>
<p>I&#8217;ll (word)press forward however and make some gradual changes to the blog as I become more accustomed to it. This includes enabling comments in future posts.</p>
<p>This is the humble start, but it is a start nonetheless.</p>
]]></content:encoded>
			<wfw:commentRss>http://themacattack.net/wordpress-blog1/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

