<?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>israeljernigan.com &#187; xhtml</title>
	<atom:link href="http://www.israeljernigan.com/tag/xhtml/feed" rel="self" type="application/rss+xml" />
	<link>http://www.israeljernigan.com</link>
	<description>personal web blogger</description>
	<lastBuildDate>Sat, 17 Oct 2009 16:28:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Learning to create css layout: Part 2 of 2</title>
		<link>http://www.israeljernigan.com/learning-to-create-css-layout-part-2-of-2</link>
		<comments>http://www.israeljernigan.com/learning-to-create-css-layout-part-2-of-2#comments</comments>
		<pubDate>Tue, 25 Sep 2007 21:12:18 +0000</pubDate>
		<dc:creator>Israel Jernigan</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://www.israeljernigan.com/learning-to-create-css-layout-part-2-of-2</guid>
		<description><![CDATA[Okay, so this has taken awhile for me to get around to writing.
This is the second part to the learning to create css layout series. This part focuses on how to make the menu. The last part left off here.
We are going to create the menu from an unordered list. The main reason we do [...]]]></description>
			<content:encoded><![CDATA[<p>Okay, so this has taken awhile for me to get around to writing.</p>
<p>This is the second part to the learning to create css layout series. This part focuses on how to make the menu. The last part <a href="http://www.israeljernigan.com/post-content/tutorial/basic_css_02.htm" title="First part of series" target="_blank">left off here</a>.</p>
<p>We are going to create the menu from an unordered list. The main reason we do this, is because of semantics. When css is disabled or someone is using a screen reader it&#8217;s helps in navigation. But also it is because the menu is a list or grouping of links.</p>
<p>So lets start with the xhtml.</p>
<pre>
&lt;ul&gt;
&lt;li&gt;&lt;a href="#" class="active"&gt;Main 1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#"&gt;Main 2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#"&gt;Main 3&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#"&gt;Main 4&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#" class="last"&gt;Main 5&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</pre>
<p>Which is pretty simple. Much cleaner than separate &lt;td&gt; for each link. <span id="more-10"></span>Each link is nested inside a list tag. And whichever page you are on the anchor tag has a class of {active} attributed to it. This is strictly for declaring css on that element to help distinguish it from the other menu items. And you might have noticed a class of {last}, which is being used for controlling graphical elements on the end anchor tag.</p>
<p>That&#8217;s pretty simple and it can be controlled quite extensively with css. Here is the css that controls the way the unordered list is setup and displayed.</p>
<pre>
#menu ul{
margin: 0;
padding: 0;
width: auto;
}
#menu ul li{
display:inline;
}</pre>
<p>We have put the unordered list inside the {menu} div. We can set specific rules for just this div by attributing <strong>#menu</strong> before all of the elements we want to control inside that div. That way it won&#8217;t affect any other tags on the page that are not in that div.</p>
<p>We get rid of the default values that are atrributed to an unordered list by setting <strong>margin</strong> and <strong>padding</strong> to 0. Also each list item inside the unordered list is set to <strong>display inline</strong> instead of block. What this does is align the elements to sit beside each other instead of on top of each other.</p>
<p>Now here is the gritty part of the menu, and where you can really effect the colors, size and many other aspects.</p>
<pre>
#menu a{
border:1px solid #333;
border-right: none;
color: black;
display:block;
float:left;
margin-left:-1px;
padding:5px 0;
text-align:center;
text-decoration: none;
width:20%;
}
#menu a.last{
border-right:1px solid #333;
margin-right:-1px;
}
#menu a:hover{
background-color:#181818;
color:#EAEAEA;
}
#menu a.active{
background-color:#181818;
color:#EAEAEA;
}�</pre>
<p>Okay, hopefully you are not overwhelmed. I will try and explain the important parts of what this css does. First we assign a <strong>border</strong> to each link as well as set the <strong>right border</strong> to be 0px by using the word <strong>none</strong>. This makes the border be the same width across the entire menu. And because we got rid of the right border, the last anchor tag needs to have it put back on. So that&#8217;s where <strong>a.last</strong> comes to play. We apply a <strong>1px border</strong> back onto that element.</p>
<p>Normally anchor tags are inline elements, but we want them make them have cool hover states and have the entire height of the link clickable. So, we need to set <strong>display to block</strong>, and have them <strong>float left</strong>. What this does is allow you to set a height and makes the extra space on the element clickable, not just the text. Which is really user friendly, and allows for easier navigation.</p>
<p>When working with css and making things line up correctly you need to be aware of your elements width. Because we added a border to each link we need to offset the width of the element so that it is what it was before the border. Since each element has 1px extra, because of the border, we can set the <strong>margin-left</strong> to -1px. And on the <strong>a.last</strong> element we can add margin-right -1px (since it needs 2px taken off).</p>
<p>The biggest reason for this is so when we set the width of the links it is correct. Because we have 5 links we can set the <strong>width to %20</strong>. If we hadn&#8217;t taken off 1px with <strong>margin</strong>, the links would not display correctly.</p>
<p>Now we just add some simple decoration with <strong>padding</strong>. And we are using <strong>shorthand</strong> css here. The first number effects the top and bottom, and the second number effects left and right. Then we add some colors and set the :hover and :active <em>pseudo elements</em>. So, when you rollover the links, they behave like you expect.</p>
<p>It&#8217;s that simple. Once you have created a few sites using css. You will begin to understand how easy it is to effect entire websites.<br />
Hopefully this tutorial has shed some light on how to create a css layout that you would normally have done with tables. The final example has some extra css thrown in to help show how to create a more complete look.</p>
<p><a href="/post-content/tutorial/basic_css.htm" class="big-button" title="View live example">View Completed Example</a></p>
<p>If you have any suggestions or questions please feel free to share your thoughts.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.israeljernigan.com/learning-to-create-css-layout-part-2-of-2/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Learning to create css layout: Part 1 of 2</title>
		<link>http://www.israeljernigan.com/learning-to-create-css-layout-part-1-of-2</link>
		<comments>http://www.israeljernigan.com/learning-to-create-css-layout-part-1-of-2#comments</comments>
		<pubDate>Fri, 03 Aug 2007 19:29:22 +0000</pubDate>
		<dc:creator>Israel Jernigan</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://israeljernigan.com/learning-to-create-css-layout-part-1-of-2</guid>
		<description><![CDATA[For those of you out there who are still wondering how to transition from table design to css design, I am going to try and rescue you.
I will take you through a new thought process, and explain how you would do something in tables and then convert it to css.
Hopefully you will find this helpful. [...]]]></description>
			<content:encoded><![CDATA[<p>For those of you out there who are still wondering how to transition from table design to css design, I am going to try and rescue you.</p>
<p>I will take you through a new thought process, and explain how you would do something in tables and then convert it to css.</p>
<p>Hopefully you will find this helpful. Here are the links providing the two examples in their entirety: <a href="/post-content/tutorial/basic.htm" title="Table Layout example">table layout</a>, <a href="/post-content/tutorial/basic_css.htm" title="Css Layout example">css layout</a>.</p>
<h2>Let&#8217;s Begin</h2>
<p>Let&#8217;s say you need to create a simple 2 column layout. Nothing fancy, but you want to apply css as much as possible because your new boss says it&#8217;s the only way to go.</p>
<p>Let&#8217;s start with a basic diagram of what you need.<br />
<span id="more-6"></span>
<ul>
<li>header</li>
<li>menu</li>
<li>body &#8211; with 2 columns</li>
<li>footer</li>
</ul>
<p><img src="/post-content/tutorial/images/tut_01_basic.jpg" alt="Basic Layout" class="left" /></p>
<p class="clear">&nbsp;</p>
<p>With tables you would probably break it up into 4 rows with tables inside each row representing each section. Like below.</p>
<p><img src="/post-content/tutorial/images/tut_01_table.jpg" alt="Table Layout" class="left" /></p>
<p class="clear">&nbsp;</p>
<p>You would have a row for the header, menu, content, and footer. There would be another table inside the menu with however many rows for the buttons. Inside the content row there would be a table with 2 rows, and a table in each of those rows. (these are the deepest tables, 3 tables deep) In the last row, another table for the footer so it aligned with the right column.</p>
<p>Now this is fine and dandy, but your boss &#8211; bless him &#8211; must have it done in css. So I will explain what we&#8217;ll need for the layout. You would probably break it up into 4 divs (instead of 4 rows within a table) Like below.</p>
<p><img src="/post-content/tutorial/images/tut_01_basic.jpg" alt="Basic Layout" class="left" /></p>
<p class="clear">&nbsp;</p>
<p>(This image is vaguely familiar) We can use the basic layout we thought of to guide our css layout. You would have a div for each part: the header, menu, content, and footer. Like so.</p>
<pre>&lt;div id=”header”&gt;
&lt;/div&gt;
&lt;div id=”menu”&gt;
&lt;/div&gt;
&lt;div id=”content”&gt;
&lt;/div&gt;
&lt;div id=”footer”&gt;
&lt;/div&gt;</pre>
<p><a href="/post-content/tutorial/basic_css_01.htm" title="First Example file">Example File.</a> Here is the file you can start from if you want to follow along.</p>
<p>Now we will add divs inside those to help create the menu items and columns. Be sure when you use id&#8217;s {id=&#8221;header&#8221;} to not use the same name more than once on a page. This will help create more valid code. When you use class&#8217;s {class=&#8221;left&#8221;} you can use them as many times as you want.</p>
<p>Inside the content div add a div for each column, like so.</p>
<pre>&lt;div id=”content”&gt;
&lt;div id=”col_1”&gt;
&lt;/div&gt;
&lt;div id=”col_2”&gt;
&lt;/div&gt;
&lt;/div&gt;</pre>
<p>Now that&#8217;s all the div&#8217;s we need. Hurrah!! We will add the menus and content soon. Now for some css. I know it doesn&#8217;t look like much now, but that&#8217;s the beauty of css. You can change the css and the html code doesn&#8217;t need to change. A good point to remember is that css is awesome at making it where all you need to do is change one file and all of your pages are changed.</p>
<p>Put this code right before the end of the head tag. We are creating css that will be used for computers so we set the style media attribute to screen. You would use the media attribute to apply css to print, handhelds, etc.</p>
<p>I will explain the reason for each bit of code below.</p>
<pre>&lt;style type="text/css" media="screen"&gt;/*set default values*/
body{
margin:0 auto;
width:756px;
}</pre>
<p>To make the content align in the middle you can set the margin <em>property</em> in the body <em>selector</em>, like so {margin:0 auto} the first <em>value</em> represents the top and bottom margin and the second value the left and right. And we assign the width to be 756px.</p>
<pre>
a:link{
color:blue;
}
a:visited{
color:purple;
}
a:hover{
background-color:#ABABAB;
}
a:active{
color:red;
}</pre>
<p>We also want to set some basic default styles that will apply to every link. CSS allows you to alter link states. These next few values are called <em>psuedo classes</em>, and I am using them on the anchor selectors. {a:link} is the unvisited state. {a:visited} is the visited state. {a:hover} is the rollover/hover state. {a:active} this is the on-click/activated state. Some of these rules can be applied to other html elements, but they are used primarily for the anchor tag. <a href="http://meyerweb.com/eric/css/link-specificity.html" title="Link Specificity: meyerweb.com">Here is a reference</a> that explains this is much more detail.</p>
<pre>
.left{
float:left;
}
.right{
float:right;
}</pre>
<p>I have created 2 <em>class selectors</em> called left &amp; right. { I will explain what they do in a little bit.} In css, you use a dot in front of the class name, that&#8217;s called a <em>class selector</em>. With id&#8217;s you put a pound-sign in front of the name, that&#8217;s called an <em>id selector</em>.</p>
<pre>/*set layout values*/
#container{
}
#header{
height:150px;
line-height:150px;
position:relative;text-align:center;
}
#menu{
position:relative;
background-color:#EAEAEA;
}
#content{
position:relative;
}
#col_1{
width:25%;
}
#col_2{
width:75%;
}
#footer{
color:#ccc;
font-size:10px;
padding-left:25%;
text-align:center;
}
&lt;/style&gt;</pre>
<p>Then I&#8217;ve applied id&#8217;s to all of the divs I made to create the layout. I won&#8217;t explain them in gross detail, but I will explain why I did certain parts. In the {#header} id selector I made the line-height property the same as the height. That is a very simple way of aligning text vertically. In {#col_1 &amp; #col_2} I gave the divs their widths in percentages just like I did for the tables. But if you look at the page it doesn&#8217;t line up correctly. And that&#8217;s because we need to make them float next to each other. The easiest way to do this is to use the class selector that we just talked about, called {.left}. Apply this style to each column {put this in each column div tag » class=&#8221;left&#8221;}. This will make them line up next to each other. And since their widths don&#8217;t equal more than 100%, they will float perfectly next to each other. And lastly in {#footer} I added a padding-left:25%, since that&#8217;s the width of the 1st column,  to the id selector so that it would align correctly with the second column.</p>
<p>Now this is where we are at. <a href="/post-content/tutorial/basic_css_02.htm" title="First Example file">Example File 2.</a></p>
<p>You can view the finished html page here.</p>
<p><a href="/post-content/tutorial/basic_css.htm" class="big-button" title="View live example">View Example</a></p>
<p><a href="http://www.israeljernigan.com/learning-to-create-css-layout-part-2-of-2" title="Part 2 of learning css">Here is part 2</a>, where I explain how the menus work. Enjoy for now, and feel free to ask any questions.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.israeljernigan.com/learning-to-create-css-layout-part-1-of-2/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Basic CSS Setup</title>
		<link>http://www.israeljernigan.com/basic-css-setup</link>
		<comments>http://www.israeljernigan.com/basic-css-setup#comments</comments>
		<pubDate>Tue, 31 Jul 2007 17:58:02 +0000</pubDate>
		<dc:creator>Israel Jernigan</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://israeljernigan.com/basic-css-setup</guid>
		<description><![CDATA[I was thinking to myself that I should create a basic set of css files that I can use for any projects that I might be working on. So I did, and it has saved me alot of time. It has a reset for the basic html elements. There is a css file for forms. [...]]]></description>
			<content:encoded><![CDATA[<p>I was thinking to myself that I should create a basic <a href="http://israeljernigan.com/dev/templates/" title="Basic set of css files">set of css files</a> that I can use for any projects that I might be working on. So I did, and it has saved me alot of time. It has a reset for the basic html elements. There is a css file for forms. As well as a basic print file to go along with the set.</p>
<p>Multiple layouts are included (left and right aligned).</p>
<ul>
<li>2 column: 800&#215;600 and 1024&#215;768</li>
<li>3 column: 800&#215;600 and 1024&#215;768</li>
</ul>
<p>There were a few things that I wanted as default personally.<br />
<span id="more-5"></span>
<ul>
<li>Font sizes as ‘em’ (so that everything would increase or decrease easily)</li>
<li>The ability to easily use floating divs</li>
<li>Basic css styles for form elements</li>
<li>I didn’t end up creating a default css menu, since those change every time I do a site.My website is setup using these css files, with the id’s and such renamed to work with wordpress. I loosely based my default.css file on <a href="http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/trackback/" target="_blank" title="Meyerweb.com example  of resetting css">meyerweb.com’s example</a>. Please feel free to use this set of files in any way.<a href="http://israeljernigan.com/dev/templates/" class="big-button" title="View live examples"> View Examples</a><a href="http://israeljernigan.com/downloads/zippedCSS.zip" class="big-button" title="Download Now">Download FilesNow!</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.israeljernigan.com/basic-css-setup/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
