Click here to Skip to main content
15,885,782 members
Articles / Web Development / CSS
Tip/Trick

Create Drop Caps using CSS

Rate me:
Please Sign up or sign in to vote.
4.81/5 (11 votes)
9 Oct 2014CPOL 12.2K   11   6
Simple way to create drop cap using CSS

Introduction

Drop caps is a very old technique of styling first letter of a paragraph or an article. The first letter of a paragraph that is enlarged to "drop" down two or more lines. Drop caps are often seen at the beginning of novels, where the top of the first letter of the first word lines up with the top of the first sentence and drops down to the four or fifth sentence.

Using the code

With CSS alone we can achieve this requirement. Let’s have a look on the following example.

CSS
<code>/* CSS Snippet */
<style>
    p:first-letter {
        font-size: 400%;
        float:left;
    }
</style></code>
 
HTML
<code><!-- HTML Snippet -->
<div style="width: 40%;">
    <p>
       MVC framework will really helps you to develop the project rapidly, if you know one framework well then you’ll never worry about the project deadline. You will write less code, which means less time spent typing. You will not have to chase down 3rd party libraries all the time for every new project because most of them will come with the default framework install.
    </p>
 </div></code>

Result

CSS Drop Caps

 

You can apply other CSS styling too like background-color, color, border etc to make it more beautiful.
 
Thnaks for reading !

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralMy vote of 5 Pin
jackmos10-Oct-14 8:23
professionaljackmos10-Oct-14 8:23 
GeneralRe: My vote of 5 Pin
Suvendu Shekhar Giri10-Oct-14 18:59
professionalSuvendu Shekhar Giri10-Oct-14 18:59 
QuestionNice one Pin
Prava-MFS10-Oct-14 0:02
professionalPrava-MFS10-Oct-14 0:02 
GeneralMy vote of 1 Pin
TrushnaK9-Oct-14 21:31
TrushnaK9-Oct-14 21:31 
GeneralRe: My vote of 1 Pin
Suvendu Shekhar Giri9-Oct-14 23:31
professionalSuvendu Shekhar Giri9-Oct-14 23:31 
GeneralRe: My vote of 1 Pin
Suvendu Shekhar Giri9-Oct-14 23:32
professionalSuvendu Shekhar Giri9-Oct-14 23:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.