<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><rss xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>CSS Globe | Web Standards Magazine</title><link>http://www.cssglobe.com/</link><description>Css Globe Articles</description><language>en-us</language><sy:updatePeriod xmlns:sy="http://purl.org/rss/1.0/modules/syndication/">hourly</sy:updatePeriod><sy:updateFrequency xmlns:sy="http://purl.org/rss/1.0/modules/syndication/">1</sy:updateFrequency><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/cssglobearticles" type="application/rss+xml" /><feedburner:emailServiceId>1631995</feedburner:emailServiceId><feedburner:feedburnerHostname>http://www.feedburner.com</feedburner:feedburnerHostname><item><title>CSS do's and dont's Part 2- Markup</title><link>http://feeds.feedburner.com/~r/cssglobearticles/~3/318968209/css-dos-and-donts-part-2-markup</link><pubDate>Tue, 24 Jun 2008 11:34:00 -0500</pubDate><guid isPermaLink="false">http://www.cssglobe.com/post/1960/css-dos-and-donts-part-2-markup</guid><description>&lt;p&gt;If you truly get into web standards you'll soon find out that the most important thing is - markup. A good, solid, well structured markup. Html, XTHML, tags, attributes, structure... That's what it's all about actually. We tie in the terms CSS and web standards. Term CSS has become almost a synonym for standards. I often use the term "css designer" or "css this", "css that" to quickly explain what methods and approach I am talking about. But the real truth is, CSS would mean NOTHING if your markup structure is wrong. Markup is the king.&lt;/p&gt;
&lt;h3&gt;Structuring a document&lt;/h3&gt;
&lt;p&gt;The key to web standards compliant document is it's structure. It must be meaningful and logical. Document should follow a certain flow and it must be readable and understandable without any css styling. &lt;br/&gt;
	Most documents have different sections (navigation, main content, side content, copyright area, contact area etc.) User, human or non-human. should be able to understand those sections as well as sections importance from the first look at it. The most important section should be as high up in the flow as possible, but importance of a certain section is also defined with heading tags (h1, h2, h3, h4, h5, h6). In a way &lt;a href="http://cssglobe.com/post/1213/how-to-use-headings-in-html" title="proper use of headings"&gt;headings define documents structure&lt;/a&gt;. &lt;/p&gt;
&lt;h3&gt;Structural and Presentational Tags&lt;/h3&gt;
&lt;p&gt;In web standards world you often hear a syntagm "separating presentation from content". What does it mean? Basically it means that no html elements should exist for presentation purpose only. You should try to avoid having empty divs for drop shadows or something similar. Let all your markup has its structural meaning and exist as a logical part of a document.&lt;/p&gt;
&lt;h3&gt;Tag choices&lt;/h3&gt;
&lt;p&gt;There are many tags to choose from and you should embrace that variety. Don't rely on divs alone for container elements. Sometimes a simple paragraph with some child spans or ems is enough to get what you want. We all use ordered and unordered lists, but we also have another type of lists that I don't see used that often - definition list. DL is ideal in many cases because of it's "2-dimensional" structure. Also why not use ADDRESS tag for contact info that we place in a footer? Take a pick!&lt;/p&gt;
&lt;h3&gt;Validation&lt;/h3&gt;
&lt;p&gt;Validation has its importance in analyzing your code. But validating alone doesn't mean that your document is built according to standards. You can have entire document made of divs with class names. That would validate, but would it be meaningful? Not to everyone, and certainly not to search engines.&lt;/p&gt;
&lt;h3&gt;Do&lt;/h3&gt;
&lt;ul&gt;
	&lt;li&gt;pay extra attention to document's structure. It's the most important thing.&lt;/li&gt;
	&lt;li&gt;think semantics, use tags in a meaningful order, create a logical html "flow".&lt;/li&gt;
	&lt;li&gt;use variety of tags, choose appropriate one for a certain type of content.&lt;/li&gt;
	&lt;li&gt;well, practice... try to think outside the box in order to achieve certain effect. &lt;/li&gt;
	&lt;li&gt; try to use as few html elements as possible for the same design effect, you'll feel better about yourself.&lt;/li&gt;
	&lt;li&gt; compromise in terms of design. Well up to a certain point that is. Sometimes it's better not to use certain design effect and have cleaner markup. &lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Don't &lt;/h3&gt;
