<?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>Webdesign-Tricks.Com &#187; CSS</title>
	<atom:link href="http://www.webdesign-tricks.com/tag/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webdesign-tricks.com</link>
	<description>Web Design Resources, CSS Tricks, Articles, Tutorials and more</description>
	<lastBuildDate>Tue, 23 Feb 2010 17:09:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Designing Cutting Edge Web Sites</title>
		<link>http://www.webdesign-tricks.com/designing-cutting-edge-web-sites/</link>
		<comments>http://www.webdesign-tricks.com/designing-cutting-edge-web-sites/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 17:24:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://www.webdesign-tricks.com/?p=722</guid>
		<description><![CDATA[There are so many new and exciting features of Ajax, Dynamic HTML, and other &#8220;bleeding edge&#8221; technologies, but it can be hard to decide whether to use them. Before you decide to write your pages at the edge of HTML, there are some things to think about:
1. How many new features are on the page [...]]]></description>
			<content:encoded><![CDATA[<p>There are so many new and exciting features of Ajax, Dynamic HTML, and other &#8220;bleeding edge&#8221; technologies, but it can be hard to decide whether to use them. Before you decide to write your pages at the edge of HTML, there are some things to think about:</p>
<p><strong>1. How many new features are on the page already?</strong></p>
<p>If a page has too many flashing lights, gizmos, and special effects, your readers may be turned off rather than impressed. Also, things like java applets can take up system memory for your readers and can cause their browser to crash if there is too much going on. </p>
<p>A good rule of thumb is to limit your page to 1 special effect of any kind. This includes music, streaming video, java applets, Ajax applications, and Dynamic HTML.</p>
<p><strong>2. What are you trying to achieve with the effect?</strong></p>
<p>Try to design your pages with purpose. If you want a rollover, add it to the areas of the page that might not be clicked on if you didn&#8217;t call attention to them. Use dynamic positioning to serve a purpose. </p>
<p>Fancy effects that have a purpose will enhance your Web page rather than detract from them.</p>
<p><strong>3. Can you achieve the same effect with an older technology?</strong></p>
<p>The older your effects are, the more likely it is that they will be supported by multiple browsers. If you can create a motion effect with an animated GIF, more people will see the animation than if you use DHTML, Ajax, or Flash. </p>
<p>The more you can keep your site browser non-specific, the more readers you will have.</p>
<p><strong>4. If you want a browser specific effect, have you thought how other browsers will see the page?</strong></p>
<p>Even if you want your customers to view your site with Internet Explorer, you&#8217;re certain to get Firefox, Opera, and Safari viewers. But if you show them nothing, you&#8217;ll lose readers you could have saved with just a few more lines of HTML. </p>
<p>When using an effect, keep in mind how other browsers will see (or not see) the effect. Many effects have built in support for non-compliant browsers. For example, if you use the <iframe> tag, you can include text inside the tags that can explain what the non-iframe compatible browser is missing.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdesign-tricks.com/designing-cutting-edge-web-sites/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Image Preloader</title>
		<link>http://www.webdesign-tricks.com/css-image-preloader/</link>
		<comments>http://www.webdesign-tricks.com/css-image-preloader/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 21:12:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS Menus]]></category>

		<guid isPermaLink="false">http://www.webdesign-tricks.com/?p=714</guid>
		<description><![CDATA[In this article, you’ll learn how to create an image pre-loader without Javascript. CSS is the technique we are going to use. No fancy and hard to understand codes, but the smart use of codes you already know about.
Why use an image pre-loader? A lot of websites out there use CSS to display their navigation [...]]]></description>
			<content:encoded><![CDATA[<p>In this article, you’ll learn how to create an image pre-loader without Javascript. CSS is the technique we are going to use. No fancy and hard to understand codes, but the smart use of codes you already know about.</p>
<p>Why use an image pre-loader? A lot of websites out there use CSS to display their navigation menu. In most of these menu’s, images are used. When you roll with your mouse over one of the menu items, the ‘hover’ image is displayed.</p>
<p>Sometimes, it takes a fraction of a second to load this ‘hover’ image. Your browser doesn’t load ‘hover’ images when the whole page loads, and therefore it has to load when the visitor asks for it. As the designer of that page you would like to display that ‘hover’ image right away. This is where the pre-loader comes in, which is an smart help in such situation.</p>
<p>Let’s start. In this article we’ll make sure ‘hover’ images are loaded together with the page. These are the codes we will start with.</p>
<p><strong>CSS</strong></p>
<p>ul{<br />
margin: 0;<br />
padding: 0;<br />
list-style-type: none;<br />
font: 13px &#8216;Lucida Grande&#8217;, Arial, sans-serif;<br />
}<br />
ul li{<br />
display: inline;<br />
}<br />
ul li a{<br />
display:block;<br />
width:120px;<br />
text-decoration: none;<br />
padding: 0.3em 1em;<br />
color: #000;<br />
background:url(images/link.gif);<br />
}<br />
ul li a:hover{<br />
width:120px;<br />
background:url(images/hover.gif);<br />
}</p>
<p><strong>My HTML codes looks like this:</strong></p>
<ul>
<li><a href="http://www.divitodesign.com">Homepage</a></li>
<li><a href="http://www.divitodesign.com">Articles</a></li>
<li><a href="http://www.divitodesign.com">Weblog</a></li>
<li><a href="http://www.divitodesign.com">Contact</a></li>
</ul>
<p>We are going to add a pre-loader. Open up your HTML file and add the following codes just above your tag.</p>
<p>Inside this div, we are going to add images you would like to pre-load. Those images won’t be displayed when the webpage just loads, only when rolling over the menu item.</p>
<p>Now, open up your CSS file. Add the following codes:</p>
<p>div.loader{<br />
background:url(images/hover.gif);<br />
margin-left:-1000px;<br />
}</p>
<p>These codes will tell the div with class loader it should be displayed 1000px to the left. Yes, outside your browser. Your visitors won’t notice this box, but your browser knows the box is there and will load the image(s).</p>
<p>If you would like to add more images to the div, just add more ‘background’ tags and you are done.</p>
<p>div.loader{<br />
background:url(images/hover.gif) no-repeat;<br />
background:url(images/hover2.gif) no-repeat;<br />
background:url(images/hover3.gif) no-repeat;<br />
background:url(images/hover4.gif) no-repeat;<br />
margin-left:-1000px;<br />
}</p>
<p>Now you could pre-load images without using Javascript! Good luck with using this on your website and thanks for reading.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdesign-tricks.com/css-image-preloader/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ten CSS tricks you may not know</title>
		<link>http://www.webdesign-tricks.com/ten-css-tricks-you-may-not-know/</link>
		<comments>http://www.webdesign-tricks.com/ten-css-tricks-you-may-not-know/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 08:30:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://www.webdesign-tricks.com/?p=708</guid>
		<description><![CDATA[1. CSS font shorthand rule
When styling fonts with CSS you may be doing this:
font-weight: bold;
font-style: italic;
font-variant: small-caps;
font-size: 1em;
line-height: 1.5em;
font-family: verdana,sans-serif 
There&#8217;s no need though as you can use this CSS shorthand property:
font: bold italic small-caps 1em/1.5em verdana,sans-serif
Much better! Just a few of words of warning: This CSS shorthand version will only work if you&#8217;re specifying [...]]]></description>
			<content:encoded><![CDATA[<p><strong>1. CSS font shorthand rule</strong></p>
<p>When styling fonts with CSS you may be doing this:</p>
<p>font-weight: bold;<br />
font-style: italic;<br />
font-variant: small-caps;<br />
font-size: 1em;<br />
line-height: 1.5em;<br />
font-family: verdana,sans-serif </p>
<p>There&#8217;s no need though as you can use this CSS shorthand property:</p>
<p>font: bold italic small-caps 1em/1.5em verdana,sans-serif</p>
<p>Much better! Just a few of words of warning: This CSS shorthand version will only work if you&#8217;re specifying both the font-size and the font-family. The font-family command must always be at the very end of this shorthand command, and font-size must come directly before this. Also, if you don&#8217;t specify the font-weight, font-style, or font-variant then these values will automatically default to a value of normal, so do bear this in mind too.</p>
<p><strong>2. Two classes together</strong></p>
<p>Usually attributes are assigned just one class, but this doesn&#8217;t mean that that&#8217;s all you&#8217;re allowed. In reality, you can assign as many classes as you like! For example:</p>
<p class="text side">&#8230;</p>
<p>Using these two classes together (separated by a space, not with a comma) means that the paragraph calls up the rules assigned to both text and side. If any rules overlap between the two classes then the class which is below the other in the CSS document will take precedence.</p>
<p><strong>3. CSS border default value</strong></p>
<p>When writing a border rule you&#8217;ll usually specify the colour, width and style (in any order). For example, border: 3px solid #000 will give you a black solid border, 3px thick. However the only required value here is the border style.</p>
<p>If you were to write just border: solid then the defaults for that border will be used. But what defaults? Well, the default width for a border is medium (equivalent to about 3 to 4px) and the default colour is that of the text colour within that border. If either of these are what you want for the border then you can leave them out of the CSS rule!</p>
<p><strong>4. CSS document for printing</strong></p>
<p>Lots of web pages have a link to a print-friendly version. What many of them don&#8217;t realise is that there&#8217;s no need because you can set up a second CSS document to be called up when a user prints the page.</p>
<p>So, your page header should contains links to two CSS documents, one for the screen, and one for printing:</p>
<link type="text/css" rel="stylesheet" href="stylesheet.css" media="screen" />
<link type="text/css" rel="stylesheet" href="printstyle.css" media="print" />
<p>The first line of code calls up the CSS for the screen (notice the inclusion of media=&#8221;screen&#8221;) and the second line calls up the CSS for the printable version (using media=&#8221;print&#8221;).</p>
<p>So, what commands should you put in this second CSS document? To work it out, open a blank document and save it as printstyle.css. Next, point the screen CSS command to this document so that the command reads:
<link type="text/css" rel="stylesheet" href="printstyle.css" media="screen" />.</p>
<p>Now just keep entering CSS commands until the display on the screen matches how you want the printed version to look. You&#8217;ll certainly want to make use of the display: none command for navigation, decorative images and non-essential items. For more advice on this, read Print Different, which also mentions the other media for which you can specify CSS files.</p>
<p><strong>5. Image replacement technique</strong></p>
<p>It&#8217;s always advisable to use regular HTML markup to display text, as opposed to an image. Doing so allows for a faster download speed and has accessibility benefits. However, if you&#8217;ve absolutely got your heart set on using a certain font and your site visitors are unlikely to have that font on their computers, then really you&#8217;ve got no choice but to use an image.</p>
<p>Say for example, you wanted the top heading of each page to be ‘Buy widgets’, as you&#8217;re a widget seller and you&#8217;d like to be found for this phrase in the search engines. </p>
<p>This is OK but there&#8217;s strong evidence to suggest that search engines don&#8217;t assign as much importance to alt text as they do real text (because so many webmasters use the alt text to cram in keywords). So, an alternative would be:</p>
<h1>Buy widgets</h1>
<p>Now, this obviously won&#8217;t use your obscure font. To fix this problem place these commands in your CSS document:</p>
<p>h1<br />
{<br />
background: url(widget-image.gif) no-repeat;<br />
height: image height<br />
text-indent: -2000px<br />
} </p>
<p>Be sure to change &#8220;image height&#8221; to whatever the height of the image is (e.g. 85px)! The image, with your fancy font, will now display and the regular text will be safely out of the way, positioned 2000px to the left of the screen thanks to our CSS rule. Please note, this can cause accessibility issues as any user with images turned off won&#8217;t be able to see the text.</p>
<p><strong>6. CSS box model hack alternative</strong></p>
<p>The box model hack is used to fix a rendering problem in pre-IE 6 browsers on PC, where by the border and padding are included in the width of an element, as opposed to added on. For example, when specifying the dimensions of a container you might use the following CSS rule:</p>
<p>#box<br />
{<br />
width: 100px;<br />
border: 5px;<br />
padding: 20px<br />
} </p>
<p>This CSS rule would be applied to:</p>
<div id="box">&#8230;</div>
<p>This means that the total width of the box is 150px (100px width + two 5px borders + two 20px paddings) in all browsers except pre-IE 6 versions on PC. In these browsers the total width would be just 100px, with the padding and border widths being incorporated into this width. The box model hack can be used to fix this, but this can get really messy.</p>
<p>A simple alternative is to use this CSS:</p>
<p>#box<br />
{<br />
width: 150px<br />
}</p>
<p>#box div<br />
{<br />
border: 5px;<br />
padding: 20px<br />
} </p>
<p>And the new HTML would be:</p>
<div id="box">
<div>&#8230;</div>
</div>
<p>Perfect! Now the box width will always be 150px, regardless of the browser!</p>
<p><strong>7. Centre aligning a block element</strong></p>
<p>Say you wanted to have a fixed width layout website, and the content floated in the middle of the screen. You can use the following CSS command:</p>
<p>#content<br />
{<br />
width: 700px;<br />
margin: 0 auto<br />
} </p>
<p>You would then enclose
<div id="content"> around every item in the body of the HTML document and it&#8217;ll be given an automatic margin on both its left and right, ensuring that it&#8217;s always placed in the centre of the screen. Simple&#8230; well not quite &#8211; we&#8217;ve still got the pre-IE 6 versions on PC to worry about, as these browsers won&#8217;t centre align the element with this CSS command. You&#8217;ll have to change the CSS rules:</p>
<p>body<br />
{<br />
text-align: center<br />
}</p>
<p>#content<br />
{<br />
text-align: left;<br />
width: 700px;<br />
margin: 0 auto<br />
} </p>
<p>This will then centre align the main content, but it&#8217;ll also centre align the text! To offset the second, probably undesired, effect we inserted text-align: left into the content div.</p>
<p><strong>8. Vertically aligning with CSS</strong></p>
<p>Vertically aligning with tables was a doddle. To make cell content line up in the middle of a cell you would use vertical-align: middle. This doesn&#8217;t really work with a CSS layout. Say you have a navigation menu item whose height is assigned 2em and you insert this vertical align command into the CSS rule. It basically won&#8217;t make a difference and the text will be pushed to the top of the box.</p>
<p>Hmmm&#8230; not the desired effect. The solution? Specify the line height to be the same as the height of the box itself in the CSS. In this instance, the box is 2em high, so we would insert line-height: 2em into the CSS rule and the text now floats in the middle of the box &#8211; perfect!</p>
<p><strong>9. CSS positioning within a container</strong></p>
<p>One of the best things about CSS is that you can position an object absolutely anywhere you want in the document. It&#8217;s also possible (and often desirable) to position objects within a container. It&#8217;s simple to do too. Simply assign the following CSS rule to the container:</p>
<p>#container<br />
{<br />
position: relative<br />
} </p>
<p>Now any element within this container will be positioned relative to it. Say you had this HTML structure:</p>
<div id="container">
<div id="navigation">&#8230;</div>
</div>
<p>To position the navigation exactly 30px from the left and 5px from the top of the container box, you could use these CSS commands:</p>
<p>#navigation<br />
{<br />
position: absolute;<br />
left: 30px;<br />
top: 5px<br />
} </p>
<p>Perfect! In this particular example, you could of course also use margin: 5px 0 0 30px, but there are some cases where it&#8217;s preferable to use positioning.</p>
<p><strong>10. Background colour running to the screen bottom</strong></p>
<p>One of the disadvantages of CSS is its inability to be controlled vertically, causing one particular problem which a table layout doesn&#8217;t suffer from. Say you have a column running down the left side of the page, which contains site navigation. The page has a white background, but you want this left column to have a blue background. Simple, you assign it the appropriate CSS rule:</p>
<p>#navigation<br />
{<br />
background: blue;<br />
width: 150px<br />
} </p>
<p>Just one problem though: Because the navigation items don&#8217;t continue all the way to the bottom of the screen, neither does the background colour. The blue background colour is being cut off half way down the page, ruining your great design. What can you do!?</p>
<p>Unfortunately one of the only solutions to this is to cheat, and assign the body a background image of exactly the same colour and width as the left column. You would use this CSS command:</p>
<p>body<br />
{<br />
background: url(blue-image.gif) 0 0 repeat-y<br />
} </p>
<p>This image that you place in the background should be exactly 150px wide and the same blue colour as the background of the left column. The disadvantage of using this method is that you can&#8217;t express the left column in terms of em, as if the user resizes text and the column expands, it&#8217;s background colour won&#8217;t.</p>
<p>Using this method the left column will have to be expressed in px if you want it to have a different background colour to the rest of the page.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdesign-tricks.com/ten-css-tricks-you-may-not-know/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to structure large CSS files</title>
		<link>http://www.webdesign-tricks.com/how-to-structure-large-css-files/</link>
		<comments>http://www.webdesign-tricks.com/how-to-structure-large-css-files/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 04:09:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://www.webdesign-tricks.com/?p=703</guid>
		<description><![CDATA[Many methods exist to structure your CSS. This article tries to describe the method I use. I call it the “Tree method”, since it structures the CSS like… that’s right, a tree structure. I want to stress that it isn’t my invention; I just describe and give reasons for its rules.
Everyone that has built a [...]]]></description>
			<content:encoded><![CDATA[<p>Many methods exist to structure your CSS. This article tries to describe the method I use. I call it the “Tree method”, since it structures the CSS like… that’s right, a tree structure. I want to stress that it isn’t my invention; I just describe and give reasons for its rules.</p>
<p>Everyone that has built a bigger site has had to deal with the mess CSS so easily become. There are ids and classes all over the place, and to find where a certain class is defined you usually need to use some search feature in your editor. Matching the other way, from the CSS to the HTML is even harder; you don’t even know what file a certain class is defined in. It’s a mess.</p>
<p>The Tree method tries to structure the CSS into logical blocks; blocks taken from the HTML. It also aims to be easy to understand for anyone. No secret codes or difficult ordering schemes.</p>
<ul>
<li>Order your selectors like the HTML</li>
<li>Always use the “full path” to elements</li>
<li>Indent your code cleverly</li>
<li>Each declaration on its own line</li>
<li>… in alphabetic order</li>
</ul>
<p><strong>Order your selectors like the HTML</strong></p>
<p>One of the problems of mapping between the HTML and the CSS is that they usually differ in structure. The HTML is (if you’re lucky) structured like a convenient semantical tree while the CSS often is ordered by something random like fonts, colors, and positioning.</p>
<p>To make moving between the two worlds easier we want to make them as similar as possible. Is the HTML divided into header, content, and footer? Then make sure that’s the three major parts of your CSS as well. Have you put the navigation above your header in the HTML? Then order it like that in the CSS as well! Any other structure makes moving from the HTML to the CSS much harder. You might be able to find all font manipulations in one part of the CSS, but only if you know that this particular developer uses that exact scheme. No, let’s keep it simple.</p>
<p>Here’s a simple example where we just order the selectors:</p>
<p>#header { &#8230; }<br />
h1 { &#8230; }<br />
h2 { &#8230; }<br />
#content { &#8230; }<br />
p { &#8230; }<br />
em { &#8230; }<br />
strong { &#8230; }</p>
<p>When grouping several styles into one definition I just put the group above both of their specific styles. #header, #content comes before both #header and #content.</p>
<p><strong>Always use the “full path” to elements</strong></p>
<p>The above is very easy to get an overview of, but the experienced developer knows that very few sites are that easy. Something you often want is a way to define different styles to different parts of a page. Let’s say you want green links in the navigation, but want to keep them blue everywhere else.</p>
<p>For this we use sub selectors. The selector #navigation a lets you give all links inside your navigation another look. But let’s take that further. Why not always write the full path to your elements? Why not use #navigation ul li a instead? Doing this gives a developer looking at your code a lot of information about how the HTML and CSS belongs together.</p>
<p>Lets add that to the previous example:</p>
<p>#header { &#8230; }<br />
#header h1 { &#8230; }<br />
#header h2 { &#8230; }<br />
#content { &#8230; }<br />
#content p { &#8230; }<br />
#content p em { &#8230; }<br />
#content p strong { &#8230; }</p>
<p>This does change the meaning from before. Before we selected all the level two headers; now we only select headers inside of the header division. Extending each selector with a “path” has made our CSS rules more specific, and specific means more control for you.</p>
<p>This also makes for fewer new ids and classes; just specify the path to an element instead of adding a class for it. Don’t add a new class or id unless you really need to.</p>
<p>We still have the issue of “common styles”; styles that we want to apply to elements in different parts of the tree. Since they should be applied to all elements they don’t fit in the tree structure we’ve built. Instead we make a section in the beginning of the file (or a separate) with just “general styles”. Don’t add rules to this section if you only use them once in the document, you want as much of your code to be in “the tree” as possible.</p>
<p><strong>Indent your code cleverly</strong></p>
<p>To make the code even easier to understand I always add indentation (for those that don’t know that word: it means spacing in front of blocks of text). Indenting makes the tree structure we’re trying to build even clearer, you can easily find the major sections and dig down from there.</p>
<p>Lets add indention to you our example too:</p>
<p>#header { &#8230; }<br />
#header h1 { &#8230; }<br />
#header h2 { &#8230; }<br />
#content { &#8230; }<br />
#content p { &#8230; }<br />
#content p em { &#8230; }<br />
#content p strong { &#8230; }</p>
<p>Don’t take indentation too far. If you’re styling tables and using thead in the markup, but don’t change the style of it, you can skip that indentation level. Double indention just for the sake of it is just a waste of space.</p>
<p><strong>Special case: Templating</strong></p>
<p>We also need to deal with rules that only appear on some of our pages. Perhaps we want the home page to look somewhat different than the sub pages? We solve this by giving an id or class to the body element. Doing this lets me specify styles for just one specific page, and setting the id or class on body makes me able to change anything in the document based on that.</p>
<p>These page specific styles need a place in the tree too. Here I tend to break from the above scheme and put them together with the style they change. So body#page_home #header h1 is one step below #header h1 in the tree. That makes it easier to see all styles for a certain element, instead of scrolling back and fourth (like you need to do if you don’t remember your general styles). Keep your templates together with the style they change instead of completely separate.</p>
<p>If you want bigger changes, perhaps a totally different look on some pages, there’s no reason to group things according to the scheme above. Move them to a separate file instead.</p>
<p><strong>Each declaration on its own line</strong></p>
<p>Indentation combined with full paths makes some lines rather long. This means that putting all declarations on one line will force you to scroll horizontally, something we already avoid on our sites. The simplest way to prevent horizontal scrolling is to use one declaration per line, so that’s what the tree method uses.</p>
<p><strong>… in alphabetic order</strong></p>
<p>Grouping of properties is another issue. I’ve seen grouping schemes based on all sorts of things; from splitting things into “positioning”, colors, and fonts, to people adding their properties completely randomly. I’ve chosen to just order them alphabetically. It’s one of the few methods that bring some order while still being simple enough. I’ve seen total beginners do this by themselves; something I believe is a good argument for it. It’s intuitive.</p>
<p>A simple example to illustrate:</p>
<p>#content {<br />
  color: Blue;<br />
  font: 3.4em Arial, sans-serif;<br />
  margin: 0.5em;<br />
}</p>
<p>One complaint I’ve heard on this method is that it splits up things that belong together. People tend to keep position: absolute and left: 0 together, just to name one such pairing. It annoyed me at first too, but declaration blocks rarely contain more than 10 declarations, and the alphabetic order still makes them easy to find. Also, why handle position different than float and margin?</p>
<p>That’s it! By following a few simple rules you can get a CSS-file that’s easier to overview, a file that you proudly can give away to the next developer. I can praise its existence all day, but you’re the judge of whether it works or not. Why not give it a try in your next project?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdesign-tricks.com/how-to-structure-large-css-files/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CSS3 and Its Adversaries</title>
		<link>http://www.webdesign-tricks.com/css3-and-its-adversaries/</link>
		<comments>http://www.webdesign-tricks.com/css3-and-its-adversaries/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 15:06:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://www.webdesign-tricks.com/?p=666</guid>
		<description><![CDATA[One of the amazing things about the development of web technologies is that they were relatively anarchic. Unlike the development of traditional GUI systems, which were created behind the closed doors of academic institutions like Xerox’s PARC and later developed further by products such as Apple’s original Macintosh, the Web evolved in an open and, [...]]]></description>
			<content:encoded><![CDATA[<p>One of the amazing things about the development of web technologies is that they were relatively anarchic. Unlike the development of traditional GUI systems, which were created behind the closed doors of academic institutions like Xerox’s PARC and later developed further by products such as Apple’s original Macintosh, the Web evolved in an open and, for lack of a better term, amateurish fashion. Although we can debate the benefits of one form of evolution over another, few argue that the Web isn’t a platform for incredible innovation, proving that either evolutionary method can push the development of such technologies in interesting and useful new directions.</p>
<p>As with all technologies, CSS is designed to solve a particular use case: separating the presentation of content from the structure of the content itself and reforming it to new presentations easily. However, CSS is not the only technology designed to solve this same use case. One notable competitor is XSL-FO, heavily used in the publishing industries for print layouts.</p>
<p>XSL-FO is a self-contained, unified, presentational markup language. This means that an XSL-FO document does not require external style sheets, scripts, or other apparatus to work as expected, and it is not considered semantically structured the way HTML or XHTML is. It is most often used to create print documents and is specifically tailored for paged media. A typical workflow involving XSL-FO would look something like this:</p>
<p>1. The XML document (such as DocBook, used in publishing contexts) is created.</p>
<p>2. The XML document is passed through an Extensible Style Sheet Transformation (XSLT) to convert the XML into XSL-FO.</p>
<p>3. The XSL-FO is passed through an “FO Processor”—software intended to convert the presentational document to another (potentially binary) format. The usual output is some press-ready format, such as PDF or PostScript.</p>
<p>XSL-FO contrasts with CSS in that it is a markup language, and all of the presentational data is contained within element attributes. It is not semantic at all, nor is it modular. It is a transition format between XML and some other format, and isn’t intended to be worked with by itself without some sort of programmatic capabilities on either end of the process (such as XSLT and software to convert to PDF).</p>
<p>The question is at what point in the advancement of CSS does XSL-FO become obsolete? With improvements in the specification around web fonts and print media, all the components for a full-featured print styling mechanism are coming into place. All that remains is a parser to convert your markup into a press-ready format such as PDF or PostScript. Printing your markup directly from a CSS style sheet instead of doing all that XSL-FO transformation means one less step in the process, and it leverages the opportunity to use external style sheets and skills that you already know to write manually, if that is needed or desired.</p>
<p>Another open question among web technologists concerns the CSS selection model. In CSS3, the ways in which elements can be targeted by CSS rules has been extracted into its own module called CSS3 Selectors. As you know, CSS’s notion of selectors originated in the first version of the specification, first published in 1996. However, in 1999 the W3C standardized a similar technology intended to be used to address parts of an XML document that provided much more granular control over which parts of the document were selected. This technology is called the XML Path Language, or XPath.</p>
<p>Today, the earliest versions of XPath still give XPath authors greater specificity over which parts of an XML document they wish to address than even the latest CSS3 Selectors draft. Many developers wonder, then, if such a precise language exists already, why is the CSS3 Selectors draft not incorporating more of it?</p>
<p>Some believe that XPath’s syntax is too complicated. A common selection such as “all
<p> elements” is extremely intuitive using CSS (the selector is simply a p) and in XPath it is not (to achieve the same effect, the XPath expression you need to use is //p).</p>
<p>On the other hand, with new CSS constructions such as div#content — div:not(p:nth-of-type(3)a[href]), CSS Selectors can become frustratingly complex as well. What is an appropriate balance between simplicity and power? This is a debate that rages on to this day.</p>
<p>Other parts of CSS are taking the opposite route; rather than developing their own syntax and capabilities, they are taking on the behavior and terminology of other technologies. At the time of this writing, the proposed CSS3 modules for CSS Animations and Transitions was accepted to the standards track by the W3C. These modules incorporate SVG-like capabilities. More to the point, they are so similar that they can be thought of as a CSS interface to SVG graphical capability. Of course, CSS can be applied to SVG markup, so clearly there is some opportunity there for web authors to leverage their CSS skills in SVG elements.</p>
<p>In this case, the ubiquity of CSS is helping to promote and standardize the capabilities developed by other technologies. Since there are so many more knowledgeable CSS developers than there are SVG developers, it makes sense to utilize your existing familiarity to push the envelope of what is technically possible.</p>
<p>However, this path is not without its concerns. Although some would argue that creating more than one way to do something is a good thing, others argue that creating too many different ways to accomplish the same task fragments a standard and undermines its usefulness. Since many modern browsers support SVG today, the question becomes why not promote its use as is?</p>
<p>A further question that comes up is related to the technicality of the implementation itself. SVG is, a “thing” that can be referenced and re-purposed as a form of content. It is ultimately a language that describes building blocks of visual things. When you put the pieces together, you can create ever more complex graphical objects. On the other hand, CSS requires the use of a different thing; by itself, a style sheet doesn’t do anything.</p>
<p>These examples are the product of nothing more magical than developers like you playing around with the building blocks that we have today; such academic experimentation is the best thing you can do to expand your skills. When you run into a problem, ask yourself if you can use an existing building block—a CSS property or particular browser feature—to solve it, or if you need a new building block altogether. If you do need to create something new, since you’ve now imagined what it might be, tell other people what you need or, if you can, build it yourself.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdesign-tricks.com/css3-and-its-adversaries/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>5 Alternative And Tiny CSS Grid Systems</title>
		<link>http://www.webdesign-tricks.com/5-alternative-and-tiny-css-grid-systems/</link>
		<comments>http://www.webdesign-tricks.com/5-alternative-and-tiny-css-grid-systems/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 13:55:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://www.webdesign-tricks.com/?p=655</guid>
		<description><![CDATA[CSS grid system is one tool that facilitates the work of web designers and web developers to develop a website. Advantage of using CSS grid system is you can reduce development time. Grids also provide uniformity and consistency in the placement of HTML elements.
Do you want to know more about CSS Frameworks and grid system? [...]]]></description>
			<content:encoded><![CDATA[<p>CSS grid system is one tool that facilitates the work of web designers and web developers to develop a website. Advantage of using CSS grid system is you can reduce development time. Grids also provide uniformity and consistency in the placement of HTML elements.</p>
<p>Do you want to know more about CSS Frameworks and grid system? If yes, then you may want to read our previous article that talk about useful CSS Frameworks.</p>
<p>Today, we are going to look into 5 more CSS Grid Systems that are tiny but worth a look.</p>
<p><a href="http://code.google.com/p/css-boilerplate/"><strong>1. CSS Boiler Plate Grid</strong></a></p>
<p>As one of the original authors of Blueprint CSS I’ve decided to re-factor my ideas into a stripped down framework which provides the bare essentials to begin any project. This framework will be lite and strive not to suggest un-semantic naming conventions. You’re the designer and your craft is important.</p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/css11.jpg" alt="css1" title="css1" width="500" height="299" class="alignleft size-full wp-image-656" /></p>
<p><a href="http://code.google.com/p/the-golden-grid/"><strong>2. Golden Grid CSS</strong></a></p>
<p>The Golden Grid is a web grid system. It ’s a product of the search for the perfect modern grid system. It ’s meant to be a CSS tool for grid based web sites.</p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/css21.jpg" alt="css2" title="css2" width="500" height="301" class="alignleft size-full wp-image-657" /></p>
<p><a href="http://www.spry-soft.com/grids/"><strong>3. Variable Grid System</strong></a></p>
<p>The variable grid system is a quick way to generate an underlying CSS grid for your site. The CSS generated file is based on the 960 Grid System.</p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/css31.jpg" alt="css3" title="css3" width="500" height="256" class="alignleft size-full wp-image-658" /></p>
<p><a href="http://www.gridsystemgenerator.com/"><strong>4. Grid System Generator</strong></a></p>
<p>This tool generates grid systems in valid css / xhtml for rapid prototyping, development and production environments. The grid system generators offer the ability to customize the width, no. of columns and margin(s) to allow more flexibility for various designs.</p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/css41.jpg" alt="css4" title="css4" width="500" height="297" class="alignleft size-full wp-image-659" /></p>
<p><a href="http://www.1kbgrid.com/"><strong>5. The 1kb CSS Grid</strong></a></p>
<p>Other CSS frameworks try to do everything—grid system, style reset, basic typography, form styles. But complex systems are, well, complex. Looking for a simple, lightweight approach that doesn’t require a PhD? Meet The 1KB CSS Grid.</p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/css51.jpg" alt="css5" title="css5" width="500" height="204" class="alignleft size-full wp-image-660" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdesign-tricks.com/5-alternative-and-tiny-css-grid-systems/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Design Trends (Predictions) in 2010</title>
		<link>http://www.webdesign-tricks.com/design-trends-predictions-in-2010/</link>
		<comments>http://www.webdesign-tricks.com/design-trends-predictions-in-2010/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 17:50:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Showcase]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.webdesign-tricks.com/?p=608</guid>
		<description><![CDATA[As we are stepping in a new decade, I can foresee that web design in 2010 is going to be fun and filled with experimental works. With the new CSS3 and HTML5, designers and developers are trying to utilize the new features to create impressive designs. Sketchy and large background styles are fading out. Serif [...]]]></description>
			<content:encoded><![CDATA[<p>As we are stepping in a new decade, I can foresee that web design in 2010 is going to be fun and filled with experimental works. With the new CSS3 and HTML5, designers and developers are trying to utilize the new features to create impressive designs. Sketchy and large background styles are fading out. Serif fonts and texturized background will be popular. Thanks to CSS3, we are going to see a lot of rounded corners, RGBA transparency, and drop shadows. With the rise of smart phones, mobile web design is going to pick up this year.</p>
<p><strong>Serif Fonts</strong></p>
<p>In the last decade, most web sites were designed in either Verdana or Arial (sans-serif fonts), but that is going to change in this new decade. Serif fonts will get more attention. </p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends1.jpg" alt="trends1" title="trends1" width="491" height="209" class="alignleft size-full wp-image-595" /></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends2.jpg" alt="trends2" title="trends2" width="491" height="211" class="alignleft size-full wp-image-596" /></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends3.jpg" alt="trends3" title="trends3" width="492" height="211" class="alignleft size-full wp-image-597" /></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends4.jpg" alt="trends4" title="trends4" width="491" height="209" class="alignleft size-full wp-image-598" /></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends5.jpg" alt="trends5" title="trends5" width="491" height="211" class="alignleft size-full wp-image-599" /></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends6.jpg" alt="trends6" title="trends6" width="492" height="210" class="alignleft size-full wp-image-600" /></p>
<p><strong>Big Headings</strong></p>
<p>Big headings in header (as part of design interface) will gain more popularity in 2010.</p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends7.jpg" alt="trends7" title="trends7" width="492" height="211" class="alignleft size-full wp-image-601" /></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends8.jpg" alt="trends8" title="trends8" width="492" height="211" class="alignleft size-full wp-image-602" /></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends9.jpg" alt="trends9" title="trends9" width="490" height="212" class="alignleft size-full wp-image-603" /></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends10.jpg" alt="trends10" title="trends10" width="491" height="210" class="alignleft size-full wp-image-604" /></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends11.jpg" alt="trends11" title="trends11" width="492" height="210" class="alignleft size-full wp-image-605" /></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends12.jpg" alt="trends12" title="trends12" width="492" height="211" class="alignleft size-full wp-image-606" /></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends13.jpg" alt="trends13" title="trends13" width="492" height="212" class="alignleft size-full wp-image-607" /></p>
<p><strong>Custom Font Embedding</strong></p>
<p>As Typekit is expanding their font list and more free quality fonts are available (e.g. FontSquirrel, OpenType, and The League of MoveableType), I think more people will use custom font embedding in the coming year.</p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends14.jpg" alt="trends14" title="trends14" width="492" height="210" class="alignleft size-full wp-image-609" /></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends15.jpg" alt="trends15" title="trends15" width="492" height="211" class="alignleft size-full wp-image-610" /></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends16.jpg" alt="trends16" title="trends16" width="492" height="211" class="alignleft size-full wp-image-611" /></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends17.jpg" alt="trends17" title="trends17" width="492" height="210" class="alignleft size-full wp-image-612" /></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends18.jpg" alt="trends18" title="trends18" width="492" height="210" class="alignleft size-full wp-image-613" /></p>
<p><strong>Texturized Background</strong></p>
<p>The big background trend is going to be gradually out-of-date and be replaced with subtle and texturized (particularly the light noise) background.</p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends19.jpg" alt="trends19" title="trends19" width="492" height="211" class="alignleft size-full wp-image-614" /></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends20.jpg" alt="trends20" title="trends20" width="492" height="209" class="alignleft size-full wp-image-615" /></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends21.jpg" alt="trends21" title="trends21" width="492" height="210" class="alignleft size-full wp-image-616" /></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends22.jpg" alt="trends22" title="trends22" width="492" height="211" class="alignleft size-full wp-image-617" /></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends23.jpg" alt="trends23" title="trends23" width="493" height="211" class="alignleft size-full wp-image-618" /></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends24.jpg" alt="trends24" title="trends24" width="492" height="211" class="alignleft size-full wp-image-619" /></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends25.jpg" alt="trends25" title="trends25" width="492" height="211" class="alignleft size-full wp-image-620" /></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends26.jpg" alt="trends26" title="trends26" width="492" height="211" class="alignleft size-full wp-image-621" /></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends27.jpg" alt="trends27" title="trends27" width="492" height="211" class="alignleft size-full wp-image-622" /></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends28.jpg" alt="trends28" title="trends28" width="492" height="211" class="alignleft size-full wp-image-623" /></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends29.jpg" alt="trends29" title="trends29" width="492" height="211" class="alignleft size-full wp-image-624" /></p>
<p><strong>Minimalist &#038; Grid</strong></p>
<p>Minimalist and grid designs are not today’s new. They have been popular for the past couple years and I think it will continue to grow in 2010. Check out my previous post for more minimalist sites.</p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends30.jpg" alt="trends30" title="trends30" width="492" height="211" class="alignleft size-full wp-image-626" /></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends31.jpg" alt="trends31" title="trends31" width="492" height="210" class="alignleft size-full wp-image-627" /></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends32.jpg" alt="trends32" title="trends32" width="492" height="211" class="alignleft size-full wp-image-628" /></p>
<p><strong>CSS3 New Features</strong></p>
<p>Although CSS3 is not fully supported by all browsers yet, but a lot of designers are experimenting with the new features such as: rounded corners, multi background images, multi-column, border images, and animation. The following sites show good implementation of CSS3’s new features with fallbacks. So, we will see more and more CSS experimental works.</p>
<p><strong>CSS3 Animation</strong></p>
<p>Neutron Creations’s blog uses webkit-transform to spin the circle graphics (view it with Mac Chrome or Safari). If your browser doesn’t support webkit-transform, it will just show the static circles.</p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends38.jpg" alt="trends38" title="trends38" width="492" height="209" class="alignleft size-full wp-image-629" /></p>
<p><strong>Rounded Borders and Box Shadows</strong></p>
<p>Border-radius and box-shadow are the most commonly used CSS3 properties.</p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends39.jpg" alt="trends39" title="trends39" width="492" height="210" class="alignleft size-full wp-image-630" /></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends40.jpg" alt="trends40" title="trends40" width="492" height="209" class="alignleft size-full wp-image-631" /></p>
<p><strong>Text Shadow</strong></p>
<p>A lot of designers are using text shadow to add more depth to text.</p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends43.jpg" alt="trends43" title="trends43" width="492" height="211" class="alignleft size-full wp-image-632" /></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends44.jpg" alt="trends44" title="trends44" width="492" height="210" class="alignleft size-full wp-image-633" /></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends46.jpg" alt="trends46" title="trends46" width="492" height="211" class="alignleft size-full wp-image-634" /></p>
<p><strong>RBGA &#038; Opacity</strong></p>
<p>RGBA makes setting background opacity easier. I think more designers are going to take advantage of this feature to create semi-transparent effect.</p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends47.jpg" alt="trends47" title="trends47" width="492" height="209" class="alignleft size-full wp-image-635" /></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends48.jpg" alt="trends48" title="trends48" width="492" height="208" class="alignleft size-full wp-image-636" /></p>
<p><strong>Mobile Design</strong></p>
<p>Since the release of iPhonein 2007, everybody is talking about mobile design. Now with more smart phones that support full CSS and Javascript, mobile design is definitely going to be the future of web design. A lot of sites(ranging from design agencies to editorial sites to web apps) are offering a mobile version. Below are some great examples (screenshots are captured with iPhone).</p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends50.jpg" alt="trends50" title="trends50" width="492" height="471" class="alignleft size-full wp-image-637" /></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends51.jpg" alt="trends51" title="trends51" width="492" height="471" class="alignleft size-full wp-image-638" /></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends52.jpg" alt="trends52" title="trends52" width="492" height="471" class="alignleft size-full wp-image-639" /></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends54.jpg" alt="trends54" title="trends54" width="492" height="472" class="alignleft size-full wp-image-640" /></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends53.jpg" alt="trends53" title="trends53" width="492" height="470" class="alignleft size-full wp-image-641" /></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends55.jpg" alt="trends55" title="trends55" width="492" height="471" class="alignleft size-full wp-image-642" /></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends56.jpg" alt="trends56" title="trends56" width="492" height="470" class="alignleft size-full wp-image-643" /></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/trends57.jpg" alt="trends57" title="trends57" width="492" height="471" class="alignleft size-full wp-image-644" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdesign-tricks.com/design-trends-predictions-in-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Top 5 HTML Coding Preferences</title>
		<link>http://www.webdesign-tricks.com/my-top-5-html-coding-preferences/</link>
		<comments>http://www.webdesign-tricks.com/my-top-5-html-coding-preferences/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 15:25:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://www.webdesign-tricks.com/?p=491</guid>
		<description><![CDATA[Every coder has his/her own coding style based on personal preferences. Not all of us markup the document in a same way. Some decide to choose one element while other coders prefer some other solution. In this article I will list 5 of my most usual coding preferences and explain my reasons.
Unordered list vs any [...]]]></description>
			<content:encoded><![CDATA[<p>Every coder has his/her own coding style based on personal preferences. Not all of us markup the document in a same way. Some decide to choose one element while other coders prefer some other solution. In this article I will list 5 of my most usual coding preferences and explain my reasons.</p>
<p><strong>Unordered list vs any other element in navigation</strong></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/css1.jpg" alt="css1" title="css1" width="500" height="81" class="aligncenter size-full wp-image-492" /></p>
<p>This is very popular way to markup navigation items for obvious reason: it is a list of links. That alone should be reason enough to choose this kind of marking up the content and go an extra mile to remove the list&#8217;s default styling and apply something more suitable. </p>
<p>One more benefit that this markup provides a bunch of elements to work with using CSS. You have a parent list element and each link is also wrapped inside a list item. It&#8217;s more than you can wish for <img src='http://www.webdesign-tricks.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/scripts1.jpg" alt="scripts1" title="scripts1" width="500" height="83" class="aligncenter size-full wp-image-493" /></p>
<p><strong>Paragraph vs list in breadcrumbs</strong></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/css2.jpg" alt="css2" title="css2" width="500" height="145" class="aligncenter size-full wp-image-494" /></p>
<p>This is open for debate and please let us all know if you have another opinion in comments. I personally like to use the following code pattern for breadcrumb trail (however I don&#8217;t always use the » symbol):</p>
<p id="breadcrumbs"><a href="#">Home</a> » <a href="#">About Us</a> » <a href="#">History</a></p>
<p>Breadcrumb trail is a hierarchical path to a certain page. One of the logical thing to do is using nested lists to display this hierarchy. But what is a point of having nested lists if you have only one item in each list? More so, I really feel that breadcrumb trail should be presented linear.</p>
<p><strong>Button vs input</strong></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/css3.jpg" alt="css3" title="css3" width="500" height="82" class="aligncenter size-full wp-image-496" /></p>
<p>I can&#8217;t remember when was the last time that I used input type=&#8221;submit&#8221;. I abandoned that element a long ago. A couple of reasons why button element rock and input type=&#8221;submit&#8221; doesn&#8217;t: Button is its own element, that makes it easier to identify in the source code, easier to select with css (not all browsers out there support attribute selectors). It also allows use to put child elements inside it so it expands our styling possibilities.</p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/css4.jpg" alt="css4" title="css4" width="500" height="54" class="aligncenter size-full wp-image-495" /></p>
<p><strong>Ordered list vs unordered list in comments</strong></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/css5.jpg" alt="css5" title="css5" width="500" height="157" class="aligncenter size-full wp-image-497" /></p>
<p>Lists are great. Really. There are 3 different types of lists (ordered, unordered and definition list) and each has its purpose. If you have doubts when to use ordered and when to use unordered try to shuffle the items randomly and see if the content still makes sense. Comments are somewhat of a textbook example of using ordered list because of their chronological, ascending linear nature. Each comment comes with a certain time stamp so comments must appear in that order.</p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/scripts2.jpg" alt="scripts2" title="scripts2" width="500" height="214" class="aligncenter size-full wp-image-498" /></p>
<p><strong>Div vs any other element in wrapping label / input field</strong></p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/css6.jpg" alt="css6" title="css6" width="500" height="103" class="aligncenter size-full wp-image-499" /></p>
<p>What is the best choice of element to be used as a parent for input field and its related label?</p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/scripts3.jpg" alt="scripts3" title="scripts3" width="500" height="66" class="aligncenter size-full wp-image-500" /></p>
<p>There has been some discussions on this site a while ago about the proper markup. After a while I settled with using DIVs:</p>
<div>
	<label for="contactName">Your Name</label></p>
<input type="text" name="contactName" id="contactName" class="field"  />
</div>
<p>The label and associated form control can be described as a section. DIV element has very wide semantic quality and it fits into every situation.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdesign-tricks.com/my-top-5-html-coding-preferences/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
