<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Design Gala &#187; CSS Drop Cap</title>
	<atom:link href="http://designgala.com/tag/css-drop-cap/feed/" rel="self" type="application/rss+xml" />
	<link>http://designgala.com</link>
	<description>Web Usability, Web Technology, User Experience</description>
	<lastBuildDate>Wed, 02 May 2012 03:55:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Magazine style drop cap first letter with CSS</title>
		<link>http://designgala.com/magazine-style-drop-cap-first-letter-with-css/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=magazine-style-drop-cap-first-letter-with-css</link>
		<comments>http://designgala.com/magazine-style-drop-cap-first-letter-with-css/#comments</comments>
		<pubDate>Mon, 07 Apr 2008 05:54:17 +0000</pubDate>
		<dc:creator>Anish Lama</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS Drop Cap]]></category>

		<guid isPermaLink="false">http://www.designgala.com/magazine-style-drop-cap-first-letter-with-css/</guid>
		<description><![CDATA[Its been a quite while the trend of drop cap being used in website paragraphs. This article demonstrate on techniques on first letter drop cap using CSS.]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.designgala.com/wp-content/uploads/2008/04/drop_cap_first_letter.jpg" class="alignleft" alt="Drop cap first letter" />When was the first time drop caps first letter introduced in newspaper, magazine? But its been a quite while the trend of drop cap used in web business. First letter drop cap makes your paragraph catchy and stylish. First letter drop cap can be achieved in many ways using CSS. Two ways are going to be discussed on this article.</p>
<ol>
<li><a title="Using span tag to style the first letter" href="#technique_1">Using span tag to style the first letter</a></li>
<li><a title="Using pseudo element :first-letter" href="#technique_2">Using pseudo element :first-letter</a></li>
</ol>
<p><a id="technique_1" title="technique 1"></a></p>
<h3><strong>1. Using <em>span</em> tag to style the first letter</strong></h3>
<div class="wp_syntax">
<div class="code">
<pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.firstletter</span> <span style="color: #00AA00;">&#123;</span>     <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>     <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>     <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-0.63em</span> <span style="color: #933;">0.5em</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">-0.56em</span><span style="color: #00AA00;">;</span>     <span style="color: #000000; font-weight: bold;">height</span> <span style="color: #00AA00;">:</span> <span style="color: #933;">4.5em</span><span style="color: #00AA00;">;</span>     <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#aaa</span><span style="color: #00AA00;">;</span>   <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.firstletter</span> span <span style="color: #00AA00;">&#123;</span>     <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">200%</span><span style="color: #00AA00;">;</span>     <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">1.0em</span><span style="color: #00AA00;">;</span>   <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.firstletter</span> <span style="color: #00AA00;">+</span> span<span style="color: #00AA00;">&#123;</span>     <span style="color: #000000; font-weight: bold;">margin-left</span>  <span style="color: #00AA00;">:</span> <span style="color: #933;">-0.5em</span><span style="color: #00AA00;">;</span>   <span style="color: #00AA00;">&#125;</span></pre>
</div>
</div>
<blockquote><p>You might be interested to know about + sign in above CSS code. It is adjacent-sibling selector that was introduced in CSS 2. Adjacent-sibling targets an element directly after another element with the same parent.</p></blockquote>
<h3><strong>How to Use it?</strong></h3>
<div class="wp_syntax">
<div class="code">
<pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;firstletter&quot;</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span>&gt;</span>W<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>hen was the first time drop caps first letter introduced in newspaper, magazine? But its been a quite while the trend of drop cap used in web business. First letter drop cap can be achieved in many ways.</pre>
</div>
</div>
<p>You can view <a title="Live Demo CSS Drop cap" href="http://www.designgala.com/demos/drop_cap_first_letter_1.html">Live Demo</a> here.</p>
<p><a id="technique_2" title="technique 2"></a></p>
<h3><strong>2. Using pseudo element <em>:first-letter</em></strong></h3>
<p>Most of the sites use span technique for the drop cap first letter. With invent of CSS 2, the <em>:first-letter</em> pseudo-element was introduced for this purpose. It’s easy creating drop caps with <em>:first-letter</em>. Most of the latest browsers supports <em>:first-letter</em> pseudo element.</p>
<div class="wp_syntax">
<div class="code">
<pre class="css" style="font-family:monospace;">p<span style="color: #3333ff;">:first-letter </span><span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">400%</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0.06em</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">3.5em</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#ccc</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre>
</div>
</div>
<h3><strong>How to Use it?</strong></h3>
<div class="wp_syntax">
<div class="code">
<pre class="html4strict" style="font-family:monospace;">When was the first time drop caps first letter introduced in newspaper, magazine? But its been a quite while the trend of drop cap used in web business. First letter drop cap can be achieved in many ways.</pre>
</div>
</div>
<p>You can view <a title="Live Demo CSS Drop cap" href="http://www.designgala.com/demos/drop_cap_first_letter_2.html">Live Demo</a> here.</p>
<p>Inside the STYLE tag, we added style for paragraph, and suffix it with the code <em>:first-letter</em>, and whatever declarations that follow will be applied to the first letter of that paragraph.</p>
<blockquote><p>Some fix might be needed for cross browser compatibility.</p></blockquote>
<div id="fb-root"></div>
<p><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><!-- Do not remove --></p>
]]></content:encoded>
			<wfw:commentRss>http://designgala.com/magazine-style-drop-cap-first-letter-with-css/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
	</channel>
</rss>