&lt;ul&gt;
	&lt;li&gt;think that if something is valid it is automatically web standards compliant.&lt;/li&gt;
	&lt;li&gt;overuse certain tags, like divs.&lt;/li&gt;
	&lt;li&gt;use presentational tags, or at least keep it to the minimum. &lt;/li&gt;
	&lt;li&gt;don't avoid using certain elements thinking that they are not "web standards" (yes, I am talking about tables).&lt;/li&gt;
	&lt;li&gt;compromise in terms of markup. &lt;/li&gt;
&lt;/ul&gt;

		&lt;hr /&gt;&lt;p&gt;Copyright: &lt;a href="http://cssglobe.com"&gt;Css Globe&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/cssglobearticles?a=5u3y2I"&gt;&lt;img src="http://feeds.feedburner.com/~f/cssglobearticles?i=5u3y2I" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/cssglobearticles?a=4sNhli"&gt;&lt;img src="http://feeds.feedburner.com/~f/cssglobearticles?i=4sNhli" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/cssglobearticles?a=GOcN1i"&gt;&lt;img src="http://feeds.feedburner.com/~f/cssglobearticles?i=GOcN1i" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/cssglobearticles?a=11je1i"&gt;&lt;img src="http://feeds.feedburner.com/~f/cssglobearticles?i=11je1i" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/cssglobearticles/~4/318968209" height="1" width="1"/&gt;</description><feedburner:origLink>http://www.cssglobe.com/post/1960/css-dos-and-donts-part-2-markup</feedburner:origLink></item><item><title>Easiest Tooltip and Image Preview Using jQuery</title><link>http://feeds.feedburner.com/~r/cssglobearticles/~3/286304664/easiest-tooltip-and-image-preview-using-jquery</link><pubDate>Thu, 08 May 2008 15:40:00 -0500</pubDate><guid isPermaLink="false">http://www.cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery</guid><description>&lt;p&gt;I love &lt;a href="http://jquery.com"&gt;jQuery&lt;/a&gt; and the way it makes developer's life easier. Although it took me a while to accept it and I still prefer to write my own stuff, I can't deny its advantages. Recently I had a project that demanded a rollover image preview. You know, one of those tooltip-like bubble popups that appears when you roll over link or a thumbnail. Since we were already using jQuery on that project I decided to take it easy and investigate what can be done with that extraordinary library. So I came up with a script so simple it hurts! The best thing yet is that it can be applied for a variety of purposes. Today I will show you 3 examples of using the same very, very simple script. &lt;/p&gt;

&lt;p class="imp"&gt;&lt;a href="http://cssglobe.com/lab/tooltip/tooltip.zip"&gt;Download all 3 tricks in a bundle&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;Features and Principle &lt;/h3&gt;

&lt;p&gt;What this script does is adds an element to the body when you roll over a certain object. That element's appearance is predefined with css (positioned absolute and styled) so all we need to do is fill the element with content, calculate mouse position and make it move accordingly. When cursor is moved over he object, element moves with it and when cursor roll out, the element is deleted.&lt;/p&gt;
&lt;p&gt;Here are couple of examples where you can see this script in action.&lt;/p&gt;

&lt;h3&gt;Example 1: The Simplest jQuery Tooltip Ever&lt;/h3&gt;

&lt;p&gt;The script takes a title attribute of an A tag and place it inside the popup element. &lt;br /&gt;
Html looks like this:&lt;/p&gt;
&lt;pre&gt;&amp;lt;a href=&amp;quot;http://cssglobe.com&amp;quot; class=&amp;quot;tooltip&amp;quot; title=&amp;quot;Web Standards Magazine&amp;quot;&amp;gt;Roll over for tooltip&amp;lt;/a&amp;gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="http://cssglobe.com/lab/tooltip/01/"&gt;View this script in action&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;Example 2: Image Preview Gallery&lt;/h3&gt;

&lt;p&gt;Here we have a bunch of thumbnails. When each thumbnail is rolled over, script will load an image that we have linked in HREF attribute of an A tag. That makes this method accessible as well, because user can still access the target image even with disabled JavaScript.&lt;br /&gt;
Html:&lt;/p&gt;

&lt;pre&gt;&amp;lt;a href=&amp;quot;1.jpg&amp;quot; class=&amp;quot;preview&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;1s.jpg&amp;quot; alt=&amp;quot;gallery thumbnail&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt;&lt;/pre&gt;

