Search
Web Braintrove
Site Navigation
Home
Products
Tags
Levels
Dates
Authors
5 MOST RECENT
Locate the Design Checker Task Pane in InfoPath 2010
Locate Conditional Formatting and Custom Validation in InfoPath 2010
Conditionally Display Different Values In a Single Expression Box
Create a Button With a Blank Label
Create Shared Rules
5 MOST POPULAR
Access a Method in a Master Page with Code-Behind
Pass Query String Parameters to an ASP.NET Xml Control
Prevent Namespace Prefixes from Being Copied to the Output
Create Groups in a Drop-Down List Box
Configure IIS 7 for Custom Error Pages
5 MOST FORGOTTEN
Install Windows 7 Beta onto a Virtual Machine
Configure Lab Color Mode Defaults for Braintrove Articles
Create a Monochromatic Dream Text Effect Using Styles
Combine Multiple Sums Into a Single Function
Configure Windows to Show Clocks for Multiple Time Zones
Books
New Perspectives on HTML and XHTML, Comprehensive
Oracle HTML DB Handbook
HTML & XHTML: The Complete Reference
Teach Yourself Visually HTML
Embedding Perl in HTML With Mason
Magazines
Visual Basic & Net Journal
Soa Web Services Journal
Inside Web Design
.net
Web Site Management And Internet Advertising Trends
Microsoft MVP
This article has been viewed 650 times.

Create a Drop Cap Using CSS

Page 1 of 2
Written by Gregory Scot Collins
Tuesday, 29 August 2006, 5:31 PM
This article has been tested to work with the following products and versions. No guarantee of compatibility, with or without modification, is offered for products or versions other than those listed.
Drop caps, popular in books, magazines and elsewhere, are easy to create in HTML using style sheets. With the right design and content they make a pleasant impression to the users viewing your pages. Let's look at some simple HTML that creates a drop cap using CSS. We will examine how to accomplish this with default line-height as well as approximately double line-height.

Create a drop cap in a paragraph with default line-height

Our first example uses default line-height and the Copperplate font. If this font is not installed on your operating system you may substitute it with another font of your choice. When you use a different font, you might need to adjust the font-size and line-height properties in the dropCap class selector to achieve accurate positioning of the initial. Copy the contents of Listing 1 into a text editor, and then save the file as DropCap-Default.html.
The key to the drop cap is in the style sheet. By setting the float property to left, the span containing the drop cap initial stays to the left and pushes lines of the paragraph to the right. The font-size property specifies how big the initial appears and the line-height property is useful to control the number of paragraph lines that are pushed to the right.

Try it

Launch the HTML file you just created in your favorite browser to see the results. The Internet Explorer, FireFox and Opera browsers render the HTML in Listing 1 as shown in Screenshot 1:
Bookmark this Article
StumbleUpon  Stumble It!
Digg  Digg It!
del.icio.us  del.icio.us
List of Figures
Listing 1 - The DropCap-Default.html file.
Screenshot 1 - Drop cap rendered in paragraph with default line-height.
Listing 2 - The DropCap-Double.html file.
Screenshot 2 - Drop cap rendered in paragraph with double line-height.
Article Tags
Great Deals
TigerDirect Exclusive Deals, Limited Time Offers, Act Now And Save!
Find all current special offers on Adobe products.
Try SugarSync Free!
Join WebHost4Life.com
TigerDirect
Computers4SURE (4SURE.com - An Office Depot Co.)
Copyright © 2006-2010 Braintrove. All rights reserved. Braintrove, braintrove.com, and the Braintrove logo are trademarks of Gregory Scot Collins in the United States and/or other countries. The names of actual companies and products mentioned herein may be the trademarks of their respective owners. Any rights not expressly granted herein are reserved.