<?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>Andrew Jaswa &#187; markup</title>
	<atom:link href="http://andrewjaswa.com/tag/markup/feed/" rel="self" type="application/rss+xml" />
	<link>http://andrewjaswa.com</link>
	<description>I build crappy websites every day!</description>
	<lastBuildDate>Thu, 14 May 2009 03:36:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Markup Conditionals</title>
		<link>http://andrewjaswa.com/2009/05/markup-conditionals/</link>
		<comments>http://andrewjaswa.com/2009/05/markup-conditionals/#comments</comments>
		<pubDate>Wed, 13 May 2009 22:30:03 +0000</pubDate>
		<dc:creator>ajaswa</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[websites]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[markup]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://andrewjaswa.com/?p=352</guid>
		<description><![CDATA[I loathe conditional comments and browser targeted code. But there comes a time when you have to support an old and out dated browser (I&#8217;m looking in the direction of IE6 at the moment). So what do you do? You have to make it look the same and function the same as other browsers. You [...]]]></description>
			<content:encoded><![CDATA[<p>I loathe conditional comments and browser targeted code. But there comes a time when you have to support an old and out dated browser (I&#8217;m looking in the direction of IE6 at the moment). So what do you do? You have to make it look the same and function the same as other browsers. You also shouldn&#8217;t use browser hacks to target them. I&#8217;ve touched on this subject before and figured <a href="http://andrewjaswa.com/2008/06/un-conditionalun-conditional/">conditional comments were the best route to go</a>. Even if I don&#8217;t like them. </p>
<p>I&#8217;ve recently started working with a new company and have picked up on some of the bright things they do. I&#8217;m not sure why I never thought of this before since it seems so simple (and I can&#8217;t take credit for it).  </p>
<p>Let say you have your standard body element and a few other things on a page:</p>
<pre><code>&lt;body&gt;
    &lt;div&gt;
        &lt;p&gt;Some text&lt;/p&gt;
    &lt;/div&gt;
&lt;/body&gt;</code></pre>
<p>Typically to target the paragraph element for, say IE6, you might use a simple hack like the underscore hack. So you might write some CSS like so:</p>
<pre><code>p {
    width:150px;
    _width:200px;
}</code></pre>
<p>I mean you might do that, some other hack or you might use conditional comments to provide a style sheet just for IE6. I&#8217;m sure you&#8217;ve seen code like this before:</p>
<pre><code>&lt;!--[if IE 6]&gt;
    &lt;link rel="stylesheet" type="text/css"
       href="ie6.css" /&gt;
&lt;![endif]--&gt;</code></pre>
<p>That&#8217;s all fine and dandy, but do you see what you did there? I did and I don&#8217;t like it. You&#8217;ve just created another HTTP request. Shame on you. And to think about how many CSS rules are typically in a file like that? 10? 50? It also creates a maintenance headache. You&#8217;ve now split up rules for one element into two files. Yes yes I know that is what the cascade is for&#8230; But you could make it easier on yourself and people that come behind you. </p>
<p>What I&#8217;ve found is to use conditional comments to specify a class on the body element when the browser is IE6 or 7 or even 8. </p>
<p>So taking our markup example from above I&#8217;ve modified it to have conditional comments in it:</p>
<pre><code>&lt;!--[if IE 6]&gt;&lt;body class="IE6"&gt;&lt;![endif]--&gt;
&lt;!--[if !IE ]&gt;&lt;!--&gt;&lt;body&gt;&lt;!--&lt;![endif]--&gt;
    &lt;div&gt;
        &lt;p&gt;Some text&lt;/p&gt;
    &lt;/div&gt;
&lt;/body&gt;</code></pre>
<p>You&#8217;ll need all those extra comments to make the page valid. It is also pretty easy to add as many combinations as you like as long as they can be read by the browsers&#8230;<br />
And our CSS from above:</p>
<pre><code>p {
    width:150px;
}
.IE6 p {
    width:200px;
}</code></pre>
<p>Of course this only works with IE but really you shouldn&#8217;t need this at all since you build awesome websites that are already cross-browser compatible, right? And there is no chance ever that a client will want a site to be usable in IE5.5, right?</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewjaswa.com/2009/05/markup-conditionals/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Baseline: Markup</title>
		<link>http://andrewjaswa.com/2008/06/baseline-markup/</link>
		<comments>http://andrewjaswa.com/2008/06/baseline-markup/#comments</comments>
		<pubDate>Thu, 12 Jun 2008 03:02:57 +0000</pubDate>
		<dc:creator>ajaswa</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[industry]]></category>
		<category><![CDATA[websites]]></category>
		<category><![CDATA[baseline]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[markup]]></category>
		<category><![CDATA[semantic]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://andrewjaswa.com/?p=17</guid>
		<description><![CDATA[The other week I posted a CSS Baseline. So I&#8217;ve decided to create its counterpart: a Markup Baseline. I put some thought into if I should create a markup baseline in the first place. I can&#8217;t find any other attempts to create something like this. I believe this is due to the issues I ran [...]]]></description>
			<content:encoded><![CDATA[<p>The other week I posted a <a href="http://andrewjaswa.com/2008/05/styleless/">CSS Baseline</a>. So I&#8217;ve decided to create its counterpart: a Markup Baseline. I put some thought into if I should create a markup baseline in the first place. I can&#8217;t find any other attempts to create something like this. I believe this is due to the issues I ran into when creating this baseline. </p>
<h3>Issues</h3>
<h4>Purpose</h4>
<p>Well formed markup (semantic markup that is) is based on the content. Content is usually based on the purpose of a site. So how would you make a baseline all different kinds of content? You might just end up with a baseline for every different type of website out there. There would be millions of baselines then. And that wouldn&#8217;t be very productive. </p>
<h4>doctype</h4>
<p>Different types of sites may require different doctypes. I thought about making some php functions that would switch the doctype based upon your preference. That seemed a bit more like a framework and out of the scope of this project.</p>
<h3>The Baseline</h3>
<p>I&#8217;ve noticed over the years that I have been creating websites in similar fashion. Websites I&#8217;ve created lately have followed a set of ideas that I&#8217;ve concocted. The basics of theses ideas start with the structure of the web page. You can usually distill web page structure down to 4 major areas: the header, navigation, the main content area and the footer. Now this doesn&#8217;t work in all cases but it should work for most. Again this is an issue with the purpose of the site or page. However most sites will have these 4 elements. In the end I settled on the basic structure of 4 major elements and the XHTML 1.0 Strict doctype. </p>
<p><a href="http://andrewjaswa.com/uploads/2008/06/baseline.html">Markup Baseline</a></p>
]]></content:encoded>
			<wfw:commentRss>http://andrewjaswa.com/2008/06/baseline-markup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
