Welcome to Bucaro TecHelp!

Bucaro TecHelp
HTTPS Encryption not required because no account numbers or
personal information is ever requested or accepted by this site

About Bucaro TecHelp About BTH User Agreement User Agreement Privacy Policy Privacy Site Map Site Map Contact Bucaro TecHelp Contact RSS News Feeds News Feeds

Set the Text Case

The text-transform property allows you to force the case of all letters within an html element to upper-case, lower-case, or the first letter of each word to upper-case. Setting the case of all letters in a phrase can be used to eliminate case sensitivity in a search algorithm. Setting the first letter of each word in a phrase can be used to automatically create a title.

Here's the original paragraph:

And the rockets red glare, the bombs bursting in air, Gave proof through the night that our flag was still there.

Here's the same paragraph with the text-transform set to uppercase:

<p style="text-transform: uppercase;">And the rockets
red glare, the bombs bursting in air, Gave proof through
the night that our flag was still there.</p>

And the rockets red glare, the bombs bursting in air, Gave proof through the night that our flag was still there.

Here's the same paragraph with the text-transform set to lowercase:

And the rockets red glare, the bombs bursting in air, Gave proof through the night that our flag was still there.

Here's the same paragraph with the text-transform set to capitalize:

And the rockets red glare, the bombs bursting in air, Gave proof through the night that our flag was still there.

If what you're really looking for is to capitalize only the first letter of every paragraph, then you need to use the first-letter pseudo-element, as shown below:

<style type="text/css">
p:first-letter 
{
text-transform: uppercase;
}
</style>

If what you're really looking for is to capitalize only the first letter of a single or of specific paragraphs, then you need to define a class that uses the first-letter pseudo-element, as shown below:

<style type="text/css">
.myPara:first-letter
{
text-transform: uppercase;
}
</style> 

<p class="myPara">and the rockets red glare, the bombs
bursting in air, gave proof through the night that our
flag was still there.</p>

and the rockets red glare, the bombs bursting in air, gave proof through the night that our flag was still there.

More CSS Quick Reference:
• Set the Type of Bullet Used in List
• Grouped Selectors
• Set the Font Style
• Set Text Justification
• Class Selector
• Set the Word Spacing
• Use an Embedded Style Sheet
• Set the Font Slant
• Set an Element's Padding
• Context selectors

RSS Feed RSS Feed


Follow Stephen Bucaro Follow @Stephen Bucaro



Fire HD
[Site User Agreement] [Privacy Policy] [Site map] [Search This Site] [Contact Form]
Copyright©2001-2018 Bucaro TecHelp 13771 N Fountain Hills Blvd Suite 114-248 Fountain Hills, AZ 85268