&lt;p&gt;or if you want to use caption add a title attribute:&lt;/p&gt;

&lt;pre&gt;&amp;lt;a href=&amp;quot;image.jpg&amp;quot; class=&amp;quot;preview&amp;quot; title=&amp;quot;Great looking landscape&amp;quot;&amp;gt;Roll over to preview&amp;lt;/a&amp;gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="http://cssglobe.com/lab/tooltip/02/"&gt;View this script in action&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;Example 3: Links With URL Preview&lt;/h3&gt;
&lt;p&gt;This demands a bit more effort but it might be worth it as an extra feature to add to your sites.  What you'll need here is a small size screenshot of the target url. You'll put screenshot image location in in REL attribute of the A tag and script will do the rest.&lt;br/&gt;
	Like so:&lt;/p&gt;
	
&lt;pre&gt;&amp;lt;a href=&amp;quot;http://www.cssglobe.com&amp;quot; class=&amp;quot;screenshot&amp;quot; rel=&amp;quot;cssg_screenshot.jpg&amp;quot;&amp;gt;Css Globe&amp;lt;/a&amp;gt;&lt;/pre&gt;

&lt;p&gt;again, if you wish to use caption add a title attribute:&lt;/p&gt;

&lt;pre&gt;&amp;lt;a href=&amp;quot;http://www.cssglobe.com&amp;quot; class=&amp;quot;screenshot&amp;quot; rel=&amp;quot;cssg_screenshot.jpg&amp;quot; title=&amp;quot;Web Standards Magazine&amp;quot;&amp;gt;
Css Globe&amp;lt;/a&amp;gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="http://cssglobe.com/lab/tooltip/03/"&gt;View this script in action&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="http://cssglobe.com/lab/tooltip/tooltip.zip"&gt;Download all 3 tricks in a bundle&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

		&lt;hr /&gt;&lt;p&gt;Copyright: &lt;a href="http://cssglobe.com"&gt;Css Globe&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/cssglobearticles?a=ydSccH"&gt;&lt;img src="http://feeds.feedburner.com/~f/cssglobearticles?i=ydSccH" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/cssglobearticles?a=L3sNOh"&gt;&lt;img src="http://feeds.feedburner.com/~f/cssglobearticles?i=L3sNOh" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/cssglobearticles?a=Nbszih"&gt;&lt;img src="http://feeds.feedburner.com/~f/cssglobearticles?i=Nbszih" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/cssglobearticles?a=X4kA7h"&gt;&lt;img src="http://feeds.feedburner.com/~f/cssglobearticles?i=X4kA7h" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/cssglobearticles/~4/286304664" height="1" width="1"/&gt;</description><feedburner:origLink>http://www.cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery</feedburner:origLink></item><item><title>4 Uber Cool Css Techniques For Links</title><link>http://feeds.feedburner.com/~r/cssglobearticles/~3/277116675/4-uber-cool-css-techniques-for-links</link><pubDate>Thu, 24 Apr 2008 15:25:00 -0500</pubDate><guid isPermaLink="false">http://www.cssglobe.com/post/1614/4-uber-cool-css-techniques-for-links</guid><description>&lt;p&gt;I thought of writing a series of tutorials for various link techniques. When I start writing I realized that they are pretty simple (yet effective :) ) and it might be better to have them summarized.&lt;br/&gt;
	Links (A tags) are one of the most important elements on your document. There wouldn't be any navigation without it, would it :)? The main feature that made following techniques possible is cross browser :hover pseudo class support. Each of these techniques is pure css, no ugly hacks, no JavaScript.&lt;/p&gt;
	
&lt;p class="imp"&gt;&lt;a href="http://cssglobe.com/articles/link_tech/link_tech.zip" title="download zip file"&gt;Download link techniques&lt;/a&gt;&lt;/p&gt;
	
&lt;h3&gt;Pure Css Tooltip&lt;/h3&gt;
&lt;p&gt;To make this work you'll need markup like this:&lt;/p&gt;
&lt;pre&gt;&amp;lt;a href=&amp;quot;#&amp;quot;&amp;gt;Title &amp;lt;span&amp;gt;Tooltip&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt; &lt;/pre&gt;
&lt;p&gt;Anchor is given position:relative and span is placed absolute and styled separately. We initially hide the span element and show it only when user hovers the  link (using a:hover span selector). &lt;br/&gt;
Here's the css:&lt;/p&gt;
&lt;pre&gt;a{
	z-index:10;
	}
