15 April 11, 2008

SPAN Your First Letter

The <span> tag is a tag that groupings of inline content within the content of a page. It can apply to a custom style to a piece of text (a single letter/word and short phrase) within a structural markup tag.

Here is a tiny sample will show how to decorate the first letter of text, make it bigger and stand out by simply using <span> tag. First lets take a look at the following:

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quisque sed felis. Aliquam sit amet felis. Mauris semper, velit semper laoreet dictum, quam diam dictum urna, nec placerat elit nisl in quam.Mauris semper, velit semper laoreet dictum.

The first letter has defined with large size and improved readlibility. Lets see how easy to make it work, add the following codes to your CSS style file:

.bigletter {color:#333;display:inline;float:left;font:3.6em Georgia,arial;text-transform:uppercase;margin:0.07em 0.14em 0 0;}

Now use <span> tag to define the text to make it work, the markup as following:

<span class="bigletter">L</span>orem ipsum dolor sit... ...

It’s done, pretty easy. I’ll keep sharing more tricks down the road.

Tagged as: ,
Posted in: Xhtml+CSS

Currently 15 comments, want to say something now?

Say something...