<?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>Alex Mansfield &#187; CSS</title>
	<atom:link href="http://alexmansfield.com/category/css/feed" rel="self" type="application/rss+xml" />
	<link>http://alexmansfield.com</link>
	<description>WordPress Developer</description>
	<lastBuildDate>Tue, 28 Feb 2012 23:24:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Font-size and Line-height for &lt;pre&gt;, &lt;code&gt;, and Other Monospaced Fonts</title>
		<link>http://alexmansfield.com/css/font-size-line-height-pre-code-monospace</link>
		<comments>http://alexmansfield.com/css/font-size-line-height-pre-code-monospace#comments</comments>
		<pubDate>Sat, 25 Feb 2012 01:58:55 +0000</pubDate>
		<dc:creator>alexmansfield</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://alexmansfield.com/?p=684</guid>
		<description><![CDATA[While attempting to create a consistent cross-browser font baseline, I ran into the following strange behaviour in certain browsers (not IE for once!). Any monospaced font was rendered smaller than the surrounding text, even when specifically set to display at 1em. I found this to be true in both Firefox and Chrome. After a bit [...]]]></description>
			<content:encoded><![CDATA[<p>While attempting to create a consistent cross-browser font baseline, I ran into the following strange behaviour in certain browsers (not IE for once!). Any monospaced font was rendered smaller than the surrounding text, even when specifically set to display at 1em. I found this to be true in both Firefox and Chrome. After a bit of searching, I found that these browsers also contain a strange bug, although in this case it almost becomes a feature. If the font-family is set to monospace twice, suddenly the font displays at the proper size:</p>
<pre class="brush: css; title: ; notranslate">pre, code, kbd, samp, tt, textarea{
	font-family: monospace, monospace;
}</pre>
<p>However, in Chrome, this threw off the line height, which ruined the vertical rhythm I was working to create. After some trial and error, I discovered that setting the vertical-align property to &#8220;top&#8221; took care of the problem. I&#8217;ll be the first to admit that this isn&#8217;t the most elegant solution, but as far as I can tell, it works in every modern browser. Here is my final code:</p>
<pre class="brush: css; title: ; notranslate">pre, code, kbd, samp, tt, textarea{
	font-family: monospace, monospace;
	vertical-align: top;
}</pre>
<p>Please let me know if you find any browsers that don&#8217;t render this properly. Thanks!</p>
]]></content:encoded>
			<wfw:commentRss>http://alexmansfield.com/css/font-size-line-height-pre-code-monospace/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple CSS Drop Down Menus</title>
		<link>http://alexmansfield.com/css/simple-css-drop-down-menus</link>
		<comments>http://alexmansfield.com/css/simple-css-drop-down-menus#comments</comments>
		<pubDate>Sat, 29 Oct 2011 21:58:22 +0000</pubDate>
		<dc:creator>alexmansfield</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://alexmansfield.com/?p=616</guid>
		<description><![CDATA[I was building a drop down menu while working on a personal project and I decided to see how lightweight I could make it. This is a pure CSS drop down menu, no Javascript is used. Only 50 lines of generously spaced CSS were needed to create a cross-browser drop down menu and the entire [...]]]></description>
			<content:encoded><![CDATA[<p>I was building a drop down menu while working on a personal project and I decided to see how lightweight I could make it. This is a pure CSS drop down menu, no Javascript is used. Only 50 lines of generously spaced CSS were needed to create a cross-browser drop down menu and the entire <a href="http://alexmansfield.com/demos/cssmenu/" title="CSS Menu Demo">demo file</a> weighs in at just over 1kb. It uses the same HTML structure as the default WordPress menu system, so it can easily be used in WordPress themes as well.  <span id="more-616"></span></p>
<p>Here is the HTML:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div id=&quot;nav-primary&quot;&gt;
	&lt;ul&gt;
		&lt;li&gt;&lt;a href=&quot;#&quot;&gt;About&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Level 1&lt;/a&gt;
			&lt;ul&gt;
				&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Level 2&lt;/a&gt;&lt;/li&gt;
				&lt;li&gt;&lt;a href=&quot;#&quot;&gt;More Level 2&lt;/a&gt;
					&lt;ul&gt;
						&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Level 3&lt;/a&gt;&lt;/li&gt;
						&lt;li&gt;&lt;a href=&quot;#&quot;&gt;More Level 3&lt;/a&gt;&lt;/li&gt;
					&lt;/ul&gt;
				&lt;/li&gt;
				&lt;li&gt;&lt;a href=&quot;#&quot;&gt;More Level 2 Again&lt;/a&gt;
					&lt;ul&gt;
						&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Other Level 3&lt;/a&gt;&lt;/li&gt;
						&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Other Level 3 Again&lt;/a&gt;&lt;/li&gt;
					&lt;/ul&gt;
				&lt;/li&gt;
			&lt;/ul&gt;
		&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Lorem Ipsum&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;
&lt;/div&gt;
</pre>
<p>As you can see, the HTML is just a simple list based menu structure. Each sub-menu is contained within the list item of the parent. This is required for hover states to work properly.</p>
<p>The CSS is nearly as simple as the HTML:</p>
<pre class="brush: css; title: ; notranslate">
#nav-primary{
	background: #444;
	height: 40px;
}

#nav-primary ul{
	background: #444;
	list-style: none;
	margin: 0;
	padding: 0;
}