a:hover{
	position:relative;
	z-index:100;
	}			
a span{
	display:none;
	}
a:hover span{
	display:block;
	position:absolute;
	float:left;
	white-space:nowrap;
	top:-2.2em;
	left:.5em;
	background:#fffcd1;
	border:1px solid #444;
	color:#444;
	padding:1px 5px;
	z-index:10;			
	}&lt;/pre&gt;
&lt;p&gt;&lt;a href="http://cssglobe.com/articles/link_tech/01.html" title="pure css tooltip"&gt;See this technique in action&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;Pure Css Image Gallery&lt;/h3&gt;
&lt;p&gt;In this trick we'll show large images when thumbnails are rolled over. We're using unordered list. In each list item we'll place an anchor eith two images, one thumbnail and one full size. Full size image is placed inside an span that we initially hide. When thumb is rolled over we set display block to hidden span and that way we display a large image.&lt;/p&gt;
&lt;p&gt;Html structure looks like this:&lt;/p&gt;
&lt;pre&gt;&amp;lt;li&amp;gt;
	&amp;lt;a href=&amp;quot;#&amp;quot;&amp;gt;
		&amp;lt;img src=&amp;quot;images/02_1s.jpg&amp;quot; alt=&amp;quot;gallery thumbnail&amp;quot; /&amp;gt;
		&amp;lt;span&amp;gt;&amp;lt;img src=&amp;quot;images/02_1.jpg&amp;quot; alt=&amp;quot;gallery image&amp;quot; /&amp;gt;&amp;lt;/span&amp;gt;
	&amp;lt;/a&amp;gt;
&amp;lt;/li&amp;gt;&lt;/pre&gt;
&lt;p&gt;and css:&lt;/p&gt;
&lt;pre&gt;ul#gallery, ul#gallery li{
	margin:0;
	padding:0;
	list-style:none;
	}
ul#gallery{
	width:400px;
	height:375px;
	position:relative;
	background:#e1e1e1 url(images/bg_preview.gif) no-repeat 50% 40%;
	}			
ul#gallery li{
	float:left;
	display:inline;
	margin-top:300px;
	}								
ul#gallery a span{
	display:none;
	}
ul#gallery a:hover{
	background:none;
	z-index:100;
	}	
ul#gallery a:hover span{
	position:absolute;
	width:400px;
	height:300px;
	float:left;
	top:0;
	left:0;
	display:block;
	}	&lt;/pre&gt;
&lt;p&gt;&lt;a href="http://cssglobe.com/articles/link_tech/02.html" title="pure css image gallery"&gt;See this technique in action&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;Pure Css Image Resizer&lt;/h3&gt;
&lt;p&gt;I once wrote about thumbnail resizing where image's visible area was resized. This trick will display larger image on mouse over and give an effect of real resized image. To achieve this we'll use similar set up as in previous example - two images, one small and one large, inside one anchor tag. Larger image is initially hidden, showed only on roll over. Since the large image is placed on top of the small one, it looks like the image has been scaled up. &lt;/p&gt;
&lt;p&gt;Html:&lt;/p&gt;
&lt;pre&gt;&amp;lt;li&amp;gt;
	&amp;lt;a href=&amp;quot;#&amp;quot;&amp;gt;
		&amp;lt;em&amp;gt;&amp;lt;img src=&amp;quot;images/02_1s.jpg&amp;quot; alt=&amp;quot;gallery thumbnail&amp;quot; /&amp;gt;&amp;lt;/em&amp;gt;
		&amp;lt;span&amp;gt;&amp;lt;img src=&amp;quot;images/02_1m.jpg&amp;quot; alt=&amp;quot;gallery image&amp;quot; /&amp;gt;&amp;lt;/span&amp;gt;
	&amp;lt;/a&amp;gt;
&amp;lt;/li&amp;gt;&lt;/pre&gt;
&lt;p&gt;Css:&lt;/p&gt;
&lt;pre&gt;ul#gallery, ul#gallery li{
	margin:0;
	padding:0;
	list-style:none;
	}
ul#gallery{
	margin:2em 0;
	}			
ul#gallery li{
	float:left;
	display:inline;
	margin-right:5px;
	}								
