<?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>Tutorial Dog &#187; CSS Tutorial</title>
	<atom:link href="http://tutorialdog.com/topic/css_tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://tutorialdog.com</link>
	<description>Man's best friend for learning</description>
	<lastBuildDate>Mon, 24 Aug 2009 05:36:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Follow Up To Text Image Headers Tutorial</title>
		<link>http://tutorialdog.com/follow-up-to-text-image-headers/</link>
		<comments>http://tutorialdog.com/follow-up-to-text-image-headers/#comments</comments>
		<pubDate>Sat, 13 Jun 2009 03:51:42 +0000</pubDate>
		<dc:creator>Devin</dc:creator>
				<category><![CDATA[CSS Tutorial]]></category>

		<guid isPermaLink="false">http://tutorialdog.com/?p=381</guid>
		<description><![CDATA[The first tutorial I published on CSS was a "trick" to essential hide the text generated from the HTML file and replace it with an image. Let me clarify what I mean by "trick" because its not meant to decieve anyone. It's a non-obvious way of achieving two competing goals: displaying graphical representation of text while not compromising the HTML text mainly for Google.]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://tutorialdog.com/create-seo-friendly-text-images-headers/">first tutorial</a> I published on CSS was a &#8220;trick&#8221; to essential hide the text generated from the HTML file and replace it with an image. Let me clarify what I mean by &#8220;trick&#8221; because its not meant to decieve anyone. It&#8217;s a non-obvious way of achieving two competing goals: displaying graphical representation of text while not compromising the HTML text mainly for Google. If you&#8217;re a web designer, you&#8217;ll know of the limitations to HTML and CSS and what may make a better user experience isn&#8217;t always good for Google. CSS and HTML is not only limited by the font selection, but something like a logo in which specicial types faces are created cannot be created through CSS. Using an image with an alt attribute just doesn&#8217;t seem like a good solution for a h1 headline tag either. For something like a screen reader, or viewing plain HTML, using the text is a better solution than the alt attribute of an image.</p>
<p>Now don&#8217;t get me wrong, this technique can be used for evil by hiding keywords to try to bolster search engine rankings on Google. I don&#8217;t know exactly how Google creates the ranking, but I do know that h1 headline serve as a key part in determining page rank for keywords. So who uses the negative text-indent trick? Google themselves use images for there main logo, but both Apple.com and Digg.com use negative text-indent to hide lot things. Apple hides their top navigation bar, and homepage featured items. Digg hides the h1 tag which states their name. (If you want to see for yourself, I&#8217;d recommend checking Apple homepage because you can see the relavent css directly in the source of the webpage. With Digg, you have to navigate your way through the file references.) Google doesn&#8217;t seem to penalize either of theses two sites. You might say that these guys are too big to be penalized, well in that case, this website, Tutorial Dog uses the negative text-indent and the site ranks on the first page for the keyword  &#8220;javascript image gallery&#8221;.</p>
<p><strong>Inadvertent Discovery</strong> While checking out Digg.com to see if they use negative text-indent, I discovered that they combine all their images for the site into <a href="http://digg.com/img/menu-current.gif">one large gif image</a>. They then direct the CSS file to specific sections of the image to show different images using the &#8216;background-position&#8217; attribute. Why would they imbed all images into one document? For a site like Digg, which recieves millions hits daily, by combining the images into one file, their servers receive less of a usage because many image files aren&#8217;t requested from the server. Once this large image file is requested and sent, the web browser can reference the file to generate the page. To further illustrate why this is better, think of moving a bunch of boxes. Digg likens the large image file to one large box. In this case, while this box may be bigger and weight more, you only have to move it once to get all of the required materials to the receiver. With a bunch of small images, you will have to move a bunch of boxes one at a time. This technique probably won&#8217;t be worth your while to implement for your web designs, because it will take more time for what its worth. Digg, because they deal with large traffic, finds that this technique optimizes their page serving ability.</p>
]]></content:encoded>
			<wfw:commentRss>http://tutorialdog.com/follow-up-to-text-image-headers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introduction To CSS</title>
		<link>http://tutorialdog.com/introduction-to-css/</link>
		<comments>http://tutorialdog.com/introduction-to-css/#comments</comments>
		<pubDate>Wed, 28 May 2008 12:00:53 +0000</pubDate>
		<dc:creator>Devin</dc:creator>
				<category><![CDATA[CSS Tutorial]]></category>
		<category><![CDATA[cascading style sheets]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[default css]]></category>
		<category><![CDATA[elements]]></category>
		<category><![CDATA[id]]></category>

		<guid isPermaLink="false">http://tutorialdog.com/?p=171</guid>
		<description><![CDATA[Have you’ve been stuck on designing your site using Dreamweaver or some other WYSIWYG (What You See Is What You Get) web page maker? If you’re ready to step out of the shadows of table based layouts, and discover CSS design then this article is for you. This article doesn’t aim to give you CSS code that you can copy to put on your website, instead teach you about the nuances you wouldn’t find in a general CSS tutorial or code.]]></description>
			<content:encoded><![CDATA[<div class="floatl"><!--adsense#sr--></div>
<p>Have you’ve been stuck on designing your site using Dreamweaver or some other WYSIWYG (What You See Is What You Get) web page maker? If you’re ready to step out of the shadows of table based layouts, and discover CSS design then this article is for you. This article doesn&#8217;t aim to give you CSS code that you can copy to put on your website, instead teach you about the nuances you wouldn&#8217;t find in a general CSS tutorial or code.</p>
<h3>What exactly is CSS?</h3>
<p>CSS stands for cascading style sheets. Ok, what does that mean? Look at it like this, <strong><em>XHTML contains the data/content to display, CSS decides how the content looks, and Javascript determines how the web page interacts</em></strong>. CSS provides not only structure to the web page like a table would but also stylization the content like background color and font size.<br />
CSS goes hand in hand with HTML. If you’ve used Dreamweaver or a similar application, then just learning CSS won’t help you that much. While you might be able to fly by the seat of your pants, learning &amp; knowing HTML will prove to be vital. Clean and valid HTML will not satisfy avid web designers, it will save you tons of time when your design breaks and doesn’t look right. This article won&#8217;t delve into each attribute, instead the best practices of implementing attributes to the elements of the web page.</p>
<h3>How to apply attributes to different elements</h3>
<p>Attributes are instructions of how elements in the HTML should look. Attributes can be anything from font-size to background-color, but this section describes how to effectively apply certain attributes to different elements.</p>
<ul>
<li><strong>ID&#8217;s</strong><br />
ID tags in HTML (&lt;div id=&#8221;header&#8221;&gt;) are tags which should only be used once per web page. Generally, you want to use an ID to denote the page structure, so you might have id&#8217;s for a web page of &#8220;header&#8221;, &#8220;content&#8221;, &#8220;sidebar&#8221; and &#8220;footer&#8221;, because you&#8217;re not going to have two headers or two footers for any one webpage. To assign a style to an ID tag in CSS, use:     </p>
<p class="code">#idtagname{<br />
/* assign attributes here */<br />
}</p>
</li>
<li><strong>Class</strong><br />
Unlike ID tags, class tags can be used multiple times. This is great when you want different parts of the design to look the same.<br />
To assign a style to a class tag in CSS use:     </p>
<p class="code">.classname{<br />
/* assign attributes here */<br />
}</p>
</li>
<li><strong>HTML elements</strong><br />
You can apply a style to a particular HTML tag with CSS without using an id or class. For example, if you wanted to change every list (ul) to change from a dot to a square, you could simply do:     </p>
<p class="code">li{<br />
list-style:square;<br />
}</p>
<p>Generally you don&#8217;t want to apply a style to an element like this. One exception though would be the body tag because it only appears once. In the next paragraph though, you will see where using the general HTML element is appropriate.</li>
<li> <strong>Combining All Three</strong><br />
If you&#8217;ve played around with CSS before, you&#8217;ve probably created HTML like this:     </p>
<p class="code">&lt;ul&gt;<br />
&lt;li class=&#8221;x&#8221;&gt;&lt;/li&gt;<br />
&lt;li class=&#8221;x&#8221;&gt;&lt;/li&gt;<br />
&lt;li class=&#8221;x&#8221;&gt;&lt;/li&gt;<br />
&lt;li class=&#8221;x&#8221;&gt;&lt;/li&gt;<br />
&lt;/ul&gt;</p>
<p>If you have a lot of li elements, you&#8217;ll know it can get very annoying to type out class=&#8221;x&#8221; every time. But there is a way to simplify this. Instead use the following CSS,</p>
<p class="code">.y li{<br />
/* CSS attributes for class x here */<br />
}</p>
<p>And your HTML can become this:</p>
<p class="code">&lt;ul class=&#8221;y&#8221;&gt;<br />
&lt;li&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;/li&gt;<br />
&lt;/ul&gt;</p>
<p>The CSS applies the attributes for define in &#8220;.y li&#8221; for the li elements embedded in class &#8220;y&#8221;. Thus you get a cascading effect where you can affect elements inside certain elements. You can use this cascading affect for any combination of ID&#8217;s, class and elements. For example, you might use:</p>
<p class="code">#content .post ul{ /* style attributes here */}</p>
</li>
</ul>
<h3>Print vs Screen</h3>
<p>Believe it or not, you can create a CSS for when someone prints out a web page which is great for a visitor because usually if you print you just want the primary content. Generally, you want a very different style sheet as compared to the &#8220;screen&#8221; version. Using the attribute &#8220;display: none;&#8221; you can and should get ride of ads, a sidebar and any other information someone wouldn&#8217;t want to print out. You also want a black text on white background design, otherwise you&#8217;ll make people print too much ink.</p>
<p>You link to the print CSS file almost exactly the same except for the &#8216; media=&#8221;print&#8221; &#8216; part.</p>
<div class="code">&lt;link rel=&#8221;stylesheet&#8221; href=&#8221;style.css&#8221; type=&#8221;text/css&#8221; media=&#8221;screen&#8221; /&gt; &lt;!&#8211; for browser &#8211;&gt; </p>
<p><span> </span>&lt;link rel=&#8221;stylesheet&#8221; href=&#8221;print.css&#8221; type=&#8221;text/css&#8221; media=&#8221;print&#8221; /&gt;   &lt;!&#8211; for printer &#8211;&gt;</p>
</div>
<h3>CSS Default</h3>
<p>When you load your HTML file in any web browser whether it be Firefox, Internet Explorer or Safari, the browser will render the web page with certain style attributes already assigned. You can of course override these attributes with CSS, but if you don’t specify differently, the browser will render the page with certain attributes already applied. Each web browser has subtle difference in how they render a web page under defaults, but in general a web page will look the same.<br />
For example, the dots for a list item or the font family is a default style of the browser. You have the power to make that dot into a square or that font from Times New Roman to Verdana. But if you don&#8217;t specify, the browser will assume it. Another default attribute that always fools a beginner is the body tag which has a margin.</p>
<h3>Save lines of code, be efficient</h3>
<p>From time to time, you&#8217;ll notice your coping and pasting attributes from one id or class to another. If you find yourself applying the same attributes to a few elements, then you can combine attribute assignments so that multiple classes, ids and elements share the attributes. Lets take the attributes for the left and right arrows on the <a href="http://tutorialdog.com/javascript-image-library-using-mootools-part-2/">javascript image gallery</a>. I originally had this as the attributes:</p>
<p><a href="http://tutorialdog.com/javascript-image-library-using-mootools-part-2/"> </a></p>
<div class="code">
<pre>#moveleft{
<span>	</span>margin:0px;
<span>	</span>height:58px;
<span>	</span>color: white;
<span>	</span>width: 16px;
<span>	</span>text-indent: -2000em;
<span>	</span>text-decoration: none;
<span>	</span>z-index: 1000;
<span>	</span>display:block;
<span>	</span>cursor: pointer;
<span>	</span>float:left;
<span>	</span>background: url('left.gif');
}

#moveright{
<span>	</span>margin:0px;
<span>	</span>height:58px;
<span>	</span>color: white;
<span>	</span>width: 16px;
<span>	</span>text-indent: -2000em;
<span>	</span>text-decoration: none;
<span>	</span>z-index: 1000;
<span>	</span>display:block;
<span>	</span>cursor: pointer;
<span>	</span>float:left;
<span>	</span>background: url('right.gif');
}</pre>
</div>
<p>This is silly though because the two are essentially duplicates of each other except for the background image. We can though apply one set of attributes to both ids (using a comma to include more elements) and set the background to their respective urls:</p>
<div class="code">
<p>#moveleft, #moveright{</p>
<p style="padding-left: 30px;"><span> </span>margin:0px;<br />
<span> </span>height:58px;<br />
<span> </span>color: white;<br />
<span> </span>width: 16px;<br />
<span> </span>text-indent: -2000em;<br />
<span> </span>text-decoration: none;<br />
<span> </span>z-index: 1000;<br />
<span> </span>display:block;<br />
<span> </span>cursor: pointer;<br />
<span> </span>float:left;</p>
<p>}</p>
<p>#moveleft{background: url(&#8217;left.gif&#8217;);}</p>
<p>#moveright{background: url(&#8217;right.gif&#8217;);}</p>
</div>
<h3>Conclusion</h3>
<p><em>The mark of a good CSS designer is one that creates the CSS for the HTML. </em>If you start designing your HTML around what you can do with the CSS, you still have more to learn. In the future, I&#8217;ll delve into the basics of taking a design in Photoshop into HTML web page. If you have any questions or sub-topics you would like me to discuss, please leave a comment below.<br />
<!--adsense#bannerimg3--></p>
]]></content:encoded>
			<wfw:commentRss>http://tutorialdog.com/introduction-to-css/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Create SEO friendly Text Images Headers</title>
		<link>http://tutorialdog.com/create-seo-friendly-text-images-headers/</link>
		<comments>http://tutorialdog.com/create-seo-friendly-text-images-headers/#comments</comments>
		<pubDate>Sun, 07 Oct 2007 18:10:37 +0000</pubDate>
		<dc:creator>Devin</dc:creator>
				<category><![CDATA[CSS Tutorial]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[h1]]></category>
		<category><![CDATA[header]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[seo]]></category>

		<guid isPermaLink="false">http://tutorialdog.com/create-seo-friendly-text-images-headers/</guid>
		<description><![CDATA[In designing Tutorial Dog, I had the logo as an image with the text included, but I want to have the words "Tutorial Dog" in the HTML with the h1 tag (ie. Tutorial Dog). Why would you want the h1 tag with text instead of an image?]]></description>
			<content:encoded><![CDATA[<p>In designing Tutorial Dog, I had the logo as an image with the text included, but I want to have the words &#8220;Tutorial Dog&#8221; in the HTML with the h1 tag (ie. &lt;h1&gt;Tutorial Dog&lt;/h1&gt;). Why would you want the h1 tag with text instead of an image? A visitor might see the image and the text in the image, but the Google bot (that crawls and indexes web sites) will look at the html file and won&#8217;t register the image like it would with text. This makes your site all the more search engine optimized. It will help you rank better in search engines and achieve more traffic.<br />
This technique is relatively easy to implement once you get the hang of it. You&#8217;ll be able to use this technique for customize logos, navigation test and the overall design of the website.</p>
<p>In this case, I want to create a header tag with a link that is an image.</p>
<p><strong>The <acronym title="HyperText Markup Language">HTML</acronym> :</strong></p>
<p class="code">&lt;h1&gt;&lt;a href=&#8221;/&#8221;&gt;Your text here&lt;/a&gt;&lt;/h1&gt;</p>
<p>This is how the HTML should look regardless of if there is a CSS or not.</p>
<p><strong>The <acronym title="Cascading Style Sheets">CSS:</acronym></strong></p>
<p class="code">h1 a{<br />
display: block; /* Allows you to change the width and height of the image */<br />
height: (Image height here);<br />
width: (Image width here);<br />
text-indent: -2000em; /* Hides the text in the h1 tag */<br />
text-decoration: none; /* Hides the underline of the hyperlink */<br />
z-index: 1000; /* IE Fix*/<br />
background: url(Your link here!) 0 0 no-repeat; /* The pathway to the image*/<br />
}</p>
<p>You want to replace the height and width with the dimensions of the image. You can figure this out by getting info on the image you wish to place there. The background url links to the url of the image.<br />
<strong>Reducing CSS Repeating</strong><br />
You can apply this trick to other parts of the website. For example, navigation is another good time to use this. This trick allows you to make the design better, while still conserving the search engine friendly html. So that you don&#8217;t have repetitive segments of the css, you can include multiple class and id styles in one block.</p>
<p class="code">h1 a, #navigation li, #logo2{<br />
display: block; /* Allows you to change the width and height of the image */<br />
text-indent: -2000em; /* Hides the text in the h1 tag */<br />
text-decoration: none; /* Hides the underline of the hyperlink */<br />
z-index: 1000; /* IE Fix*/<br />
}</p>
<p>This segment of CSS applies these attributes to each class or id named. To simply name multiple elements, use a comma to separate each element. With each element, now you only need to add the background image, height and width attributes.</p>
]]></content:encoded>
			<wfw:commentRss>http://tutorialdog.com/create-seo-friendly-text-images-headers/feed/</wfw:commentRss>
		<slash:comments>30</slash:comments>
		</item>
	</channel>
</rss>