#nav-primary li{
	float: left;
	position:relative;
}

#nav-primary a{
	color: #fff;
	display: block;
	height: 40px;
	line-height: 40px;
	padding: 0 10px;
	text-decoration: none;
}

#nav-primary a:hover{
	background: #555;
}

#nav-primary ul ul{
	display:none;
	position: absolute;
	top: 40px;
	left: 0;
	width: auto;
}

#nav-primary ul ul li{
	width: 200px;
}

#nav-primary ul li:hover &gt; ul {
	display: block;
}

#nav-primary ul ul ul {
	left: 100%;
	top: 0;
}
</pre>
<p>I have tested this menu with IE 7 and 8, Firefox 7, Chrome 14, Opera 11, and Safari 5.</p>
]]></content:encoded>
			<wfw:commentRss>http://alexmansfield.com/css/simple-css-drop-down-menus/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Outline: the Ignored CSS Property</title>
		<link>http://alexmansfield.com/css/css-outline</link>
		<comments>http://alexmansfield.com/css/css-outline#comments</comments>
		<pubDate>Sat, 19 Jun 2010 01:47:32 +0000</pubDate>
		<dc:creator>alexmansfield</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://alexmansfield.com/?p=442</guid>
		<description><![CDATA[Note: Here is another post originally written for my blog over at sackclothstudios.com. However, with the changes I’m making to that site, I figured the post would be of more use here on this site. Outline is a seldom used and often misunderstood CSS property. An outline is a line that is drawn around an [...]]]></description>
			<content:encoded><![CDATA[<p>Note: Here is another post originally written for my blog over at <a onclick="javascript:pageTracker._trackPageview('/outbound/article/sackclothstudios.com');" href="http://sackclothstudios.com/">sackclothstudios.com</a>. However, with the changes I’m making to that site, I figured the post would be of more use here on this site.</p>
<p>Outline is a seldom used and often misunderstood CSS property. An outline is a line that is drawn around an element outside of it&#8217;s border. By definition, it takes up no space. Sounds impossible, right? In reality, it does take up space (you can see it!)  however, that space is not added to the width of the element like a border would be.</p>
<p>Most often, the outline is used to highlight an active link. By default this is a small dotted line that encapsulates the link. To be honest, as a designer I have often found the outline to be a bit ugly. There are some designers who hide the outline entirely (I used to be one of them). However, in Firefox, Internet Explorer and Chrome you can navigate the web using only the keyboard by tabbing through the links on each page. Each link is highlighted by an outline when you reach it. You can hit enter to follow the link. Hiding the outline entirely takes that feature away from users who prefer to use their keyboards. So to prevent the ugly outline while still retaining keyboard navigation we can style the outline using CSS.</p>
<p>This solution is not perfect, due to the lack of support by Internet Explorer (as of version 7). While Internet Explorer uses an outline to highlight links, it does not support styling it will CSS. Firefox, Safari, Opera and Chrome on the other hand, do allow you to specify your own styles.</p>
<p>The outline can be styled with the following properties:</p>
<ul>
<li>outline-color</li>
<li>outline-style</li>
<li>outline-width</li>
<li>outline</li>
</ul>
<p>Outline-color behaves like any other color declaration and also supports the value &#8220;invert&#8221; which performs a color inversion of the pixels on the screen. This is the default behavior and ensures that the outline will stand out from the background. Outline color can be set like this:</p>
<pre class="brush: css; title: ; notranslate">a{outline-color: white;}</pre>
<p>Outline-style has the same possible values as the more common property border-style and is set like this:</p>
<pre class="brush: css; title: ; notranslate">a{outline-style: dashed;}</pre>
<p>Outline-width can be set to thin, medium, thick, or can be specified with a length such as 3px.</p>
<pre class="brush: css; title: ; notranslate">a{outline-width: 1px;}</pre>
<p>Finally, outline is a shorthand property for setting the previous three properties all at once. For example:</p>
<pre class="brush: css; title: ; notranslate">a{outline:2px solid red;}</pre>
<p>Keep in mind an outline is the same on all sides. Unlike border, you cannot specify a style for only one side of an outline. To play around with the outline property, visit <a href="http://www.w3schools.com/CSS/tryit.asp?filename=trycss_outline">http://www.w3schools.com/CSS/tryit.asp?filename=trycss_outline</a></p>
<p>For even more information:</p>
<ul>
<li><a href="http://arjaneising.nl/css/dont-remove-the-outline-from-links">Don&#8217;t remove the outline from links</a> &#8211; arjaneising.nl</li>
<li><a href="http://css-tricks.com/removing-the-dotted-outline/">Removing the dotted line</a> &#8211; csstricks.com</li>
<li><a href="http://reference.sitepoint.com/css/outline">The outline CSS property</a> &#8211; sitepoint.com</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://alexmansfield.com/css/css-outline/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