ul#gallery a{
	float:left;
	display:inline;
	position:relative;
	}	
ul#gallery a:hover{
	background:none;
	z-index:100;
	}	
ul#gallery a span{
	display:none;
	}
ul#gallery a:hover span{
	float:left;
	display:block;
	cursor:pointer;
	}
ul#gallery a:hover em{
	display:none;
	}				
ul#gallery a img{
	border:1px solid #999;
	padding:2px;
	background:#fff;
	}	
ul#gallery a:hover img{
	border:1px solid #000;
	}		&lt;/pre&gt;
&lt;p&gt;&lt;a href="http://cssglobe.com/articles/link_tech/03.html" title="pure css image resizer"&gt;See this technique in action&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;3D Button Effect&lt;/h3&gt;
&lt;p&gt;This is a simple effect of a button being pushed. We need an anchor with nested span. Top and left borders are &amp;quot;lightened&amp;quot; while right and bottom are &amp;quot;shaded&amp;quot;. To add more shading we'll add right and bottom border to the span as well.  On mouse over we invert the border colors. Changing borders will offset the nested span one pixel to the down and to the right. &lt;br/&gt;
	Note, In my example I have used floated anchors to get desired height, but this can be done on inline anchors as well.&lt;/p&gt;
&lt;p&gt;Html looks like this&lt;/p&gt;
&lt;pre&gt;&amp;lt;a href=&amp;quot;#&amp;quot; class=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;span&amp;gt;Roll over here&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;&lt;/pre&gt;
&lt;p&gt;and css&lt;/p&gt;
&lt;pre&gt;a.button{
	float:left;
	font-size:110%;
	font-weight:bold;				
	border-top:1px solid #999;
	border-left:1px solid #999;
	border-right:1px solid #333;
	border-bottom:1px solid #333;
	color:#333;		
	width:auto;
	}	
a.button:hover{	
	border-top:1px solid #333;
	border-left:1px solid #333;
	border-right:1px solid #999;
	border-bottom:1px solid #999;	
	color:#333;					
	}	
a.button span{
	background:#d4d0c8 url(images/bg_btn.gif) repeat-x;			
	float:left;
	line-height:24px;
	height:24px;	
	padding:0 10px;							
	border-right:1px solid #777;
	border-bottom:1px solid #777;					
	}		
a.button:hover span{
	border:none;						
	border-top:1px solid #777;
	border-left:1px solid #777;		
	background:#d4d0c8 url(images/bg_btnOver.gif) repeat-x;	
	cursor:pointer;	
	}	&lt;/pre&gt;
&lt;p&gt;&lt;a href="http://cssglobe.com/articles/link_tech/04.html" title="css 3d button effect"&gt;See this technique in action&lt;/a&gt;&lt;/p&gt;

		&lt;hr /&gt;&lt;p&gt;Copyright: &lt;a href="http://cssglobe.com"&gt;Css Globe&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/cssglobearticles?a=dAQx41G"&gt;&lt;img src="http://feeds.feedburner.com/~f/cssglobearticles?i=dAQx41G" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/cssglobearticles?a=IRWNYLg"&gt;&lt;img src="http://feeds.feedburner.com/~f/cssglobearticles?i=IRWNYLg" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/cssglobearticles?a=3xid3tg"&gt;&lt;img src="http://feeds.feedburner.com/~f/cssglobearticles?i=3xid3tg" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/cssglobearticles?a=02Htu9g"&gt;&lt;img src="http://feeds.feedburner.com/~f/cssglobearticles?i=02Htu9g" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/cssglobearticles/~4/277116675" height="1" width="1"/&gt;</description><feedburner:origLink>http://www.cssglobe.com/post/1614/4-uber-cool-css-techniques-for-links</feedburner:origLink></item><item><title>CSS do's and dont's Part 1: CSS Selecting</title><link>http://feeds.feedburner.com/~r/cssglobearticles/~3/267819846/css-dos-and-donts-part-1-css-selecting</link><pubDate>Thu, 10 Apr 2008 12:37:00 -0500</pubDate><guid isPermaLink="false">http://www.cssglobe.com/post/1539/css-dos-and-donts-part-1-css-selecting</guid><description>&lt;p&gt;Css Globe is starting a series of lightweight articles named &amp;quot;CSS do's and don'ts&amp;quot;. This series is aimed at pointing out some of the bad habits when it comes to css and web standards in general. We'll try to provide answers to some of the most common css questions. &lt;/p&gt;

