<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Web Design &#38; Development Tips</title>
	<atom:link href="http://webcsstips.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://webcsstips.wordpress.com</link>
	<description>Using CSS is easy when you know a few tricks!</description>
	<lastBuildDate>Fri, 27 Jan 2012 21:44:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='webcsstips.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/71590ed80cb75190259d9fcf75478836?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Web Design &#38; Development Tips</title>
		<link>http://webcsstips.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://webcsstips.wordpress.com/osd.xml" title="Web Design &#38; Development Tips" />
	<atom:link rel='hub' href='http://webcsstips.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Aligning Inline Elements Vertically</title>
		<link>http://webcsstips.wordpress.com/2009/11/30/aligning-inline-elements-vertically/</link>
		<comments>http://webcsstips.wordpress.com/2009/11/30/aligning-inline-elements-vertically/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 15:00:52 +0000</pubDate>
		<dc:creator>Monica</dc:creator>
				<category><![CDATA[See All]]></category>
		<category><![CDATA[Text Styling]]></category>
		<category><![CDATA[align inline elements]]></category>
		<category><![CDATA[text alignment]]></category>
		<category><![CDATA[vertical alignment]]></category>

		<guid isPermaLink="false">http://webcsstips.wordpress.com/?p=495</guid>
		<description><![CDATA[The vertical-align property is meant for aligning inline elements to a common element on the same line. For example, you might want to align text to the top, middle, baseline, or bottom  of larger text or image on the same line. These are the valid property-value pairs: vertical-align:top &#8212; Align to the top of the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webcsstips.wordpress.com&amp;blog=8554814&amp;post=495&amp;subd=webcsstips&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The <span style="color:#993366;">vertical-align</span> property is meant for aligning inline elements to a common element on the same line. For example, you might want to align text to the top, middle, baseline, or bottom  of larger text or image on the same line.</p>
<p>These are the valid property-value pairs:</p>
<p><span style="color:#993366;">vertical-align:top</span> &#8212; Align to the top of the line. If the height of the line is taller than the common element, this location is higher than <span style="color:#993366;">vertical-align:text-top</span>. If the line height is the same, <span style="color:#993366;">top </span>and<span style="color:#993366;"> text-top</span> are the same location.</p>
<p><span style="color:#993366;">vertical-align:text-top</span> &#8212; Align to the top of text characters with accents such as <span style="color:#993366;">á</span> and <span style="color:#993366;">Á</span>. This location is the same whether the characters actually have accents or not.</p>
<p><span style="color:#993366;">vertical-align:middle</span> &#8212; Align to the middle of the letter <span style="color:#993366;">x</span>.</p>
<p><span style="color:#993366;">vertical-align:baseline</span> &#8212; Align to the baseline, which is the bottom of characters that do not have descenders such as the letter <span style="color:#993366;">A</span>.</p>
<p><span style="color:#993366;">vertical-align:bottom </span>&#8211; Align to the bottom of the line. If the height of the line is lower than the common element, this location is lower than <span style="color:#993366;">vertical-align:text-bottom</span>. If the line height is the same, <span style="color:#993366;">top</span> and <span style="color:#993366;">text-bottom</span> are the same location.</p>
<p><span style="color:#993366;">vertical-align:text-bottom</span> &#8212; Align to the bottom of the text, which includes the bottom of characters that have descenders such the letter g. This location is the same whether the characters actually have descenders or not.</p>
<h2>Example 1</h2>
<p>This example aligns text to the <span style="color:#993366;">text-top</span>, <span style="color:#993366;">middle</span>, <span style="color:#993366;">baseline</span>, and <span style="color:#993366;">text-bottom</span> of the common element, which is a graphic followed by large text in white with a blue background. Characters with accents and descenders are used so you can see how they align. Example 2 shows how they align with <span style="color:#993366;">top</span> and <span style="color:#993366;">bottom</span> are used in place of <span style="color:#993366;">text-top</span> and <span style="color:#993366;">text-bottom</span>.</p>
<h3><a href="http://webcsstips.files.wordpress.com/2009/11/vertical-align.jpg"><img class="aligncenter size-medium wp-image-503" title="vertical-align" src="http://webcsstips.files.wordpress.com/2009/11/vertical-align.jpg?w=300&#038;h=48" alt="" width="300" height="48" /></a>CSS</h3>
<p>Note that the line height (<span style="color:#993366;">80px</span>) t is taller than the common element (<span style="color:#993366;">60px</span>) , and in this e</p>
<pre>div{border: 1px solid #00008b; font-size:60px;}
*.main{background-color: #00008b; color:#ffffff; line-height:80px;}
*.text{font-size:18px;}
*.top{vertical-align:text-top;}
*.middle{vertical-align:middle;}
*.baseline{vertical-align:baseline;}
*.bottom{vertical-align:text-bottom;}</pre>
<h3>HTML</h3>
<pre>&lt;div&gt;
&lt;span class="main"&gt;
&lt;img src="kangarooflowerthumbsmall.gif" /&gt;
ÁáxXg&lt;/span&gt;
&lt;span class="top text"&gt;áÁ&lt;/span&gt;
&lt;span class="top text"&gt;Top&lt;/span&gt;
&lt;span class="middle text"&gt;Middle&lt;/span&gt;
&lt;span class="baseline text"&gt;Baseline&lt;/span&gt;
&lt;span class="bottom text"&gt;Bottom&lt;/span&gt;
&lt;/div&gt;</pre>
<h2>Example 2</h2>
<p>This example aligns text to the <span style="color:#993366;">middle </span>and <span style="color:#993366;">baseline</span> of the common element, which is a graphic followed by large text in white with a blue background.  It also uses <span style="color:#993366;">top</span> and <span style="color:#993366;">bottom</span> to align the text to the top and bottom on the line, which is taller and lower than the common element. Characters with accents and descenders are used so you can see how they align. Notice that aligning to <span style="color:#993366;">top</span> and <span style="color:#993366;">bottom</span> align higher and lower, respectively, than <span style="color:#993366;">text-top</span> and <span style="color:#993366;">text-bottom</span> in Example 1.</p>
<h3><a href="http://webcsstips.files.wordpress.com/2009/11/vertical-align2.jpg"><img class="aligncenter size-medium wp-image-508" title="vertical-align2" src="http://webcsstips.files.wordpress.com/2009/11/vertical-align2.jpg?w=300&#038;h=48" alt="" width="300" height="48" /></a>CSS</h3>
<pre>div{border: 1px solid #00008b; font-size:60px;}
*.main{background-color: #00008b; color:#ffffff; line-height:80px;}
*.text{font-size:18px;}
*.top{vertical-align:top;}
*.middle{vertical-align:middle;}
*.baseline{vertical-align:baseline;}
*.bottom{vertical-align:bottom;}</pre>
<h3>HTML</h3>
<pre>&lt;div&gt;
&lt;span class="main"&gt;
&lt;img src="kangarooflowerthumbsmall.gif" /&gt;
ÁáxXg&lt;/span&gt;
&lt;span class="top text"&gt;áÁ&lt;/span&gt;
&lt;span class="top text"&gt;Top&lt;/span&gt;
&lt;span class="middle text"&gt;Middle&lt;/span&gt;
&lt;span class="baseline text"&gt;Baseline&lt;/span&gt;
&lt;span class="bottom text"&gt;Bottom&lt;/span&gt;
&lt;/div&gt;</pre>
<h2>Source Code</h2>
<pre>&lt;html&gt;
&lt;head&gt;&lt;title&gt;Vertical Centering&lt;/title&gt;
&lt;style type='text/css'&gt;
body{}
div{border: 1px solid #00008b; font-size:60px;}
*.main{background-color: #00008b; color:#ffffff; line-height:80px;}
*.text{font-size:18px;}
*.top{vertical-align:top;}
*.middle{vertical-align:middle;}
*.baseline{vertical-align:baseline;}
*.bottom{vertical-align:bottom;}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;div&gt;
&lt;span class="main"&gt;
&lt;img src="kangarooflowerthumbsmall.gif" /&gt;
ÁáxXg&lt;/span&gt;
&lt;span class="top text"&gt;áÁ&lt;/span&gt;
&lt;span class="top text"&gt;Top&lt;/span&gt;
&lt;span class="middle text"&gt;Middle&lt;/span&gt;
&lt;span class="baseline text"&gt;Baseline&lt;/span&gt;
&lt;span class="bottom text"&gt;Bottom&lt;/span&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/webcsstips.wordpress.com/495/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/webcsstips.wordpress.com/495/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/webcsstips.wordpress.com/495/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/webcsstips.wordpress.com/495/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/webcsstips.wordpress.com/495/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/webcsstips.wordpress.com/495/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/webcsstips.wordpress.com/495/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/webcsstips.wordpress.com/495/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/webcsstips.wordpress.com/495/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/webcsstips.wordpress.com/495/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/webcsstips.wordpress.com/495/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/webcsstips.wordpress.com/495/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/webcsstips.wordpress.com/495/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/webcsstips.wordpress.com/495/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webcsstips.wordpress.com&amp;blog=8554814&amp;post=495&amp;subd=webcsstips&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://webcsstips.wordpress.com/2009/11/30/aligning-inline-elements-vertically/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/883f2db06f32939c8d773effb8f3ac9e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mpawlan</media:title>
		</media:content>

		<media:content url="http://webcsstips.files.wordpress.com/2009/11/vertical-align.jpg?w=300" medium="image">
			<media:title type="html">vertical-align</media:title>
		</media:content>

		<media:content url="http://webcsstips.files.wordpress.com/2009/11/vertical-align2.jpg?w=300" medium="image">
			<media:title type="html">vertical-align2</media:title>
		</media:content>
	</item>
		<item>
		<title>Indenting Text</title>
		<link>http://webcsstips.wordpress.com/2009/11/23/indenting-text/</link>
		<comments>http://webcsstips.wordpress.com/2009/11/23/indenting-text/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 07:00:10 +0000</pubDate>
		<dc:creator>Monica</dc:creator>
				<category><![CDATA[Text Styling]]></category>
		<category><![CDATA[content indent]]></category>
		<category><![CDATA[content outdent]]></category>
		<category><![CDATA[spacing content]]></category>

		<guid isPermaLink="false">http://webcsstips.wordpress.com/?p=479</guid>
		<description><![CDATA[The text-indent property provides an easy way to indent or outdent the first line of a paragraph, table cell, division, heading, or list item. Combining text-indent and a negative value with left padding creates an outdent. CSS /* indents first line */ *.indent{text-indent:60px;} /* indents entire paragraph on the left and right */ *.fullparaindent{padding-left:60px; padding-right:60px;} [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webcsstips.wordpress.com&amp;blog=8554814&amp;post=479&amp;subd=webcsstips&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The <span style="color:#993366;">text-indent</span> property provides an easy way to indent or outdent the first line of a paragraph, table cell, division, heading, or list item. Combining <span style="color:#993366;">text-indent</span> and a negative value with left padding creates an outdent.</p>
<h2>CSS</h2>
<pre>/* indents first line */
*.indent{text-indent:60px;} 

/* indents entire paragraph on the left and right */
*.fullparaindent{padding-left:60px; padding-right:60px;}

/* outdents first line */
*.outdent{text-indent:-60px;}</pre>
<h2>HTML</h2>
<pre>&lt;p class="indent"&gt;</pre>
<p>The word cryptography comes from the Greek words kryptos meaning hidden and graphein meaning writing. Cryptography is the study of hidden writing, or the science of encrypting and decrypting text.</p>
<pre>&lt;/p&gt;

&lt;p class="fullparaindent"&gt;</pre>
<p>Nineteenth century scholars decrypted ancient Egyptian hieroglyphics when Napoleon&#8217;s soldiers found the Rosetta Stone in 1799 near Rosetta, Egypt. Its inscription praising King Ptolemy V was in three ancient languages: Demotic, hieroglyphics, and Greek. The scholars who could read ancient Greek, decrypted the other languages by translating the Greek and comparing the three inscriptions.</p>
<pre>&lt;/p&gt;</pre>
<pre>&lt;p class="fullindent outdent"&gt;</pre>
<p>In the twentieth century world of computer networks, messages are digitally encrypted on the sending side and decrypted on the receiving side using cryptographic services and algorithms. Algorithms are mathematical techniques or rules that apply a cryptographic service to a message. Cryptographic services include hashing a message, encrypting and decrypting a message, and signing or verifying the signature on a message. A message digest object uses a hashing algorithm to make a hash digest of the original message, key pairs use a key algorithm compatible with the hashing algorithm to encrypt and decrypt the message, and a signature object uses the key pairs to sign and verify the signature on a message.</p>
<pre>&lt;/p&gt;</pre>
<h2>What it Looks Like</h2>
<p><a href="http://webcsstips.files.wordpress.com/2009/11/indent1.jpg"><img class="aligncenter size-medium wp-image-490" title="indent" src="http://webcsstips.files.wordpress.com/2009/11/indent1.jpg?w=300&#038;h=254" alt="" width="300" height="254" /></a></p>
<h2>Adding a Spacer</h2>
<p>If you want to add a space within inline content, you can do that with a spacer:</p>
<h3>CSS</h3>
<pre>*.spacer{margin-left:10px;}</pre>
<h3>HTML</h3>
<pre>&lt;p&gt;</pre>
<p><span style="color:#993366;">&amp;rarr;</span> The Java Cryptography Architecture (JCA) framework in the Java Development Kit (JDK) 1.2 provides a full range of cryptographic services and algorithms to keep messages sent over the network secure. <span style="color:#993366;">&amp;rarr;</span> The framework is extensible and interoperable. <span style="color:#993366;">&amp;rarr;</span> Not only can you add cryptographic service implementations by different vendors to the framework, but, for example, the signature service implementation by one vendor will work seamlessly with the signature service implementation by another vendor as long as both vendors&#8217; implementations use the same signature algorithm. <span style="color:#993366;">&amp;rarr;</span> Given how implementations can vary from vendor to vendor, the flexibility built into the JCA framework lets you choose an implementation that best meets your application requirements.</p>
<pre>&lt;/p&gt;</pre>
<h3>What it Looks Like</h3>
<h2><a href="http://webcsstips.files.wordpress.com/2009/11/spacer.jpg"><img class="aligncenter size-medium wp-image-491" title="spacer" src="http://webcsstips.files.wordpress.com/2009/11/spacer.jpg?w=300&#038;h=141" alt="" width="300" height="141" /></a>Code</h2>
<p>&lt;html&gt;<br />
&lt;head&gt;&lt;title&gt;Text Indent&lt;/title&gt;<br />
&lt;style type=&#8217;text/css&#8217;&gt;</p>
<p>body{padding:10px; border:1px solid #00008b;}<br />
*.indent{text-indent:60px;}<br />
*.fullindent{padding-left:60px; padding-right:60px;}<br />
*.outdent{text-indent:-60px;}<br />
*.spacer{margin-left:10px;}</p>
<p>&lt;/style&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;</p>
<p>&lt;p&gt;<br />
The word cryptography comes from the Greek words kryptos meaning hidden and graphein meaning writing. Cryptography is the study of hidden writing, or the science of encrypting and decrypting text.<br />
&lt;/p&gt;</p>
<p>&lt;p&gt;<br />
Nineteenth century scholars decrypted ancient Egyptian hieroglyphics when Napoleon&#8217;s soldiers found the Rosetta Stone in 1799 near Rosetta, Egypt. Its inscription praising King Ptolemy V was in three ancient languages: Demotic, hieroglyphics, and Greek. The scholars who could read ancient Greek, decrypted the other languages by translating the Greek and comparing the three inscriptions.<br />
&lt;/p&gt;</p>
<p>&lt;p&gt;<br />
In the twentieth century world of computer networks, messages are digitally encrypted on the sending side and decrypted on the receiving side using cryptographic services and algorithms. Algorithms are mathematical techniques or rules that apply a cryptographic service to a message. Cryptographic services include hashing a message, encrypting and decrypting a message, and signing or verifying the signature on a message. A message digest object uses a hashing algorithm to make a hash digest of the original message, key pairs use a key algorithm compatible with the hashing algorithm to encrypt and decrypt the message, and a signature object uses the key pairs to sign and verify the signature on a message.<br />
&lt;/p&gt;</p>
<p>&lt;p&gt;<br />
&amp;rarr; The Java Cryptography Architecture (JCA) framework in the Java Development Kit (JDK) 1.2 provides a full range of cryptographic services and algorithms to keep messages sent over the network secure. → The framework is extensible and interoperable. → Not only can you add cryptographic service implementations by different vendors to the framework, but, for example, the signature service implementation by one vendor will work seamlessly with the signature service implementation by another vendor as long as both vendors&#8217; implementations use the same signature algorithm. → Given how implementations can vary from vendor to vendor, the flexibility built into the JCA framework lets you choose an implementation that best meets your application requirements.<br />
&lt;/p&gt;</p>
<p>&lt;p&gt;<br />
Read the full article, <a href="http://www.pawlan.com/&lt;span class=">monica</a><a href="http://www.pawlan.com/&lt;span class=">/articles/crypto/&#8221;&gt;Cryptography: The Ancient Art of Secret Messages</a><br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
<p>Read the full article, <a href="http://www.pawlan.com/monica/articles/crypto/">Cryptography: The Ancient Art of Secret Messages</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/webcsstips.wordpress.com/479/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/webcsstips.wordpress.com/479/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/webcsstips.wordpress.com/479/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/webcsstips.wordpress.com/479/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/webcsstips.wordpress.com/479/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/webcsstips.wordpress.com/479/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/webcsstips.wordpress.com/479/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/webcsstips.wordpress.com/479/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/webcsstips.wordpress.com/479/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/webcsstips.wordpress.com/479/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/webcsstips.wordpress.com/479/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/webcsstips.wordpress.com/479/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/webcsstips.wordpress.com/479/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/webcsstips.wordpress.com/479/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webcsstips.wordpress.com&amp;blog=8554814&amp;post=479&amp;subd=webcsstips&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://webcsstips.wordpress.com/2009/11/23/indenting-text/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/883f2db06f32939c8d773effb8f3ac9e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mpawlan</media:title>
		</media:content>

		<media:content url="http://webcsstips.files.wordpress.com/2009/11/indent1.jpg?w=300" medium="image">
			<media:title type="html">indent</media:title>
		</media:content>

		<media:content url="http://webcsstips.files.wordpress.com/2009/11/spacer.jpg?w=300" medium="image">
			<media:title type="html">spacer</media:title>
		</media:content>
	</item>
		<item>
		<title>Vertical Centering</title>
		<link>http://webcsstips.wordpress.com/2009/11/18/vertical-centering/</link>
		<comments>http://webcsstips.wordpress.com/2009/11/18/vertical-centering/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 07:00:12 +0000</pubDate>
		<dc:creator>Monica</dc:creator>
				<category><![CDATA[Design Tips]]></category>
		<category><![CDATA[See All]]></category>
		<category><![CDATA[centering]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[vertical centering]]></category>

		<guid isPermaLink="false">http://webcsstips.wordpress.com/?p=430</guid>
		<description><![CDATA[It&#8217;s possible, although a little tricky, to center text or an image along the vertical axis of the page or within a box. Centering text and images horizontally is easily done with the text-align:center setting, which is used in the examples below for that exact purpose. The discussion focuses on achieving the vertical centering. On [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webcsstips.wordpress.com&amp;blog=8554814&amp;post=430&amp;subd=webcsstips&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s possible, although a little tricky, to center text or an image along the vertical axis of the page or within a box. Centering text and images horizontally is easily done with the <span style="color:#993366;">text-align:center</span> setting, which is used in the examples below for that exact purpose. The discussion focuses on achieving the vertical centering.</p>
<h2>On the Page</h2>
<p>Centering something on the page uses absolute positioning so you can set values for the parent in relation to the top and left sides of the viewport.</p>
<h3>Vertically Centered Text</h3>
<p>In this example text is vertically centered on the page inside an absolutely positioned box.</p>
<h4>CSS</h4>
<p>The text is moved to the middle of the page vertically by setting <span style="color:#993366;">top:50%</span>, and is moved to the center of the page by setting <span style="color:#993366;">width:100% </span>and <span style="color:#993366;">text-align:center</span>.  I included the box border so it is easier to see what is happening on the page.</p>
<pre>body{font-size:14px;}
*.box{position:absolute; width:100%; border: 1px solid #8b0000;
  top:50%; left:0; text-align:center;}</pre>
<h4>HTML</h4>
<p>The <span style="color:#993366;">box </span>and <span style="color:#993366;">positioning </span>settings are applied to the parent <span style="color:#993366;">div </span>of the text to get the vertical centering.</p>
<pre>&lt;div class="box"&gt;Vertically Centered Text&lt;/div&gt;</pre>
<h4>What it Looks Like</h4>
<p><a href="http://webcsstips.files.wordpress.com/2009/11/vertcenttxt2.jpg"><img class="aligncenter size-full wp-image-457" title="vertcenttxt" src="http://webcsstips.files.wordpress.com/2009/11/vertcenttxt2.jpg?w=455" alt=""   /></a></p>
<h3>Vertically Centered Image</h3>
<p>An image is done the same way as the text, except that instead of text, you provide an image.</p>
<h4>CSS</h4>
<pre>body{font-size:14px;}
*.box{position:absolute; width:100%;
  border: 1px solid #8b0000;
  top:50%; left:0; right:0; text-align:center;}</pre>
<h4>HTML</h4>
<pre>&lt;div class="box"&gt;
&lt;img src="kangarooflowerthumbsmall.gif" height="38px"
 width="50px" /&gt;
&lt;/div&gt;</pre>
<h4>What it Looks Like</h4>
<h2><a href="http://webcsstips.files.wordpress.com/2009/11/vertcentimage3.jpg"><img class="aligncenter size-full wp-image-462" title="vertcentimage" src="http://webcsstips.files.wordpress.com/2009/11/vertcentimage3.jpg?w=455" alt=""   /></a></h2>
<h2>Within a Box</h2>
<p>Centering something within a box on the page involves a fixed height and width and some calculations to work out the top margin setting to push the text or image down far enough so it is centered vertically.</p>
<h3>Vertically Centered Text</h3>
<p>To vertically center text within a box requires <span style="color:#993366;">font-size</span>, box <span style="color:#993366;">height</span>, box <span style="color:#993366;">width</span>, and <span style="color:#993366;">margin-top</span> settings preferably in the same units so you can make calculations to figure out how far down you need to push the text from the top of the box. I used pixels for the example.</p>
<p>The box has a border so you can see how the text centers within it. You can use this method to create buttons, boxes, divisions, and so on.</p>
<h4>CSS</h4>
<p>The text is nested within a fixed <span style="color:#993366;">height </span>and <span style="color:#993366;">width </span>box. The <span style="color:#993366;">textbox </span>is set to 100% <span style="color:#993366;">height </span>and <span style="color:#993366;">width </span>of it&#8217;s parent. The <span style="color:#993366;">margin-top</span> value is calculated for the <span style="color:#993366;">textbox </span>by halving the fixed <span style="color:#993366;">height </span>of the parent <em>(200px/2px = 100px)</em> and subtracting half the height of the font-size <em>(100px &#8211; 7px  = 93 px)</em>, and subtracting the border width<em> (93px &#8211; 1 px = 92px)</em>.</p>
<p><strong>Note:</strong> Both box2 and textbox must use absolute positioning to work in Internet Explorer.</p>
<pre>body{font-size:14px;}
*.box2{position:absolute; height:200px; width:200px; border:1px solid #8b0000;}
*.textbox{position:absolute; text-align:center;  margin-top:92px;
  height:100%; width:100%;}</pre>
<h4>HTML</h4>
<p>The <span style="color:#993366;">textbox </span>is nested within the fixed <span style="color:#993366;">height </span>and <span style="color:#993366;">width </span>parent box. The <span style="color:#993366;">margin-top</span> setting of the <span style="color:#993366;">textbox </span>centers it vertically within its parent box.</p>
<pre>&lt;div class="box2"&gt;
&lt;div class="textbox"&gt;Vertically Centered Box Text
&lt;/div&gt;
&lt;/div&gt;</pre>
<h4>What it Looks Like</h4>
<p><a href="http://webcsstips.files.wordpress.com/2009/11/boxtxt.jpg"><img class="aligncenter size-full wp-image-460" title="boxtxt" src="http://webcsstips.files.wordpress.com/2009/11/boxtxt.jpg?w=455" alt=""   /></a></p>
<h3>Vertically Centered Image</h3>
<p>An image is done the same way as the text, except that instead of text, you provide an image and the <span style="color:#993366;">margin-top</span> calculation does not take the <span style="color:#993366;">border</span> into account because the image sits inside the <span style="color:#993366;">border</span>.</p>
<h4>CSS</h4>
<p>The <span style="color:#993366;">margin-top</span> value is half the parent <span style="color:#993366;">height </span><em>(200px/2px = 100px)</em> minus half the <span style="color:#993366;">height </span>of the image <em>(100px &#8211; 19px = 81px)</em>.</p>
<p><strong>Note:</strong> Both box2 and textbox must use absolute positioning to work in Internet Explorer.</p>
<pre>body{font-size:14px;}
*.box2{position:absolute; height:200px; width:200px; border:1px solid #8b0000;}
*.imagebox{position:absolute; text-align:center;  margin-top:81px;
  height:100%; width:100%;}</pre>
<h4>HTML</h4>
<pre>&lt;div class="box2"&gt;
&lt;div class="imagebox"&gt;
&lt;img src="kangarooflowerthumbsmall.gif" height="38px" width="50px" /&gt;
&lt;/div&gt;
&lt;/div&gt;</pre>
<h4>What it Looks Like</h4>
<h2><a href="http://webcsstips.files.wordpress.com/2009/11/boximage.jpg"><img class="aligncenter size-full wp-image-461" title="boximage" src="http://webcsstips.files.wordpress.com/2009/11/boximage.jpg?w=455" alt=""   /></a>Code</h2>
<p><a href="http://www.pawlan.com/monica/examples/vertical.html">Source Code</a></p>
<pre>&lt;html&gt;
&lt;head&gt;&lt;title&gt;Vertical Centering&lt;/title&gt;
&lt;style type='text/css'&gt;

body{font-size:14px;}
*.box{position:absolute; width:100%; border: 1px solid #8b0000;
 top:50%; left:0;  text-align:center; }

*.box2{position:absolute; height:200px; width:200px; border:1px solid #8b0000;}
*.textbox{position:absolute; text-align:center;  margin-top:92px; height:100%; width:100%;}
*.imagebox{position:absolute; text-align:center; margin-top:81px; height:100%; width:100%;}

&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;div&gt;
Vertically Centered Text
 &lt;!-- &lt;img src="kangarooflowerthumbsmall.gif" height="38px" width="50px" /&gt; --&gt;
&lt;/div&gt;

&lt;div&gt;
&lt;div&gt;
Vertically Centered Box Text
&lt;/div&gt;
&lt;/div&gt;

&lt;div&gt;
&lt;div&gt;
&lt;img src="kangarooflowerthumbsmall.gif" height="38px" width="50px" /&gt;
&lt;/div&gt;
&lt;/div&gt;

&lt;/body&gt;
&lt;/html&gt;</pre>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/webcsstips.wordpress.com/430/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/webcsstips.wordpress.com/430/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/webcsstips.wordpress.com/430/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/webcsstips.wordpress.com/430/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/webcsstips.wordpress.com/430/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/webcsstips.wordpress.com/430/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/webcsstips.wordpress.com/430/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/webcsstips.wordpress.com/430/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/webcsstips.wordpress.com/430/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/webcsstips.wordpress.com/430/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/webcsstips.wordpress.com/430/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/webcsstips.wordpress.com/430/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/webcsstips.wordpress.com/430/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/webcsstips.wordpress.com/430/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webcsstips.wordpress.com&amp;blog=8554814&amp;post=430&amp;subd=webcsstips&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://webcsstips.wordpress.com/2009/11/18/vertical-centering/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/883f2db06f32939c8d773effb8f3ac9e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mpawlan</media:title>
		</media:content>

		<media:content url="http://webcsstips.files.wordpress.com/2009/11/vertcenttxt2.jpg" medium="image">
			<media:title type="html">vertcenttxt</media:title>
		</media:content>

		<media:content url="http://webcsstips.files.wordpress.com/2009/11/vertcentimage3.jpg" medium="image">
			<media:title type="html">vertcentimage</media:title>
		</media:content>

		<media:content url="http://webcsstips.files.wordpress.com/2009/11/boxtxt.jpg" medium="image">
			<media:title type="html">boxtxt</media:title>
		</media:content>

		<media:content url="http://webcsstips.files.wordpress.com/2009/11/boximage.jpg" medium="image">
			<media:title type="html">boximage</media:title>
		</media:content>
	</item>
		<item>
		<title>Centering</title>
		<link>http://webcsstips.wordpress.com/2009/11/03/centering/</link>
		<comments>http://webcsstips.wordpress.com/2009/11/03/centering/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 07:00:37 +0000</pubDate>
		<dc:creator>Monica</dc:creator>
				<category><![CDATA[Design Tips]]></category>
		<category><![CDATA[See All]]></category>
		<category><![CDATA[centering elements]]></category>
		<category><![CDATA[centering text]]></category>
		<category><![CDATA[concentric elements]]></category>
		<category><![CDATA[positioned elements]]></category>

		<guid isPermaLink="false">http://webcsstips.wordpress.com/?p=395</guid>
		<description><![CDATA[Have you ever struggled with centering text, elements, or both? It can be a little tricky, but knowing a few basics can help you get the page to look exactly the way you want it to look. This blog explains how. Centered Body Page Text If you want all text on the page centered, add [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webcsstips.wordpress.com&amp;blog=8554814&amp;post=395&amp;subd=webcsstips&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Have you ever struggled with centering text, elements, or both? It can be a little tricky, but knowing a few basics can help you get the page to look exactly the way you want it to look. This blog explains how.</p>
<h2>Centered Body Page Text</h2>
<p>If you want all text on the page centered, add <span style="color:#993366;">text-align:center</span> to the body style.</p>
<h3>CSS</h3>
<p>The following page body styles centers white text within the left and right margins. The left margin is 100px and the right margin is <span style="color:#993366;">auto </span>by default because it is not specified.</p>
<pre>body{color:#ffffff; font-family:arial; background-color:#969696;
     margin-left:100px; text-align:center;}</pre>
<h3>HTML</h3>
<p>This is what the HTML looks like:</p>
<p>&lt;h1&gt;Centering&lt;/h1&gt;</p>
<p>&lt;p&gt;<br />
The pullover and cardigan sweater instructions assume you have an intermediate knowledge of crochet or knitting. This means you know how to work to gauge, increase, decrease, match pieces, and sew pieces together. If you have this background, it is not difficult to design your own pullover sweater to fit the way you want. You will need an old sweater that fits you the way you want, a stitch you like, yarn you like that works with the stitch, and a little know-how.<br />
&lt;/p&gt;</p>
<p>And it renders like this with headings and text centered within the page margins:</p>
<p><img class="aligncenter size-full wp-image-405" title="bodycenter" src="http://webcsstips.files.wordpress.com/2009/11/bodycenter1.jpg?w=455" alt="bodycenter"   /></p>
<h2>Centered Element Text</h2>
<p>You can also use the <span style="color:#993366;">text-align:center</span> style to center text within a specific element, rather than the whole page.</p>
<h3>CSS</h3>
<p>The following style settings move the <span style="color:#993366;">text-align:center</span> style from the body tag to it&#8217;s own textbox style. The body page has a left and right margin of 10 pixels in this example.</p>
<pre>body{color:#ffffff; font-family:arial; background-color:#969696;
     margin:10px; }
*.textbox{text-align:center;}</pre>
<h3>HTML</h3>
<p>This is what the HTML looks like:</p>
<p>&lt;h1&gt;Centering&lt;/h1&gt;</p>
<p>&lt;div class=&#8221;textbox&#8221;&gt;<br />
The pullover and cardigan sweater instructions assume you have an intermediate knowledge of crochet or knitting. This means you know how to work to gauge, increase, decrease, match pieces, and sew pieces together. If you have this background, it is not difficult to design your own pullover sweater to fit the way you want. You will need an old sweater that fits you the way you want, a stitch you like, yarn you like that works with the stitch, and a little know-how.<br />
&lt;/div&gt;</p>
<p>And it renders like this with a left-aligned heading and text centered within the text box. The text box does not have left and right margin settings so it stretches the width of the page, but sits within the page left and right margins of 10 pixels.</p>
<p><img class="aligncenter size-full wp-image-406" title="textboxcenter" src="http://webcsstips.files.wordpress.com/2009/11/textboxcenter1.jpg?w=455" alt="textboxcenter"   /></p>
<h2>Centered Elements</h2>
<p>You can size and center an element on the body page or within another element. There are two basic approaches to centering any element:</p>
<p>1. Specify the width and let the browser calculate the left and right margins:</p>
<pre>*.center{border: 1px solid #000000;
  padding:3px; text-align:center;
  width: 200px; margin-left:auto; margin-right:auto;}
<img class="aligncenter size-medium wp-image-417" title="centerelement" src="http://webcsstips.files.wordpress.com/2009/11/centerelement.jpg?w=278&#038;h=300" alt="centerelement" width="278" height="300" /></pre>
<p>2. Specify the margins and let the browser calculate the width:</p>
<pre>*.center1{border: 1px solid #000000;
  padding:3px;  text-align:center;
  width: auto; margin-left:100px; margin-right:100px;}
<img class="aligncenter size-medium wp-image-418" title="centerelement1" src="http://webcsstips.files.wordpress.com/2009/11/centerelement1.jpg?w=191&#038;h=300" alt="centerelement1" width="191" height="300" /></pre>
<p>You can center an element within another element. This examples horizontally centers text within a textbox that is horizontally centered within a parent box that is horizontally centered on the page.</p>
<h3>CSS</h3>
<pre>*.center{border: 1px solid #00008b; padding:30px; height:auto; width:50%;
 margin-left:auto; margin-right:auto;}

*.textbox{border: 1px solid #000000; padding:3px;
 height:auto; width:auto; text-align:center;}</pre>
<h3>HTML</h3>
<p>&lt;div class=&#8221;center&#8221;&gt;<br />
&lt;div class=&#8221;textbox&#8221;&gt;<br />
The pullover and cardigan sweater instructions assume you have an intermediate knowledge of crochet or knitting. This means you know how to work to gauge, increase, decrease, match pieces, and sew pieces together. If you have this background, it is not difficult to design your own pullover sweater to fit the way you want. You will need an old sweater that fits you the way you want, a stitch you like, yarn you like that works with the stitch, and a little know-how<br />
&lt;/div&gt;<br />
&lt;/div&gt;</p>
<p>And it looks like this:</p>
<p><img class="aligncenter size-medium wp-image-422" title="concentric" src="http://webcsstips.files.wordpress.com/2009/11/concentric.jpg?w=300&#038;h=289" alt="concentric" width="300" height="289" /></p>
<p>If you change the parent box to use <span style="color:#993366;">absolute </span>or <span style="color:#993366;">fixed </span>positioning, you can use <span style="color:#993366;">left</span>, <span style="color:#993366;">right</span>, <span style="color:#993366;">top</span>, and/or <span style="color:#993366;">bottom </span>to position it against the respective border of the view port if you used fixed positioning or of its parent if you used absolute positioning.</p>
<h3>CSS</h3>
<p>In this example, the parent uses <span style="color:#993366;">fixed </span>positioning with the <span style="color:#993366;">bottom:0</span> property so the concentric elements and text sit  on the bottom border of the view port. You can read about positioned elements by browsing the <em>Positioning Elements</em> category of this blog.</p>
<pre>*.center{position:fixed; bottom:0; left:0; border: 1px solid #00008b; padding:30px; height:auto; width:50%;
 margin-left:auto; margin-right:auto;}

*.textbox{border: 1px solid #000000; padding:3px;
 height:auto; width:auto; text-align:center;}</pre>
<h3>HTML</h3>
<p>&lt;div&gt;<br />
&lt;div&gt;<br />
The pullover and cardigan sweater instructions assume you have an intermediate knowledge of crochet or knitting. This means you know how to work to gauge, increase, decrease, match pieces, and sew pieces together. If you have this background, it is not difficult to design your own pullover sweater to fit the way you want. You will need an old sweater that fits you the way you want, a stitch you like, yarn you like that works with the stitch, and a little know-how<br />
&lt;/div&gt;<br />
&lt;/div&gt;</p>
<p>And it looks like this:</p>
<p><img class="aligncenter size-medium wp-image-424" title="anchored" src="http://webcsstips.files.wordpress.com/2009/11/anchored.jpg?w=300&#038;h=260" alt="anchored" width="300" height="260" /></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/webcsstips.wordpress.com/395/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/webcsstips.wordpress.com/395/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/webcsstips.wordpress.com/395/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/webcsstips.wordpress.com/395/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/webcsstips.wordpress.com/395/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/webcsstips.wordpress.com/395/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/webcsstips.wordpress.com/395/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/webcsstips.wordpress.com/395/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/webcsstips.wordpress.com/395/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/webcsstips.wordpress.com/395/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/webcsstips.wordpress.com/395/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/webcsstips.wordpress.com/395/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/webcsstips.wordpress.com/395/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/webcsstips.wordpress.com/395/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webcsstips.wordpress.com&amp;blog=8554814&amp;post=395&amp;subd=webcsstips&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://webcsstips.wordpress.com/2009/11/03/centering/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/883f2db06f32939c8d773effb8f3ac9e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mpawlan</media:title>
		</media:content>

		<media:content url="http://webcsstips.files.wordpress.com/2009/11/bodycenter1.jpg" medium="image">
			<media:title type="html">bodycenter</media:title>
		</media:content>

		<media:content url="http://webcsstips.files.wordpress.com/2009/11/textboxcenter1.jpg" medium="image">
			<media:title type="html">textboxcenter</media:title>
		</media:content>

		<media:content url="http://webcsstips.files.wordpress.com/2009/11/centerelement.jpg?w=278" medium="image">
			<media:title type="html">centerelement</media:title>
		</media:content>

		<media:content url="http://webcsstips.files.wordpress.com/2009/11/centerelement1.jpg?w=191" medium="image">
			<media:title type="html">centerelement1</media:title>
		</media:content>

		<media:content url="http://webcsstips.files.wordpress.com/2009/11/concentric.jpg?w=300" medium="image">
			<media:title type="html">concentric</media:title>
		</media:content>

		<media:content url="http://webcsstips.files.wordpress.com/2009/11/anchored.jpg?w=300" medium="image">
			<media:title type="html">anchored</media:title>
		</media:content>
	</item>
		<item>
		<title>Styling Background Images</title>
		<link>http://webcsstips.wordpress.com/2009/10/21/styling-background-images/</link>
		<comments>http://webcsstips.wordpress.com/2009/10/21/styling-background-images/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 07:00:34 +0000</pubDate>
		<dc:creator>Monica</dc:creator>
				<category><![CDATA[Design Tips]]></category>
		<category><![CDATA[See All]]></category>
		<category><![CDATA[background images]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[positioning images]]></category>

		<guid isPermaLink="false">http://webcsstips.wordpress.com/?p=362</guid>
		<description><![CDATA[Background images are positioned behind elements with the background property.  The background property has the following style values that can be specified in one line and in any order like this: *.image{background:none transparent repeat left top scroll;} or with property-value pairs  in any order, like this: *.image{background-image:none; background-color:transparent; background-repeat:repeat; background-position:left top; background-attachment:scroll;} Default Settings The [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webcsstips.wordpress.com&amp;blog=8554814&amp;post=362&amp;subd=webcsstips&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Background images are positioned behind elements with the <span style="color:#993366;">background</span> property.  The <span style="color:#993366;">background </span>property has the following style values that can be specified in one line and in any order like this:</p>
<pre>*.image{background:none transparent repeat left top scroll;}</pre>
<p>or with property-value pairs  in any order, like this:</p>
<pre>*.image{background-image:none; background-color:transparent;
background-repeat:repeat; background-position:left top;
background-attachment:scroll;}</pre>
<h2>Default Settings</h2>
<p>The <span style="color:#993366;">background</span> values all have default settings as described here and covered in more detail below.</p>
<ul>
<li><span style="color:#993366;">none</span>: no image</li>
<li><span style="color:#993366;">transparent:</span> no background color</li>
<li><span style="color:#993366;">repeat:</span> the background image tiles in the x and y directions</li>
<li><span style="color:#993366;">left top:</span> the tiling starts in the top-left corner and goes from left to right one row at a time</li>
<li><span style="color:#993366;">scroll:</span> the image scrolls with the element when the  viewport has scroll bars.</li>
</ul>
<h2>Background Image</h2>
<p>The default is no background image. A background image is specified with a URL as follows:</p>
<pre>*.image{background-image:url("theimage.extension");}</pre>
<h3>CSS</h3>
<p>These CSS style declarations create a containing block for an image that tiles the full height and width of the block.</p>
<pre>div{height:100%; width:100%;}
*.image{background-image:url("kangarooflowerthumb.gif");}</pre>
<h3>HTML</h3>
<pre>&lt;div class="image"&gt;
&lt;/div&gt;</pre>
<h3>How it Looks</h3>
<p>This screen capture shows a portion of the page. In reality, the CSS settings have the background image tiling the entire height and width of the page because the <span style="color:#993366;">height </span>and <span style="color:#993366;">width </span>of the <span style="color:#993366;">div </span>are both set to 100%.</p>
<pre><img class="aligncenter size-full wp-image-373" title="tiled" src="http://webcsstips.files.wordpress.com/2009/10/tiled.jpg?w=455" alt="tiled"   /></pre>
<h2>Background Color</h2>
<p>It&#8217;s always a good idea to specify a background color in case the image does not load. The background color should work with the text color so you do not end up with a very-hard-to-read page with something like a very light blue text against a white background. You can also use a background color in place of a background image or to complement the background image. In any case, always keep in mind how the page will look if the image does not load for some reason or another.</p>
<p>This example shows white text against a medium gray background color. I&#8217;ll add the image in the next section, but you can see that if the image does not load the text is perfectly readable against the background color.</p>
<h3>CSS</h3>
<p>Text color is white (<span style="color:#993366;">#ffffff</span>) and page background color is medium gray (<span style="color:#993366;">#969696</span>).</p>
<pre>body{color:#ffffff; font-family:arial; background-color:#969696;
     margin:0;}
div{height:100%; width:100%; padding:10px;}
*.text{width:80%;}</pre>
<h3>HTML</h3>
<p>&lt;div class=&#8221;text&#8221;&gt;<br />
Red and green kangaroo paws are native to Perth, Western Australia, where the weather tends to be warm all year round. I remember the first time I saw them.  It must have been exactly the right time of year because hundreds were blooming in a Eucalyptus grove in the middle of Kings Park. Their soft, velvety red and green &#8220;fur&#8221; fascinated me, and when I moved back to the United States and eventually bought a house, I wanted to try to grow them. San Jose, California, has an extreme climate, but I have succeeded in growing them outside in pots placed in a protected area.<br />
&lt;/div&gt;</p>
<h3>How it Looks</h3>
<p><img class="aligncenter size-full wp-image-382" title="bgcolor" src="http://webcsstips.files.wordpress.com/2009/10/bgcolor.jpg?w=455" alt="bgcolor"   /></p>
<h2>Position &amp; Repeat Along Y-Axis</h2>
<p>In this section, I&#8217;ll add the background image, make it repeat vertically along the y-axis, and position it to the right of the text.</p>
<h3>CSS</h3>
<p>The repeat-y value tells the browser to repeat the image  in a column along the y-axis. The positioning values of <span style="color:#993366;">top right</span> mean the image rendering starts with the top-right corner of the image flush with the top-right corner of the viewport and repeats down along the y-axis.</p>
<pre>body{color:#ffffff; font-family:arial; background-color:#969696;
     margin:0;}
*.art{background-image: url("kangarooflowerthumb.gif");}
*.repeat{background-repeat:repeat-y;}
*.position{background-position:top right;}
div{height:100%; width:100%; padding:10px;}
*.text{width:80%;}</pre>
<h3>HTML</h3>
<p>&lt;div class=&#8221;art repeat position&#8221;&gt;<br />
&lt;div class=&#8221;text&#8221;&gt;<br />
Red and green kangaroo paws are native to Perth, Western Australia, where the weather tends to be warm all year round. I remember the first time I saw them. It must have been exactly the right time of year because hundreds were blooming in a Eucalyptus grove in the middle of Kings Park. Their soft, velvety red and green &#8220;fur&#8221; fascinated me, and when I moved back to the United States and eventually bought a house, I wanted to try to grow them. San Jose, California, has an extreme climate, but I have succeeded in growing them outside in pots placed in a protected area.&lt;/div&gt;<br />
&lt;/div&gt;</p>
<h3>How it Looks</h3>
<p><img class="aligncenter size-full wp-image-384" title="repeat" src="http://webcsstips.files.wordpress.com/2009/10/repeat.jpg?w=455&#038;h=253" alt="repeat" width="455" height="253" /></p>
<h2>Attachment</h2>
<p>The default value for attachment is scroll, which means the image scrolls with its containing block. That means, if you resize the page so that you get scroll bars along the bottom or the side and scroll, the image and text scroll together. If you change the value to fixed (<span style="color:#993366;">background-attachment:fixed</span>), the image is attached to the viewport. This means that if you resize the page so that you get scroll bars, the text scrolls over the image.</p>
<h3>CSS</h3>
<pre>body{color:#ffffff; font-family:arial; background-color:#969696;
     margin:0;}
*.art{background-image: url("kangarooflowerthumb.gif");}
*.repeat{background-repeat:repeat-y;}
*.position{background-position:top right; }
*.attach{background-attachment:fixed;}
div{height:100%; width:100%; padding:10px;}
*.text{width:80%;}</pre>
<h3>HTML</h3>
<p>&lt;div class=&#8221;art repeat position&#8221;&gt;<br />
&lt;div class=&#8221;text&#8221;&gt;<br />
Red and green kangaroo paws are native to Perth, Western Australia, where the weather tends to be warm all year round. I remember the first time I saw them. It must have been exactly the right time of year because hundreds were blooming in a Eucalyptus grove in the middle of Kings Park. Their soft, velvety red and green &#8220;fur&#8221; fascinated me, and when I moved back to the United States and eventually bought a house, I wanted to try to grow them. San Jose, California, has an extreme climate, but I have succeeded in growing them outside in pots placed in a protected area.&lt;/div&gt;<br />
&lt;/div&gt;</p>
<h3>How it Looks</h3>
<p><img class="aligncenter size-full wp-image-389" title="attachfixed" src="http://webcsstips.files.wordpress.com/2009/10/attachfixed.jpg?w=455&#038;h=243" alt="attachfixed" width="455" height="243" /></p>
<h2>Final Code</h2>
<p>See my web site for more information on <a href="http://www.pawlan.com/monica/australia/">Kangaroo Paws.</a></p>
<pre>&lt;head&gt;&lt;title&gt;Using Background Images&lt;/title&gt;
&lt;style type='text/css'&gt;
body{color:#ffffff; font-family:arial; background-color:#969696;
     margin:0;}
*.art{background-image: url("kangarooflowerthumb.gif");}
*.repeat{background-repeat:repeat-y;}
*.position{background-position:top right; }
*.attach{background-attachment:fixed;}
div{height:100%; width:100%; padding:10px;}
*.text{width:80%;}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class="art position repeat"&gt;
&lt;div class="text"&gt;</pre>
<p>Red and green kangaroo paws are native to Perth, Western Australia, where the weather tends to be warm all year round. I remember the first time I saw them.  It must have been exactly the right time of year because hundreds were blooming in a Eucalyptus grove in the middle of Kings Park. Their soft, velvety red and green &#8220;fur&#8221; fascinated me, and when I moved back to the United States and eventually bought a house, I wanted to try to grow them. San Jose, California, has an extreme climate, but I have succeeded in growing them outside in pots<br />
placed in a protected area.</p>
<pre>&lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/webcsstips.wordpress.com/362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/webcsstips.wordpress.com/362/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/webcsstips.wordpress.com/362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/webcsstips.wordpress.com/362/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/webcsstips.wordpress.com/362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/webcsstips.wordpress.com/362/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/webcsstips.wordpress.com/362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/webcsstips.wordpress.com/362/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/webcsstips.wordpress.com/362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/webcsstips.wordpress.com/362/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/webcsstips.wordpress.com/362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/webcsstips.wordpress.com/362/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/webcsstips.wordpress.com/362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/webcsstips.wordpress.com/362/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webcsstips.wordpress.com&amp;blog=8554814&amp;post=362&amp;subd=webcsstips&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://webcsstips.wordpress.com/2009/10/21/styling-background-images/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/883f2db06f32939c8d773effb8f3ac9e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mpawlan</media:title>
		</media:content>

		<media:content url="http://webcsstips.files.wordpress.com/2009/10/tiled.jpg" medium="image">
			<media:title type="html">tiled</media:title>
		</media:content>

		<media:content url="http://webcsstips.files.wordpress.com/2009/10/bgcolor.jpg" medium="image">
			<media:title type="html">bgcolor</media:title>
		</media:content>

		<media:content url="http://webcsstips.files.wordpress.com/2009/10/repeat.jpg" medium="image">
			<media:title type="html">repeat</media:title>
		</media:content>

		<media:content url="http://webcsstips.files.wordpress.com/2009/10/attachfixed.jpg" medium="image">
			<media:title type="html">attachfixed</media:title>
		</media:content>
	</item>
		<item>
		<title>Styling Attributes</title>
		<link>http://webcsstips.wordpress.com/2009/10/08/styling-attributes/</link>
		<comments>http://webcsstips.wordpress.com/2009/10/08/styling-attributes/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 07:00:50 +0000</pubDate>
		<dc:creator>Monica</dc:creator>
				<category><![CDATA[Styling Selected Elements]]></category>
		<category><![CDATA[attributes]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[styling attributes]]></category>

		<guid isPermaLink="false">http://webcsstips.wordpress.com/?p=347</guid>
		<description><![CDATA[Have you ever wanted to style a specific attribute?  For example, you could make all tables using the border attribute have a border with a given color. This way, each table could have a different border width, but the border would be the same color. Or you could do something like make every image with [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webcsstips.wordpress.com&amp;blog=8554814&amp;post=347&amp;subd=webcsstips&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Have you ever wanted to style a specific attribute?  For example, you could make all tables using the <span style="color:#993366;">border </span>attribute have a border with a given color. This way, each table could have a different border width, but the border would be the same color. Or you could do something like make every image with a <span style="color:#993366;">title </span> attribute have the same margin and padding settings.</p>
<p>This blog explains two ways to style attributes.</p>
<h2>Example 1</h2>
<p>This example shows how you could give a number of tables with borders of different widths  the same color border with one line of CSS.</p>
<h2>CSS</h2>
<p>The first line uses square brackets around the border attribute on a table to specify a green border  and a light gray background. The next two lines specify styles that apply to all table and table column (td) elements.</p>
<pre>table[border] {border-color:#008b00; background-color:#cccccc;}
table{width:30%; height:15%;}
td{text-align:center;}</pre>
<h2>Table Code</h2>
<p>This is what the table code looks like.</p>
<p>Table 1 has a 2px border plus all the table styles specified in the CSS. Because table as the border attribute, the border and background color settings are applied to the table.</p>
<pre>&lt;table border="2px"&gt;
&lt;tr&gt;&lt;th&gt;Head 1&lt;/th&gt;&lt;th&gt;Head 2&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Row 1 Col 1&lt;/td&gt;&lt;td&gt;Row 2 Col 2&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</pre>
<p>Table 2 has a 4px border plus all the table styles specified in the CSS including the border attribute styles:</p>
<pre>&lt;table border="4px"&gt;
&lt;tr&gt;&lt;th&gt;Head 1&lt;/th&gt;&lt;th&gt;Head 2&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Row 1 Col 1&lt;/td&gt;&lt;td&gt;Row 2 Col 2&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</pre>
<h2>What it Looks Like</h2>
<p>You get two tables with the same style settings that allows for the border width to be set directly on the table, and thereby specific to each table, but styled consistently with one line of CSS.</p>
<pre><img title="tableborderattribute" src="http://webcsstips.files.wordpress.com/2009/10/tableborderattribute.jpg?w=299&#038;h=177" alt="tableborderattribute" width="299" height="177" /></pre>
<h1>Example 2</h1>
<p>Maybe you have a lot of tables with 2px and 4px borders and you want to style all the 2px borders one way and all the 4px borders another. You can do that by using the syntax that lets you select on a specific word.</p>
<p>This example shows you how to make all 2px borders green with a light gray background and all 4px borders red with a light gray background.</p>
<h2>CSS</h2>
<p>The first two lines use square brackets around the border attribute on a table to specify the  border  background colors. They also include the tilde-equals (~=) syntax to say that every border attribute that includes the word, 2px, has the specified  set of styles and every border attribute that includes the word, 4px, has a different set of styles.</p>
<pre>table[border~="2px"] {border-color:#008b00; background-color:#cccccc;}
table[border~="4px"] {border-color:#8b0000; background-color:#cccccc;}
table{width:30%; height:15%;}
td{text-align:center;}</pre>
<h2>Table Code</h2>
<pre>Same as before:

&lt;table border="2px"&gt;
&lt;tr&gt;&lt;th&gt;Head 1&lt;/th&gt;&lt;th&gt;Head 2&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Row 1 Col 1&lt;/td&gt;&lt;td&gt;Row 2 Col 2&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;

&lt;table border="4px"&gt;
&lt;tr&gt;&lt;th&gt;Head 1&lt;/th&gt;&lt;th&gt;Head 2&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Row 1 Col 1&lt;/td&gt;&lt;td&gt;Row 2 Col 2&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</pre>
<h2>What it Looks Like</h2>
<p>The 2px table border is green and the 4px table border is red.</p>
<p><img class="aligncenter size-full wp-image-354" title="tablebordertwoattributes" src="http://webcsstips.files.wordpress.com/2009/10/tablebordertwoattributes.jpg?w=455" alt="tablebordertwoattributes"   /></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/webcsstips.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/webcsstips.wordpress.com/347/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/webcsstips.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/webcsstips.wordpress.com/347/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/webcsstips.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/webcsstips.wordpress.com/347/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/webcsstips.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/webcsstips.wordpress.com/347/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/webcsstips.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/webcsstips.wordpress.com/347/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/webcsstips.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/webcsstips.wordpress.com/347/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/webcsstips.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/webcsstips.wordpress.com/347/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webcsstips.wordpress.com&amp;blog=8554814&amp;post=347&amp;subd=webcsstips&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://webcsstips.wordpress.com/2009/10/08/styling-attributes/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/883f2db06f32939c8d773effb8f3ac9e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mpawlan</media:title>
		</media:content>

		<media:content url="http://webcsstips.files.wordpress.com/2009/10/tableborderattribute.jpg" medium="image">
			<media:title type="html">tableborderattribute</media:title>
		</media:content>

		<media:content url="http://webcsstips.files.wordpress.com/2009/10/tablebordertwoattributes.jpg" medium="image">
			<media:title type="html">tablebordertwoattributes</media:title>
		</media:content>
	</item>
		<item>
		<title>CSS Selectors &amp; Elements</title>
		<link>http://webcsstips.wordpress.com/2009/10/01/css-selectors-elements/</link>
		<comments>http://webcsstips.wordpress.com/2009/10/01/css-selectors-elements/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 07:00:49 +0000</pubDate>
		<dc:creator>Monica</dc:creator>
				<category><![CDATA[See All]]></category>
		<category><![CDATA[Styling Selected Elements]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[elements]]></category>
		<category><![CDATA[first-child]]></category>
		<category><![CDATA[ID]]></category>
		<category><![CDATA[selectors]]></category>
		<category><![CDATA[styling]]></category>
		<category><![CDATA[type]]></category>

		<guid isPermaLink="false">http://webcsstips.wordpress.com/?p=335</guid>
		<description><![CDATA[This blogs explains how to use type, class, and ID to style elements within a document. It also explains how you can select elements according to whether they are descendants, children, or siblings of other elements. Type The type is the element itself, such as p or h1. For example, the below CSS declarations states [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webcsstips.wordpress.com&amp;blog=8554814&amp;post=335&amp;subd=webcsstips&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This blogs explains how to use type, class, and ID to style elements within a document. It also explains how you can select elements according to whether they are descendants, children, or siblings of other elements.</p>
<h2>Type</h2>
<p>The type is the element itself, such as <span style="color:#993366;">p</span> or <span style="color:#993366;">h1</span>. For example,  the below CSS declarations states that all elements of type <span style="color:#993366;">p</span> are indented on the left by 15px and all elements of type <span style="color:#993366;">h1</span> are blue.</p>
<pre>p{margin-left:15px;
h1{color:#00008b;}
</pre>
<p>&lt;p&gt;This paragraph is idented by 15px on the left.&lt;/p&gt;<br />
&lt;h1&gt;<span style="color:#0000ff;">This heading is Blue</span>&lt;/h1&gt;</p>
<h2>Class</h2>
<p>A class is a CSS style description of a group of elements that might be the same kind or of mixed kinds. For example, the below CSS declaration states that all paragraph elements of in the class green have green text and any element assigned to the class centered has centered text.</p>
<pre>p.green{color:#009900;}
*.centered{text-align:center;}

&lt;p class="green"&gt;
<span style="color:#008000;">This paragraph has green text</span>
&lt;/p&gt;</pre>
<p>&lt;p class=&#8221;centered&#8221;&gt;</p>
<p style="text-align:center;">This paragraph has centered text.</p>
<p>&lt;/p&gt;</p>
<p>&lt;p class=&#8221;green centered&#8221;&gt;</p>
<p style="text-align:center;"><span style="color:#008000;">This paragraph has green centered text.</span></p>
<p>&lt;/p&gt;</p>
<h2>ID</h2>
<p>An ID uniquely identifies an element. An ID is assigned to one element only, and any element should have zero or one ID, but not two or more IDs. An ID can also be used as an anchor that can be targeted by other links or used to access and manipulate a specific element from JavaScript or a document processor.</p>
<pre>#.abstract{margin-left:10px; margin-right:10px;}</pre>
<p style="padding-left:30px;">&lt;p id=&#8221;abstract&#8221;&gt;This paragraph is identified as the abstract for the document. A JavaScript program can locate it and do something like add this paragraph to a list of abstracts for a series of documents. The paragraph is indented 10px on the left and right.&lt;/p&gt;</p>
<h2>Cascade Order</h2>
<p>When multiple selectors select the same element, the styles from each selector are applied. In the case where the styles conflict, the higher cascade order prevails.  IDs prevail over classes and classes prevail over types. If you use multiple style sheets in one document, ID selectors prevail over all classes and types in all style sheets.</p>
<pre>*.bluetext{color:#000099;}
#.abstract{margin-left:10px; margin-right:10px; color:#990000;}</pre>
<p>&lt;p id=&#8221;abstract&#8221; class=&#8221;bluetext&#8221;&gt;<span style="color:#ff0000;">In this case the paragraph has both an ID and a class and each specifies a setting for the text color. Class says the color is blue and ID says the color is red. The color specified by the ID takes precedence because it has a higher cascade order.</span>&lt;/p&gt;</p>
<pre>*.bluetext{color:#000099;}
*.abstract{margin-left:10px; margin-right:10px; color:#990000;}</pre>
<p>&lt;p class=&#8221;abstract bluetext&#8221;&gt;<span style="color:#ff0000;">In this case both abstract and bluetext are classes and have equal cascade order. The text is red because abstract is listed after bluetext in the styles.</span>&lt;/p&gt;</p>
<h2>Group Selectors</h2>
<p>You can apply the same styles to a group of selectors by separating the selectors with a comma. In this example all p, ol, and ul elements use the Arial font.</p>
<pre>p, ol, ul, li{font-family:arial;}</pre>
<h2>Position Selectors</h2>
<p>You can apply styles according to whether an element is a descendant, child, or sibling of another element.</p>
<h3>Descendant</h3>
<p>A descendant can be a child, grandchild, great-grandchild, etc. The following CSS declaration says make all descendants of div that are in the bluetext class, blue.</p>
<pre>div *.bluetext{color:#000099;}
</pre>
<p>&lt;p class=&#8221;bluetext&#8221;&gt;In this case the <span style="color:#993366;">p</span> element is assigned to the class<br />
<span style="color:#993366;">bluetext</span>, but the text is black, not blue. This is because <span style="color:#993366;">bluetext</span> has to be assigned<br />
to an element that is a descendent of <span style="color:#993366;">div</span>.<br />
&lt;/p&gt;</p>
<p>&lt;div&gt;<br />
&lt;p class=&#8221;bluetext&#8221;&gt;<span style="color:#0000ff;">The text is now blue because element p is in the blue<br />
text class *and* a descendant of div.</span><br />
&lt;/p&gt;</p>
<h3>Child</h3>
<p>To select the direct child only &#8212; no grandchildren or any of their descendants &#8212; use the greater-than sign. A child element is the immediate or direct descendant of another element. For example, all &lt;li&gt; elements in an unordered list are children of the &lt;ul&gt;. But any anchors on the &lt;li&gt; elements are not children of the &lt;ul&gt;. They are children of the &lt;li&gt; element.</p>
<p>This CSS style declaration says make all hyperllnks that are children of <span style="color:#993366;">li</span> red with no text decoration:</p>
<pre>li &gt; a{tect-decoration:none; color:red;}</pre>
<p><strong>Note:</strong> this does not work in Internet Explorer.</p>
<p>Using the above CSS style, this XHTML:</p>
<pre>&lt;ul&gt;
  &lt;li&gt;Item 1&lt;/li&gt;
  &lt;li&gt;&lt;a href=""&gt;Item 2&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Item 3&lt;/li&gt;
&lt;/ul&gt;</pre>
<p>Looks like this:</p>
<ul>
<li>Item 1</li>
<li><span style="color:#ff0000;">Item 2</span></li>
<li>Item 3</li>
</ul>
<h3>First Child</h3>
<p>If you want to select and style only the first child and none of its siblings, append <span style="color:#993366;">first-child</span> to the element like this:</p>
<pre>li:first-child &gt; a{text-decoration:none; color:red;}
</pre>
<p><strong>Note:</strong> this does not work in Internet Explorer.</p>
<p>Using the above CSS style declaration, this code:</p>
<pre>&lt;ul&gt;
  &lt;li&gt;&lt;a href=""&gt;Item 1&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=""&gt;Item 2&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=""&gt;Item 3&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</pre>
<p>looks like this where only the first list item is red with no text decoration:</p>
<ul>
<li><span style="color:#ff0000;">Item 1</span></li>
<li><span style="color:#3366ff;"><span style="text-decoration:underline;">Item 2</span></span></li>
<li><span style="color:#3366ff;"><span style="text-decoration:underline;">Item 3</span></span></li>
</ul>
<h3>Sibling</h3>
<p>Siblings are elements that are right next to each other. They are also called adjacent elements. For example, paragraphs typically follow (are sibllings to) headings and bulleted or ordered lists typically follow (are siblings to) paragraphs. So, this CSS style declaration says that any <span style="color:#800080;">p</span> element that immediately follows an <span style="color:#993366;">h2</span> element is blue:</p>
<pre>h2 + p{color:#00008b;}</pre>
<p><strong>Note:</strong> this does not work in Internet Explorer.</p>
<p>Using the above CSS style declaration, this code:</p>
<pre>&lt;h2&gt;Styling Siblings&lt;/h2&gt;
&lt;p&gt;This paragraph is blue because it immediately follows an h2.&lt;/p&gt;</pre>
<p>Looks like this:</p>
<h2>Styling Siblings</h2>
<p><span style="color:#3366ff;">This paragraph is blue because it immediately follows an h2.</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/webcsstips.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/webcsstips.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/webcsstips.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/webcsstips.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/webcsstips.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/webcsstips.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/webcsstips.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/webcsstips.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/webcsstips.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/webcsstips.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/webcsstips.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/webcsstips.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/webcsstips.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/webcsstips.wordpress.com/335/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webcsstips.wordpress.com&amp;blog=8554814&amp;post=335&amp;subd=webcsstips&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://webcsstips.wordpress.com/2009/10/01/css-selectors-elements/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/883f2db06f32939c8d773effb8f3ac9e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mpawlan</media:title>
		</media:content>
	</item>
		<item>
		<title>Search Engine Optimization (SEO)</title>
		<link>http://webcsstips.wordpress.com/2009/09/21/search-engine-optimization-seo/</link>
		<comments>http://webcsstips.wordpress.com/2009/09/21/search-engine-optimization-seo/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 07:00:25 +0000</pubDate>
		<dc:creator>Monica</dc:creator>
				<category><![CDATA[Design Tips]]></category>
		<category><![CDATA[See All]]></category>
		<category><![CDATA[alt tag]]></category>
		<category><![CDATA[head tag]]></category>
		<category><![CDATA[img tag]]></category>
		<category><![CDATA[keywords]]></category>
		<category><![CDATA[linking]]></category>
		<category><![CDATA[search engine optimization]]></category>
		<category><![CDATA[seo]]></category>
		<category><![CDATA[title tag]]></category>

		<guid isPermaLink="false">http://webcsstips.wordpress.com/?p=325</guid>
		<description><![CDATA[Search Engine Optimization (SEO) means building web pages that are readily found by search engines and listed at or near the top of the search results page. Being found by search engines translates to more visits to your site, and if you have an e-commerce site, it translates to more sales, better viral marketing, and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webcsstips.wordpress.com&amp;blog=8554814&amp;post=325&amp;subd=webcsstips&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Search Engine Optimization (SEO) means building web pages that are readily found by search engines and listed at or near the top of the search results page. Being found by search engines translates to more visits to your site, and if you have an e-commerce site, it translates to more sales, better viral marketing, and more cross-linking from your fans, which leads to higher search rankings, more sales, and on it goes.</p>
<p>There are a number of search engines in common use and few major ones. Not all search engines work alike, but if you learn the best practices described below, the major search engines and many of the smaller ones will readily find and list your pages.</p>
<p>Some articles on SEO list as many as 30 ways to optimize your pages for search. But many of those ways do not carry much weight with the search engines. They might have some influence, but if you focus on the somewhat fewer easy-to-remember suggestions presented here, you will get excellent results.</p>
<h2>Keywords</h2>
<p>When setting a site up for search engine optimization, it pays to think in terms of keywords. Adept handling of keywords as described below helps search engines find and highly rank the pages. You need to think about what keywords best describe your site and handle them as follows:</p>
<h2>Data within the Head Tag</h2>
<p>Your HTML pages should all have <span style="color:#993366;">&lt;head&gt;</span> tags at the top because within the head tag is the <span style="color:#993366;">&lt;title&gt;</span> tag, which is the single most important data you can provide to the search engines. To boost rankings, the most important keyword should be the first word in the title tag.</p>
<p>It&#8217;s also a good idea to include the description meta tag within the head tag. It does not influence the search ranking, but many search engines use the description text in the search results page, and providing descriptive text encourages people to choose the link to your site &#8212; sometimes over an above pages ranked higher than yours.</p>
<h3>Header Tag</h3>
<p>&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;title&gt;Monica&#8217;s Site &#8211; Home&lt;/title&gt;<br />
&lt;meta name=&#8221;description&#8221; content=&#8221;Personal site with info on professional skills and personal interests.&#8221; /&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
xxxxx<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
<h3>Search Results</h3>
<p>Here is how the above comes up on google if you search on Monica Pawlan:</p>
<p>____________________________________________________</p>
<p><span id="main" style="visibility:visible;"><span id="search" style="visibility:visible;"></p>
<h3><a href="http://www.pawlan.com/monica/"><em>Monica&#8217;s</em> Site &#8211; Home</a></h3>
<p><button></button><button></button></p>
<div>Personal site with info on professional skills and personal interests.<br />
<cite>www.<strong>pawlan</strong>.com/<strong>monica</strong>/ &#8211; </cite><a href="http://74.125.155.132/search?q=cache:XQxZ9DJTXM4J:www.pawlan.com/monica/+monica+pawlan&amp;cd=1&amp;hl=en&amp;ct=clnk&amp;gl=us">Cached</a> &#8211; <a href="http://www.google.com/search?hl=en&amp;q=related:www.pawlan.com/monica/">Similar</a> &#8211; <button></button><button></button><button></button></div>
<div>____________________________________________________</div>
<p></span></span></p>
<h2>URL Constructions</h2>
<p>Short, easy-to-remember and spell URLs make communications easier and they also help search rankings. You want to organize your site so that important keywords appear close to the domain name. For example, <span style="color:#993366;">http://www.pawlan.com/monica </span>puts my sub-site close to <span style="color:#993366;">pawlan.com</span>. Other areas such as articles or books come next (<span style="color:#993366;">http://pawlan.com/monica/books</span>) making the URLs easy to remember, spell, and friendly to search engines &#8212; as opposed to something like <span style="color:#993366;">http://pawlan.com/subdomains/monica/itemsofinterest/books.</span></p>
<p>If you want to separate words for readability, hyphens rank higher than underscores, so separate words with hyphens like this:</p>
<p><span style="color:#993366;">http://pawlan.com/sub-domains/monica/items-of-interest/books.</span></p>
<h2>Body Content</h2>
<p>The following hints for composing the body content will help boost your search engine ranking:</p>
<ul>
<li>Repeat your keywords on the page as much as good writing style allows.</li>
<li>Make sure the keywords appear near the top of the page.</li>
<li>Give your graphics <span style="color:#993366;">alt</span> tags that employ important keywords. Not only are alt tags important for accessibility, but they boost search rankings.</li>
<li>Carefully name image files and other download files to include important keywords.</li>
</ul>
<h2>Intra-Site Linking</h2>
<p>The following hints for links will help boost your search engine ranking:</p>
<ul>
<li>Cross-link within the site</li>
<li>Put important links within the body of the page in addition to in the site navigation</li>
<li>Make sure important links have keywords and are closer to the top of the site</li>
</ul>
<h2>Other Factors</h2>
<p>A well-designed, organized, and visually pleasing site with excellent content and targeted marketing encourages visitors, which results in cross-linking from across the web. Such cross-linking not only boosts traffic and search ranking, but combined with all the factors described here will give you a very successful web site. It&#8217;s definitely worth your time to optimize your site for search and market it well!</p>
<p>I hope you found this post useful.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/webcsstips.wordpress.com/325/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/webcsstips.wordpress.com/325/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/webcsstips.wordpress.com/325/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/webcsstips.wordpress.com/325/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/webcsstips.wordpress.com/325/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/webcsstips.wordpress.com/325/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/webcsstips.wordpress.com/325/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/webcsstips.wordpress.com/325/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/webcsstips.wordpress.com/325/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/webcsstips.wordpress.com/325/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/webcsstips.wordpress.com/325/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/webcsstips.wordpress.com/325/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/webcsstips.wordpress.com/325/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/webcsstips.wordpress.com/325/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webcsstips.wordpress.com&amp;blog=8554814&amp;post=325&amp;subd=webcsstips&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://webcsstips.wordpress.com/2009/09/21/search-engine-optimization-seo/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/883f2db06f32939c8d773effb8f3ac9e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mpawlan</media:title>
		</media:content>
	</item>
		<item>
		<title>Drop Caps: Floating &amp; Marginal</title>
		<link>http://webcsstips.wordpress.com/2009/09/11/drop-caps-floating-marginal/</link>
		<comments>http://webcsstips.wordpress.com/2009/09/11/drop-caps-floating-marginal/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 16:12:43 +0000</pubDate>
		<dc:creator>Monica</dc:creator>
				<category><![CDATA[See All]]></category>
		<category><![CDATA[Text Styling]]></category>
		<category><![CDATA[drop caps]]></category>
		<category><![CDATA[floating drop cap]]></category>
		<category><![CDATA[marginal drop cap]]></category>

		<guid isPermaLink="false">http://webcsstips.wordpress.com/?p=309</guid>
		<description><![CDATA[Floating drop caps are created with a relatively positioned left float. You place the relative float on the first letter of the first paragraph as an inline element like this: &#60;span class=&#8221;floatdcap&#8221;&#62;F&#60;/span&#62; so the drop &#60; You can use margin-left and margin-right settings to adjust the placement of the drop cap horizontally and the top [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webcsstips.wordpress.com&amp;blog=8554814&amp;post=309&amp;subd=webcsstips&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="float:left;position:relative;top:15px;margin-left:-3px;margin-right:3px;margin-bottom:15px;font-size:40pt;font-weight:bold;color:#00008b;">F</span>loating drop caps are created with a relatively  positioned left float. You place the relative float on the first letter of the first paragraph as an inline element like this: <span style="color:#993366;">&lt;span class=&#8221;floatdcap&#8221;&gt;F&lt;/span&gt;</span> so the drop &lt;</p>
<p>You can use <span style="color:#993366;">margin-left</span> and <span style="color:#993366;">margin-right</span> settings to adjust the placement of the drop cap horizontally and the <span style="color:#993366;">top</span> setting to adjust the placement of the drop cap vertically. The values you use for these settings depend on the <span style="color:#993366;">font-size</span> and <span style="color:#993366;">font-weight</span> and the overall look you want to achieve.  These are the settings used to get the look for the drop cap at the beginning of the paragraph above:</p>
<pre>*.floatdcap{float:left; position:relative; top: -7px;
  margin-left:-3px; margin-right:3px; margin-bottom:-6px;
  font-size:40pt; font-weight:bold; color:#00008b;}</pre>
<p>To help you understand how the settings work together, this is how the drop cap looks with a <span style="color:#993366;">border</span> applied to the paragraph so you can see how it sits inside its parent paragraph with no <span style="color:#993366;">top</span> or <span style="color:#993366;">margin</span> settings. <strong></strong></p>
<p style="padding-left:30px;"><strong>Note</strong> that I did this on Mozilla Firefox, v 2.0.0.20 on a SunRay running Solaris 10 and did not test it for other browsers and hw/sw platforms. You might need to adjust the settings shown here to accommodate other platforms.</p>
<p><img class="aligncenter size-full wp-image-319" title="border" src="http://webcsstips.files.wordpress.com/2009/09/border3.gif?w=455" alt="border"   /></p>
<p>This is how the drop cap looks with left and right <span style="color:#993366;">margin</span> settings applied:</p>
<p><img class="aligncenter size-full wp-image-313" title="margins" src="http://webcsstips.files.wordpress.com/2009/09/margins.gif?w=455" alt="margins"   /></p>
<p>And here it is with the <span style="color:#993366;">top</span> setting applied:</p>
<p><img class="aligncenter size-full wp-image-314" title="top" src="http://webcsstips.files.wordpress.com/2009/09/top.gif?w=455" alt="top"   /></p>
<p>The margin-bottom setting determines how the paragraph text flows to the left  below the drop cap. This is how it looks with <span style="color:#993366;">margin-bottom:-6px</span> followed by how it looks with <span style="color:#993366;">margin-bottom:6px</span>.</p>
<h3>Minus 6 Bottom Margin</h3>
<p><img class="aligncenter size-full wp-image-315" title="minus6" src="http://webcsstips.files.wordpress.com/2009/09/minus6.gif?w=455" alt="minus6"   /></p>
<h3>Plus 6 Bottom Margin</h3>
<p><img class="aligncenter size-full wp-image-316" title="plus6" src="http://webcsstips.files.wordpress.com/2009/09/plus6.gif?w=455" alt="plus6"   /></p>
<h2>Styled Float</h2>
<p><span style="border:3px dotted #999999;float:left;position:relative;top:1px;margin-left:-3px;margin-right:3px;font-size:20pt;font-weight:bold;color:#ffffff;background-color:#00008b;padding:2px;">T</span>his drop cap adds styling to the hanging indent so the drop cap has a background and dotted line <span style="color:#993366;">border</span>.  Below are its styling settings, which are similar to the example above with the addition of <span style="color:#993366;">padding</span>, <span style="color:#993366;">background-color</span>, and <span style="color:#993366;">border</span> settings.</p>
<pre>*.styledindent{float:left; position:relative; top:-7px;
  margin-left:-3px; margin-right:3px; padding:2px;
  font-size:20pt; font-weight:bold; color:#ffffff;
  background-color:#00008b; border:3px dotted #999999;}</pre>
<p>The best way to see how the padding, background-color, and border settings affect the look is to change them and see what happens. Basically, the padding setting adjusts the amount of space around the drop cap. The background-color fills the float area and the border applies a dotted line that sits inside the four edges of the float.</p>
<h2>Marginal Drop Cap</h2>
<p style="position:relative;margin-left:40px;margin-top:10px;"><span style="position:absolute;left:-40px;top:17px;font-size:40pt;font-weight:bold;color:#00008b;">A</span> marginal drop cap is used when you do not want  the text to wrap to the left and under the drop cap. The styling is applied to the first  letter of the first paragraph as an inline element the same way the floating drop cap  is applied. This kind of drop cap has styling to indent the paragraph, and styling applied to the letter that moves the drop cap into the left margin. Here are the style settings for the marginal drop cap at the beginning of this paragraph:</p>
<pre>*.indented{position:relative; margin-left:40px; margin-top:10px;}
*.margindcap{position:absolute; left:-40px; top:-4px;
  font-size:40pt; font-weight:bold; color:#00008b;}</pre>
<p>The indented style creates a relatively positioned margin that is 40px wide with a 10px top margin so it renders 10px below the heading above it. The margin is relatively positioned so its settings do not affect the positioning of the drop cap. The drop cap is absolutely positioned so it appears in its normal position in the flow without affecting the positioning of the paragraph to its right.</p>
<p>This figure showing a border around the drop cap and around the paragraph should help you visualize the relationship of the drop cap to the paragraph:</p>
<p><img class="aligncenter size-full wp-image-318" title="marginborder" src="http://webcsstips.files.wordpress.com/2009/09/marginborder1.gif?w=455&#038;h=96" alt="marginborder" width="455" height="96" /></p>
<h2>Source Code</h2>
<p>You can get the full source code <a href="http://www.pawlan.com/monica/examples/dropcapsfloatmargin.html">here.</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/webcsstips.wordpress.com/309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/webcsstips.wordpress.com/309/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/webcsstips.wordpress.com/309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/webcsstips.wordpress.com/309/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/webcsstips.wordpress.com/309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/webcsstips.wordpress.com/309/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/webcsstips.wordpress.com/309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/webcsstips.wordpress.com/309/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/webcsstips.wordpress.com/309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/webcsstips.wordpress.com/309/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/webcsstips.wordpress.com/309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/webcsstips.wordpress.com/309/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/webcsstips.wordpress.com/309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/webcsstips.wordpress.com/309/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webcsstips.wordpress.com&amp;blog=8554814&amp;post=309&amp;subd=webcsstips&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://webcsstips.wordpress.com/2009/09/11/drop-caps-floating-marginal/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/883f2db06f32939c8d773effb8f3ac9e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mpawlan</media:title>
		</media:content>

		<media:content url="http://webcsstips.files.wordpress.com/2009/09/border3.gif" medium="image">
			<media:title type="html">border</media:title>
		</media:content>

		<media:content url="http://webcsstips.files.wordpress.com/2009/09/margins.gif" medium="image">
			<media:title type="html">margins</media:title>
		</media:content>

		<media:content url="http://webcsstips.files.wordpress.com/2009/09/top.gif" medium="image">
			<media:title type="html">top</media:title>
		</media:content>

		<media:content url="http://webcsstips.files.wordpress.com/2009/09/minus6.gif" medium="image">
			<media:title type="html">minus6</media:title>
		</media:content>

		<media:content url="http://webcsstips.files.wordpress.com/2009/09/plus6.gif" medium="image">
			<media:title type="html">plus6</media:title>
		</media:content>

		<media:content url="http://webcsstips.files.wordpress.com/2009/09/marginborder1.gif" medium="image">
			<media:title type="html">marginborder</media:title>
		</media:content>
	</item>
		<item>
		<title>Drop Caps: Aligned &amp; Hanging</title>
		<link>http://webcsstips.wordpress.com/2009/08/25/making-drop-caps/</link>
		<comments>http://webcsstips.wordpress.com/2009/08/25/making-drop-caps/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 20:42:24 +0000</pubDate>
		<dc:creator>Monica</dc:creator>
				<category><![CDATA[See All]]></category>
		<category><![CDATA[Text Styling]]></category>
		<category><![CDATA[aligned drop cap]]></category>
		<category><![CDATA[drop caps]]></category>
		<category><![CDATA[first-letter]]></category>
		<category><![CDATA[hanging drop cap]]></category>
		<category><![CDATA[hanging indent]]></category>
		<category><![CDATA[pseudo class]]></category>

		<guid isPermaLink="false">http://webcsstips.wordpress.com/?p=281</guid>
		<description><![CDATA[Drop caps are a way to style the first letter or first word in a document or at the beginning of a major section of a document. There are a few ways to make drop caps by styling paragraphs and text, and this blog entry will walk through how to use the first-letter pseudo class [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webcsstips.wordpress.com&amp;blog=8554814&amp;post=281&amp;subd=webcsstips&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Drop caps are a way to style the first letter or first word in a document or at the beginning of a major section of a document. There are a few ways to make drop caps by styling paragraphs and text, and this blog entry will walk through how to use the first-letter pseudo class and how to make hanging drop caps. My next blog entry will cover floating and marginal drop caps.</p>
<h2>The first-letter Pseudo Class</h2>
<p><span style="font-family:courier;font-variant:smallcaps;color:#8b0000;font-weight:bold;font-size:14pt;">C</span>SS provides the pseudo-class, <span style="color:#993366;">first-letter</span>, for styling the first letter or word in a paragraph or document similar to how the first C in the word, CSS, is styled at the beginning of this paragraph. But <span style="color:#993366;">first-letter</span> works best when you only want to specify simple font and text properties such as <span style="color:#993366;">font-family</span>, <span style="color:#993366;">font-size</span>, <span style="color:#993366;">color</span>, <span style="color:#993366;">font-style</span>, <span style="color:#993366;">font-weight</span>, <span style="color:#993366;">font-variant</span>, or <span style="color:#993366;">text-transform</span>. It works well for aligned drop caps (used on this paragraph) or floating drop caps (next blog), but cannot be used for a hanging or marginal drop caps (covered below). That is because a pseudo-class does not respond to the positioning styles needed to horizontally and vertically place a hanging or marginal drop cap.</p>
<p style="padding-left:30px;"><strong>Note:</strong> A pseudo-class is a way to format or add special effects to to some HTML elements. The syntax is <span style="color:#993366;">selector:pseudo-class{property:value}</span>. So for example, p:first-letter{color:#8b0000;} uses the first-letter pseudo class to make the first letter of the p selector red. Pseudo-class styles do not work with <span style="color:#993366;">span</span>.</p>
<h3>CSS:</h3>
<pre>*.fl:first-letter{font-family:courier; color:#8b0000; font-weight:bold;
  font-size:14pt; font-variant:smallcaps;}</pre>
<h3>Tagging:</h3>
<pre>&lt;p class="fl"&gt;CSS&lt;/span&gt; Drop caps are a way  . . .&lt;/p&gt;</pre>
<h2>Hanging Drop Caps</h2>
<p style="padding-left:30px;text-indent:-30px;margin-top:-25px;"><span style="position:relative;color:#8b0000;top:21px;left:-2px;font-size:30pt;line-height:35px;font-weight:bold;">H</span>anging drop caps have two basic styles: 1) a hanging indent with settings to accommodate the height, width, and final position of the drop cap, and 2) a relatively positioned drop cap with settings to specify exactly where it sits within the hanging indent in relation to the paragraph.</p>
<p>The hanging drop cap, <span style="color:#800000;"><strong>H<span style="color:#000000;">,</span></strong></span> shown at the beginning of the above paragraph is relatively positioned because you want it to keep its position in the normal flow of elements on the page, but be able to control its horizontal and vertical placement without affecting the placement of the paragraph. Below are the style settings  and tagging to get the drop cap followed by a section that adds the styles in steps to make it easier to see what each style setting does.</p>
<h3>CSS</h3>
<pre>*.hangindent{padding-left:30px; text-indent:-30px; margin-top:-25px;}
*.dropcap{position:relative; top:21px; left:-2px; font-size:30pt;
  line-height:35px; font-weight:bold; color:#8b0000;}</pre>
<h3>Tagging</h3>
<pre>&lt;p class="hangindent"&gt;
&lt;span class="dropcap"&gt;H&lt;/span&gt;anging drop caps have two basic styles: . . . .</pre>
<h3>Step 1</h3>
<p>Hanging Indent only &#8212; no other styles applied and margin-top commented out looks like this:</p>
<h4>CSS</h4>
<pre>*.hangindent{padding-left:30px; text-indent:-30px; <span style="color:#993366;">/*margin-top:-25px;*/</span>}</pre>
<h4>Renders:</h4>
<p>Paragraph indents by <span style="color:#993366;">30px</span>, but the first line out dents (<span style="color:#993366;">text-indent:-30px)</span> by the same amount to create a hanging indent.</p>
<p style="padding-left:30px;text-indent:-30px;">Hanging drop caps have two basic styles: 1) a hanging indent with settings to accommodate the height, width, and final position of the drop cap, and 2) a relatively positioned drop cap with settings to specify exactly where it sits within the hanging indent in relation to the paragraph.</p>
<h3>Step 2</h3>
<p>Drop cap added, but margin-top still commented out on the hanging indent.</p>
<h4>CSS</h4>
<p>*.hangindent{padding-left:30px; text-indent:-30px; <span style="color:#993366;">/*margin-top:-25px;*/</span>}<br />
*.dropcap{position:relative; top:21px; left:-2px; font-size:30pt;<br />
line-height:35px; font-weight:bold; color:#8b0000;}</p>
<h4>Renders</h4>
<p>Note there is too much space between the end of this paragraph and the beginning of the paragraph with the drop cap.</p>
<p style="padding-left:30px;text-indent:-30px;"><span style="position:relative;color:#8b0000;top:21px;left:-2px;font-size:30pt;line-height:35px;font-weight:bold;">H</span>anging drop caps have two basic styles: 1) a hanging indent with settings to accommodate the height, width, and final position of the drop cap, and 2) a relatively positioned drop cap with settings to specify exactly where it sits within the hanging indent in relation to the paragraph.</p>
<h3>Step 3</h3>
<p style="padding-left:30px;text-indent:-30px;">Setting for margin-top added back:</p>
<h4>CSS</h4>
<pre>*.hangindent{padding-left:30px; text-indent:-30px; margin-top:-25px;}
*.dropcap{position:relative; top:21px; left:-2px; font-size:30pt;
  line-height:35px; font-weight:bold; color:#8b0000;}</pre>
<h4>Renders</h4>
<p>With margin-top:-25px; added, the spacing between this paragraph and the paragraph with the hanging drop cap looks good.</p>
<p style="padding-left:30px;text-indent:-30px;margin-top:-25px;"><span style="position:relative;color:#8b0000;top:21px;left:-2px;font-size:30pt;line-height:35px;font-weight:bold;">H</span>anging drop caps have two basic styles: 1) a hanging indent with settings to accommodate the height, width, and final position of the drop cap, and 2) a relatively positioned drop cap with settings to specify exactly where it sits within the hanging indent in relation to the paragraph.</p>
<h3>Step 4</h3>
<p>Make drop cap static and see how the horizontal and vertical offsets no longer work so you end up with an aligned drop cap.</p>
<h4>CSS</h4>
<p>*.hangindent{padding-left:30px; text-indent:-30px; margin-top:-25px;}<br />
*.dropcap{position:static; top:21px; left:-2px; font-size:30pt;<br />
line-height:35px; font-weight:bold; color:#8b0000;}</p>
<h4>Renders</h4>
<p style="padding-left:30px;text-indent:-30px;"><span style="position:static;color:#8b0000;top:21px;left:-2px;font-size:30pt;line-height:35px;font-weight:bold;">H</span>anging drop caps have two basic styles: 1) a hanging indent with settings to accommodate the height, width, and final position of the drop cap, and 2) a relatively positioned drop cap with settings to specify exactly where it sits within the hanging indent in relation to the paragraph.</p>
<h3>Step 5</h3>
<p>Make drop cap relative again and change left property to a value of 20px. Note how the change in the horizontal offset of the drop cap does not affect the position of the paragraph.</p>
<h4>CSS</h4>
<p>*.hangindent{padding-left:30px; text-indent:-30px; margin-top:-25px;}<br />
*.dropcap{position:static; top:21px; left:-2px; font-size:30pt;<br />
line-height:35px; font-weight:bold; color:#8b0000;}</p>
<h4>Renders</h4>
<p style="padding-left:30px;text-indent:-30px;margin-top:-25px;"><span style="position:relative;color:#8b0000;top:21px;left:20px;font-size:30pt;line-height:35px;font-weight:bold;">H</span>anging drop caps have two basic styles: 1) a hanging indent with settings to accommodate the height, width, and final position of the drop cap, and 2) a relatively positioned drop cap with settings to specify exactly where it sits within the hanging indent in relation to the paragraph.</p>
<h2>View the Full Source Code</h2>
<p><a href="http://www.pawlan.com/monica/examples/dropcapsalignhanging.html">dropcapsalignhanging.html</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/webcsstips.wordpress.com/281/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/webcsstips.wordpress.com/281/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/webcsstips.wordpress.com/281/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/webcsstips.wordpress.com/281/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/webcsstips.wordpress.com/281/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/webcsstips.wordpress.com/281/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/webcsstips.wordpress.com/281/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/webcsstips.wordpress.com/281/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/webcsstips.wordpress.com/281/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/webcsstips.wordpress.com/281/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/webcsstips.wordpress.com/281/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/webcsstips.wordpress.com/281/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/webcsstips.wordpress.com/281/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/webcsstips.wordpress.com/281/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webcsstips.wordpress.com&amp;blog=8554814&amp;post=281&amp;subd=webcsstips&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://webcsstips.wordpress.com/2009/08/25/making-drop-caps/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/883f2db06f32939c8d773effb8f3ac9e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mpawlan</media:title>
		</media:content>
	</item>
	</channel>
</rss>
