<?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/category/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>Coding Clean and Semantic Templates</title>
		<link>http://www.webdesign-tricks.com/coding-clean-and-semantic-templates/</link>
		<comments>http://www.webdesign-tricks.com/coding-clean-and-semantic-templates/#comments</comments>
		<pubDate>Sun, 24 Jan 2010 09:20:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Templates]]></category>

		<guid isPermaLink="false">http://www.webdesign-tricks.com/?p=582</guid>
		<description><![CDATA[If you are the guy who uses
 tag for everything, this post is for you. It focuses on how you can write clean HTML code by using semantic markups and minimize the use of
 tag. Have you ever edited someone’s templates, don’t those messy tags drive you crazy? Not only writing clean templates can benefit [...]]]></description>
			<content:encoded><![CDATA[<p>If you are the guy who uses
<div> tag for everything, this post is for you. It focuses on how you can write clean HTML code by using semantic markups and minimize the use of
<div> tag. Have you ever edited someone’s templates, don’t those messy tags drive you crazy? Not only writing clean templates can benefit yourself, but your team as well. It will save you time when you have to debug and edit (particularly the large projects).</p>
<p><strong>1. Remove The Unnecessary
<div> Tags</strong></p>
<p>I’ve seen a lot of people wrap a
<div> tag around the<br />
<form> or
<ul> menu list. Why create an extra
<div> tag that you don’t need? You can achieve the same result by applying the CSS rules to the selector.</p>
<p><strong>Example 1:</strong></p>
<p>The example below shows how you can drop the
<div> tag and declare the styling to the form selector.</p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/coding1.jpg" alt="coding1" title="coding1" width="500" height="271" class="alignleft size-full wp-image-583" /></p>
<p><strong>Example 2:</strong></p>
<p>Sometimes we wrap the content with an extra
<div> tag strictly for spacing purposes. The example on the left uses a
<div class="sidebox"> to create margin space in between the boxes. But if each box has a heading (ie.<br />
<h4>), we can simply apply the margin space to the h4 selector and drop the extra
<div class="sidebox"> tag.</p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/coding2.jpg" alt="coding2" title="coding2" width="481" height="276" class="alignleft size-full wp-image-584" /></p>
<p><strong>2. Use Semantic Markups</strong></p>
<p>You should always use semantic markups to code HTML documents (ie.<br />
<h1> for headings,
<p> for paragraph text, and
<ul> for list items). So, even when the CSS is not presented nor supported, your document still makes sense.</p>
<p><strong>Example:</strong></p>
<p>The image below compares the rendering differences between
<div> markups and semantic markups with no css supported.</p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/coding3.jpg" alt="coding3" title="coding3" width="482" height="493" class="alignleft size-full wp-image-585" /></p>
<p><strong>3. Minimize The Use of
<div> Tags</strong></p>
<p>Have you seen the messy templates where
<div> tags are everywhere and they drive you crazy? Have you ever missed a closing </div>
<p> tag or have an extra opening
<div> tag messing up the entire layout? I’m sure most developers have experienced it before. So, you should always minimize the use of
<div> tag if possible. It will make debugging and editing easier.</p>
<p><strong>Example 1:</strong></p>
<p>Instead of using
<div> tag for breadcrumb navigation, it makes more sense to use
<p> tag.</p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/coding4.jpg" alt="coding4" title="coding4" width="481" height="140" class="alignleft size-full wp-image-586" /></p>
<p><strong>Example 2:</strong></p>
<p>The following example shows how I can use CSS to cut down two
<div> tags by replacing with one <span> tag. They both produce the same layout.</p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/coding5.jpg" alt="coding5" title="coding5" width="481" height="511" class="alignleft size-full wp-image-587" /></p>
<p><strong>4. Format (Indent) Your Code</strong></p>
<p>You should always format your source code (ie. indent your nested elements) so it is easier to read and debug. If you have Adobe Dreamweaver, you can easily format the code by using the Commands > Apply Source Formatting (from the application menu).</p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/coding6.jpg" alt="coding6" title="coding6" width="481" height="212" class="alignleft size-full wp-image-588" /></p>
<p><strong>5. Comment The Closing </div>
<p> Tags</strong></p>
<p>When coding for platform templates (ie. WordPress themes), the template is most likely splitted into several files: index.php, header.php, sidebar.php, and footer.php. Hence, you should always make a comment for the closing </p></div>
<p> tags so you won’t get lost. For example, when I see </p></div>
<p><!-- /wrapper -->, I know it is the closing tag for
<div id="wrapper">.</p>
<p><strong>Example:</strong></p>
<p>I usually insert a HTML comment tag right after the closing </p></div>
<p> tag. I use the forward slash to indicate it is the closing tag.</p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/coding7.jpg" alt="coding7" title="coding7" width="481" height="133" class="alignleft size-full wp-image-589" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdesign-tricks.com/coding-clean-and-semantic-templates/feed/</wfw:commentRss>
		<slash:comments>1</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>
		<item>
		<title>Is CSS Image Replacement OK for SEO?</title>
		<link>http://www.webdesign-tricks.com/is-css-image-replacement-ok-for-seo/</link>
		<comments>http://www.webdesign-tricks.com/is-css-image-replacement-ok-for-seo/#comments</comments>
		<pubDate>Sun, 03 Jan 2010 02:41:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[PAGERANK]]></category>

		<guid isPermaLink="false">http://www.webdesign-tricks.com/?p=458</guid>
		<description><![CDATA[CSS Image Replacement is a web design technique that calls a logo or specific image via the CSS stylesheet, while hiding some text behind it on the web page.
The normal code for a logo would look like this:
 



&#60;h1 class=&#8221;logo&#8221;&#62;
&#60;img src=&#8221;images/logo.jpg&#8221; alt=&#8221;logo name&#8221; /&#62;
&#60;/h1&#62;



 
Using the CSS Replacement technique, first you would create a CSS class that [...]]]></description>
			<content:encoded><![CDATA[<p>CSS Image Replacement is a web design technique that calls a logo or specific image via the CSS stylesheet, while hiding some text behind it on the web page.</p>
<p>The normal code for a logo would look like this:</p>
<p> </p>
<table border="0" width="500">
<tbody>
<tr>
<td bordercolor="#000000"><span class="style1">&lt;h1 class=&#8221;logo&#8221;&gt;</p>
<p>&lt;img src=&#8221;images/logo.jpg&#8221; alt=&#8221;logo name&#8221; /&gt;</p>
<p>&lt;/h1&gt;</span></td>
</tr>
</tbody>
</table>
<p> </p>
<p>Using the CSS Replacement technique, first you would create a CSS class that would look like this:</p>
<p> </p>
<table border="0" width="500">
<tbody>
<tr>
<td bordercolor="#000000">h1.logo {</p>
<p>width: 300px; height: 50px;</p>
<p>background: url(images/logo.jpg);</p>
<p>text-indent: -9999px;</p>
<p>}</td>
</tr>
</tbody>
</table>
<p> </p>
<p>And then you would call the logo on the web page with the following code:</p>
<p> </p>
<table border="0" width="500">
<tbody>
<tr>
<td bordercolor="#000000">&lt;h1 class=&#8221;main-logo&#8221;&gt;Logo name&lt;/h1&gt;</td>
</tr>
</tbody>
</table>
<p> </p>
<p>The visual result would be the same in both cases, but with the CSS Image Replacement you would have the “logo name” text hidden in the page.</p>
<p><strong>Why? Why Not?</strong></p>
<p>Why did people started using this technique? Mainly because it makes the logo more accessible. Search bots, for example, will be able to know what it is about (they can read text, but not images).</p>
<p>Why there is some controversy regarding this technique, though, if it makes the web design more accessible? Simply because it can be exploited for SEO purposes. Hidden text is a very old SEO trick, and today most search engines penalize it.</p>
<p>CSS Image Replacement in theory is a legitimate reason to hide text, but it is not always clear if Google and the other search engines are fine with it.</p>
<p><strong>What Does Google Say?</strong></p>
<p>Matt Cutts, who is head of Google’s Web Spam team, once wrote:</p>
<p style="text-align: center;">&#8220;If you’re straight-out using CSS to hide text, don’t be surprised if that is called spam. I’m not saying that mouseovers or DHTML text or have-a-logo-but-also-have-text is spam; I answered that last one at a conference when I said “imagine how it would look to a visitor, a competitor, or someone checking out a spam report. If you show your company’s name and it’s Expo Markers instead of an Expo Markers logo, you should be fine. If the text you decide to show is ‘Expo Markers cheap online discount buy online Expo Markers sale …’ then I would be more cautious, because that can look bad.&#8221;</p>
<p>So according to him it depends on how you use the technique. He does mention that it can be a reason to get your website flagged for spam though.</p>
<p><strong>Who Uses It?</strong></p>
<p>Apart from checking what people are saying about it, it would be nice to see who, among the SEO experts, is actually using the technique, right?</p>
<p>Rand Fishkin from SEOMoz seems to be a big proponent of that. He uses CSS Image Replacement on the logo of his popular website, and he also wrote a post once defending the idea behind it. </p>
<p>Aaron Wall from SEOBook, on the other hand, does not use it. </p>
<p>Wikipedia seems to be using CSS Image Replacement, while Google does not use it on any of its properties.</p>
<p><strong>What Do You Think?</strong></p>
<p>Do you think that CSS Image Replacement could cause SEO problems to a site using it? Obviously we are considering a site using it legitimately, and not abusing it. Let us know what you think and leave a vote on our poll too (RSS readers might need to visit the post to see the poll).</p>
<p><img src="http://www.webdesign-tricks.com/wp-content/uploads/2010/01/googlepolll.jpg" alt="googlepolll" title="googlepolll" width="250" height="217" class="aligncenter size-full wp-image-461" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdesign-tricks.com/is-css-image-replacement-ok-for-seo/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ultimate CSS List Creation Methods and Examples</title>
		<link>http://www.webdesign-tricks.com/ultimate-css-list-creation-methods-and-examples/</link>
		<comments>http://www.webdesign-tricks.com/ultimate-css-list-creation-methods-and-examples/#comments</comments>
		<pubDate>Mon, 28 Dec 2009 15:11:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS List]]></category>

		<guid isPermaLink="false">http://www.webdesign-tricks.com/?p=358</guid>
		<description><![CDATA[CSS list is very useful and vital in web design.
There are many uses of Unordered list 
 such as horizontal navigation, vertical navigation, creating a box or any kind of list. In this post we will show you some really useful CSS list methods that you can use to create horizontal, vertical list or CSS [...]]]></description>
			<content:encoded><![CDATA[<p>CSS list is very useful and vital in web design.</p>
<p>There are many uses of Unordered list </p>
<ul> such as horizontal navigation, vertical navigation, creating a box or any kind of list. In this post we will show you some really useful CSS list methods that you can use to create horizontal, vertical list or CSS list box.  You can download all the methods used in this post in single zipped file.</p>
<p>Before we create anything lets see how CSS lists are used:<br />
<img class="aligncenter size-full wp-image-359" title="list1" src="http://www.webdesign-tricks.com/wp-content/uploads/2009/12/list1.jpg" alt="list1" width="500" height="383" /></p>
<p><a href="http://desizntech.info/wp-content/plugins/download-monitor/download.php?id=13"><strong> Download CSS List Files</strong></a></p>
<p>For every list here is the basic HTML layout</p>
<p><img class="aligncenter size-full wp-image-360" title="list2" src="http://www.webdesign-tricks.com/wp-content/uploads/2009/12/list2.jpg" alt="list2" width="580" height="434" /></p>
<p>The first CSS propery we are going to use is inline. This is the CSS default display property and will generate an inline box . There will be no break before or after and flowed as a single inline box. In simple words, they will displayed in one line, rather than two line.<br />
Here are the CSS we are applying the create the first horizontal list</p>
<p><img class="aligncenter size-full wp-image-361" title="list3" src="http://www.webdesign-tricks.com/wp-content/uploads/2009/12/list3.jpg" alt="list3" width="580" height="279" /></ul>
<p>Here is how it should look like after applying the CSS  id=”horizontal_list” to the HTML<br />
<img class="aligncenter size-full wp-image-362" title="list4" src="http://www.webdesign-tricks.com/wp-content/uploads/2009/12/list4.jpg" alt="list4" width="500" height="205" /></p>
<p><strong>display:inline-block</strong></p>
<p>The same result also can be achived by using display:inline-block. The difference is that inline block generates a block box and all the properties as block can be applied. Here is a visual representation of the difference:<br />
<img class="aligncenter size-full wp-image-363" title="list5" src="http://www.webdesign-tricks.com/wp-content/uploads/2009/12/list5.jpg" alt="list5" width="500" height="201" /></p>
<p>Here is the CSS for second type of list ( height and width are left blank but can be applied if need.)<br />
<img class="aligncenter size-full wp-image-364" title="list6" src="http://www.webdesign-tricks.com/wp-content/uploads/2009/12/list6.jpg" alt="list6" width="500" height="272" /></p>
<p><strong>float:left</strong></p>
<p>Chris wrote a great post explaining what is float and how it works. One annoying thing about the floats is that you must declare the height or sometime the float has to cleared so the elements below won’t ride up on the side. Regardless, float is one of the most used method for for CSS list. By default the CSS <a href="http://www.w3schools.com/CSS/pr_list-style-type.asp">list-style-type</a> is circle. if you to remove it use list-style-type:none property. So, here is the CSS:</p>
<p><img class="aligncenter size-full wp-image-365" title="line7" src="http://www.webdesign-tricks.com/wp-content/uploads/2009/12/line7.jpg" alt="line7" width="580" height="347" /></p>
<p>Here is how it should look when the CSS is applied:<br />
<img class="aligncenter size-full wp-image-366" title="list7" src="http://www.webdesign-tricks.com/wp-content/uploads/2009/12/list7.jpg" alt="list7" width="500" height="202" /></p>
<p><strong>Vertical list</strong></p>
<p>Vertical list are easier to create, but we will show you two different techniques that are useful. First lets see the result and the CSS:</p>
<p><img class="aligncenter size-full wp-image-367" title="list8" src="http://www.webdesign-tricks.com/wp-content/uploads/2009/12/list8.jpg" alt="list8" width="500" height="317" /></p>
<p><img class="aligncenter size-full wp-image-368" title="list9" src="http://www.webdesign-tricks.com/wp-content/uploads/2009/12/list9.jpg" alt="list9" width="580" height="385" /></p>
<p><img class="aligncenter size-full wp-image-369" title="list10" src="http://www.webdesign-tricks.com/wp-content/uploads/2009/12/list10.jpg" alt="list10" width="580" height="439" /></p>
<p>The difference here is that list-style-image has a default distance from the image to the list text and it can not be changed besides inside and outside value. Whereas, using background and background-position the image can be moved left to right value (x value), up and down (y value). There are also some other value such as : top, bottom and more.</p>
<p><strong>Box using CSS List</strong></p>
<p>CSS list are also useful for creating box. Most commonly CSS box is used for the footer of websites. The trick behind creating a box is having a set width and height for each</p>
<li> element. We also use overflow:hidden property so any text won’t go out of the box . So here is the CSS:
<p><img class="aligncenter size-full wp-image-370" title="list11" src="http://www.webdesign-tricks.com/wp-content/uploads/2009/12/list11.jpg" alt="list11" width="520" height="544" /></p>
<p>The additional styles are in included file and here is how it should look like.<br />
<img class="aligncenter size-full wp-image-371" title="list12" src="http://www.webdesign-tricks.com/wp-content/uploads/2009/12/list12.jpg" alt="list12" width="500" height="149" /></li>
]]></content:encoded>
			<wfw:commentRss>http://www.webdesign-tricks.com/ultimate-css-list-creation-methods-and-examples/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