&lt;h3&gt;Part 1: CSS Selecting&lt;/h3&gt;

&lt;p&gt;Selecting an element is the basis of the css styling process. If you can't target an element you can't style it, right? This article could help you to fix some of the errors you might have been doing and perhaps to answer some questions about what is the best way to use css selectors.&lt;/p&gt;
&lt;p&gt;As you know, there are several &lt;a href="http://www.w3.org/TR/REC-CSS2/selector.html" title="css selectors"&gt;types of css selectors&lt;/a&gt;. What we'll focus on is a practical use of some of them. &lt;/p&gt;

&lt;h3&gt;Classes &amp;amp; Id's&lt;/h3&gt;

&lt;pre&gt;&amp;lt;p class=&amp;quot;signature&amp;quot;&amp;gt;...&amp;lt;/p&amp;gt;
&amp;lt;ul id=&amp;quot;nav&amp;quot;&amp;gt;...&amp;lt;/ul&amp;gt;&lt;/pre&gt;

&lt;p&gt;Don't use descriptive class names like &amp;quot;red&amp;quot;, &amp;quot;blueDot&amp;quot; or &amp;quot;roundedTop&amp;quot;. I wouldn't go even with class names like &amp;quot;left&amp;quot;, &amp;quot;right&amp;quot; or &amp;quot;large&amp;quot;. Why? Well, imagine that you coded 2 column site, one column named &amp;quot;left&amp;quot; and the other &amp;quot;right&amp;quot; and at one point you have to switch columns positions. Your client might not like your blue color scheme and wants it changed, you're stuck with button class=&amp;quot;blueSmall&amp;quot;... &lt;br /&gt;
	Class names should describe the meaning and purpose of the content not it's appearance. So instead of div id=&amp;quot;left&amp;quot; add div class=&amp;quot;main&amp;quot; or even class=&amp;quot;primary&amp;quot;. &lt;br /&gt;
	Try to use same class name on various elements, in various situations. Names don't have to be attached to one type of element only. You can use class=&amp;quot;first&amp;quot; on first menu item as well as on first paragraph in your content. &lt;br /&gt;
	When deciding between using class name or id, try to determine if the element you're about to style is really unique. If so, use id. If it's not that unique use classes. That keeps you away from tons if ids used only for styling. &lt;/p&gt;
	
&lt;h3&gt;Multiple classes&lt;/h3&gt;

&lt;pre&gt;&amp;lt;button class=&amp;quot;image submit&amp;quot;&amp;gt; &lt;/pre&gt;

&lt;p&gt;Multiple class names on single element can be a good way to optimize your css and avoid complex class names in your markup. &lt;br /&gt;
I often use class=&amp;quot;image&amp;quot; for image replacement technique. That class definition contains global styling for image replacement. Then I add specifics in a different class where I describe what image to use, define the width etc.&lt;/p&gt;

&lt;h3&gt;Type Selectors&lt;/h3&gt;

&lt;pre&gt;a color:#ff0;&lt;/pre&gt;
&lt;p&gt;I always use type selectors at the beginning of the stylesheet, to set or reset default styling of certain elements. I personally don't believe in the power of universal selector (unless used further down in hierarchy). If you're going to use resets, use proper ones, i.e. &lt;a href="http://meyerweb.com/eric/tools/css/reset/" title="Eric Meyer's reset"&gt;Eric Meyer's reset&lt;/a&gt;. &lt;/p&gt;
&lt;h3&gt;Descendant Selectors&lt;/h3&gt;
&lt;p&gt;Use these! When you get the hang of it you'll find out that they're so easier to work with then coming up with (and using) 100 class names for each section in the document. I often use something like &lt;strong&gt;&lt;em&gt;#main p a&lt;/em&gt;&lt;/strong&gt; to add link underline which I removed in the global reset. &lt;/p&gt;

&lt;h3&gt;Combinations&lt;/h3&gt;

&lt;pre&gt;#main h2.title span&lt;/pre&gt;

&lt;p&gt;This type of selector allows you to be very precise in targeting an element. &lt;br /&gt;
The principle I use is: I try to determine the lowest container in hierarchy that has non-repeating elements. I add class name to the container and target the elements inside with type selectors similar to example above. If you have a H2 tag that you use for titles, and you have only one span inside it, there's really no need of adding a class name to that span. You can easily target it with combined selector shown above.&lt;/p&gt;
	
&lt;h3&gt;Cross browser and cross platform support&lt;/h3&gt;

&lt;p&gt;Some of the selectors are not supported by certain user agents, so you shouldn't rely on them. i.e, you can't rely on :first-child pseudo element for top rounded corners, when it's not supported in IE6. The bitter truth is that many of users out there still use IE6 and that's something e have to live with.&lt;/p&gt;

&lt;h3&gt;Summary&lt;/h3&gt;

&lt;h4&gt;Do&lt;/h4&gt;

&lt;ul&gt;
	&lt;li&gt;When choosing use class names, use class names that describe content's meaning or purpose, not it's appearance.&lt;/li&gt;
	&lt;li&gt;Use few class names and use them on various elements.&lt;/li&gt;
	&lt;li&gt;Use type selectors to (re)set default styling. If you wish, use proper reset techniques (mentioned above).&lt;/li&gt;
	&lt;li&gt;Use multiple class names on single element to optimize your css. &lt;/li&gt;
	&lt;li&gt;Use combined selectors and precisely target your element&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;Don't&lt;/h4&gt;
&lt;ul&gt;
	&lt;li&gt;Don't use descriptive class names like &amp;quot;red&amp;quot;, &amp;quot;blueDot&amp;quot; etc.&lt;/li&gt;
	&lt;li&gt;Don't use complicated class names or id's like &amp;quot;sideIntroSecondaryContentTop&amp;quot;. Use descendant selectors instead. &lt;/li&gt;
	&lt;li&gt;Don't use universal selector for resetting entire document. &lt;/li&gt;
	&lt;li&gt;Don't use browser dependent selectors.&lt;/li&gt;
	&lt;li&gt;Don't add unnecessary class names.&lt;br /&gt;
	&lt;/li&gt;
&lt;/ul&gt;
		&lt;hr /&gt;&lt;p&gt;Copyright: &lt;a href="http://cssglobe.com"&gt;Css Globe&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/cssglobearticles?a=ljWh73G"&gt;&lt;img src="http://feeds.feedburner.com/~f/cssglobearticles?i=ljWh73G" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/cssglobearticles?a=F3AHE5g"&gt;&lt;img src="http://feeds.feedburner.com/~f/cssglobearticles?i=F3AHE5g" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/cssglobearticles?a=0Yv8CKg"&gt;&lt;img src="http://feeds.feedburner.com/~f/cssglobearticles?i=0Yv8CKg" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/cssglobearticles?a=OYGiTFg"&gt;&lt;img src="http://feeds.feedburner.com/~f/cssglobearticles?i=OYGiTFg" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/cssglobearticles/~4/267819846" height="1" width="1"/&gt;</description><feedburner:origLink>http://www.cssglobe.com/post/1539/css-dos-and-donts-part-1-css-selecting</feedburner:origLink></item><item><title>Easy Scroll: Accessible Content Scroller</title><link>http://feeds.feedburner.com/~r/cssglobearticles/~3/263348770/easy-scroll-accessible-content-scroller</link><pubDate>Thu, 03 Apr 2008 09:42:00 -0500</pubDate><guid isPermaLink="false">http://www.cssglobe.com/post/1495/easy-scroll-accessible-content-scroller</guid><description>&lt;p class="image left"&gt;&lt;img src="http://cssglobe.com/lab/easyscroll/thumb.jpg" alt="" /&gt;&lt;/p&gt;

&lt;p&gt;It has been a while since I presented some unobtrusive (hopefully useful) JavaScript function. Recently I have been working on a project that demanded content scrolling, so instead of reaching out for some heavy unobtrusive solutions, I decided to write my own function. As I was developing it I kept simplifying it so I came down to what I am presenting today - Easy Scroll v1.0, an accessible, unobtrusive content scroller. &lt;br /&gt;
I am not using any JS libraries with Easy Scroll. Although I enjoy jQuery a lot, I believe that it is important to code in &amp;quot;regular&amp;quot; JS, just not to forget it :)&lt;br /&gt;
So, Easy Scroll is standalone, lightweight script that is very easily applicable. &lt;/p&gt;
	
&lt;p class="imp"&gt;&lt;a href="http://cssglobe.com/lab/easyscroll/" title="view Easy Scroll in action"&gt;Take a look at the demo&lt;/a&gt;
| &lt;a href="http://cssglobe.com/lab/easyscroll/easyscroll.zip" title="download zip file"&gt;Download Easy Scroll v1.0&lt;/a&gt;&lt;/p&gt;
	
	
&lt;h3&gt;Features&lt;/h3&gt;

&lt;p&gt;Easy Scroll is capable of scrolling any type of content by using unobtrusive JavaScript. It has up and down scroll options and reset button that places your content in the default position.&lt;br /&gt;
It also features double speed. When buttons are rolled over, slow scrolling starts. When buttons are pressed, speed increases.&lt;/p&gt;

&lt;h3&gt;Ok, let's get it going&lt;/h3&gt;

&lt;p&gt;To start with Easy Scroll download the script, and link it to your document by placing this line of code inside the head tag:&lt;/p&gt;

&lt;pre&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;easyscroll/easyscroll.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;

&lt;p&gt;You'll also need a div with custom id (default is &amp;quot;myContent&amp;quot;). Then you should put some content in it of course :) &lt;/p&gt;

&lt;pre&gt;&amp;lt;div id=&amp;quot;myContent&amp;quot;&amp;gt;
	&amp;lt;!--  YOUR CONTENT HERE --&amp;gt;
&amp;lt;/div&amp;gt;&lt;/pre&gt;
	
&lt;p&gt;Believe it or not, as far as the markup is concerned, that's it!&lt;/p&gt;

&lt;p&gt;The script takes it over from here.&lt;br /&gt;
It creates another div id=&amp;quot;easyscroll&amp;quot; and places your content div inside and takes care of the absolute positioning, scroll buttons and scrolling. &lt;/p&gt;

&lt;h3&gt;Setting things up &lt;/h3&gt;

&lt;p&gt;You might want to set the variables in the JavaScript. When you open easyscroll.js you'll notice  these variables in config area&lt;/p&gt;

&lt;pre&gt;var id = &amp;quot;myContent&amp;quot;;&lt;/pre&gt;

&lt;p&gt; This id matches the one you have in your html file for content div. If you wish to change it, you must do it in both html and JavaScript &lt;/p&gt;

&lt;pre&gt;var nav = [&amp;quot;Scroll Up&amp;quot;, &amp;quot;Scroll Down&amp;quot;, &amp;quot;Reset&amp;quot;];&lt;/pre&gt;

&lt;p&gt;Text that appears inside of each scroll button.&lt;/p&gt;

&lt;pre&gt;var navId = [&amp;quot;btnUp&amp;quot;, &amp;quot;btnDown&amp;quot;, &amp;quot;btnReset&amp;quot;];&lt;/pre&gt;

&lt;p&gt;These are optional id's for scroll buttons in case you want to apply some specific CSS for each.&lt;/p&gt;

&lt;pre&gt;var speed = 5;&lt;/pre&gt;

&lt;p&gt;Movement speed. The larger the number the faster the scrolling will be.&lt;/p&gt;

&lt;pre&gt;var height = 200;&lt;/pre&gt;

&lt;p&gt;Desired height of the Easy Scroll area. &lt;/p&gt;

&lt;p&gt;Use css to style the content area. Oh yes, buttons are rendered as unordered list. Use css to style those too :)&lt;/p&gt;

		&lt;hr /&gt;&lt;p&gt;Copyright: &lt;a href="http://cssglobe.com"&gt;Css Globe&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/cssglobearticles?a=6OSgMJG"&gt;&lt;img src="http://feeds.feedburner.com/~f/cssglobearticles?i=6OSgMJG" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/cssglobearticles?a=CDyH45g"&gt;&lt;img src="http://feeds.feedburner.com/~f/cssglobearticles?i=CDyH45g" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/cssglobearticles?a=KRszEBg"&gt;&lt;img src="http://feeds.feedburner.com/~f/cssglobearticles?i=KRszEBg" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/cssglobearticles?a=CVOsDPg"&gt;&lt;img src="http://feeds.feedburner.com/~f/cssglobearticles?i=CVOsDPg" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/cssglobearticles/~4/263348770" height="1" width="1"/&gt;</description><feedburner:origLink>http://www.cssglobe.com/post/1495/easy-scroll-accessible-content-scroller</feedburner:origLink></item></channel></rss>
