CSS Text Property With Example
I will help you to learn CSS Text Property in a simple way with example. This property allows you to define the text design.
Example
<html>
<title>CSS Text Property With Example</title>
<head>
<style type="text/css">
.css_text_propery {
width: 700px;
margin: 0 auto;
}
.css_text_propery span {
padding: 5px;
}
.text_align{
text-align: justify;/* left , right, center */
}
.text_center {
text-align: center;
}
.text_transform{
text-transform: uppercase;/* lowercase, capitalize */
}
.text_decoration{
text-decoration: underline; /* overline,line-through,blink */
}
.text_indent{
text-indent: 50px; /* indentation of the first line */
}
.line_height{
line-height: 1.8; /* specify the space between lines */
}
.direction{
direction: rtl; /* change the text direction of an element */
}
.text_shadow{
text-shadow: 4px 3px black; /* adds shadow to text. */
}
.word_spacing{
word-spacing: 15px; /* word spacing */
}
.letter_spacing{
letter-spacing: 15px; /* ex: l e t t e r */
}
</style>
</head>
<body class="css_text_propery">
<h3 class="text_center">CSS Text Property With Example</h3>
<br>
<p class="text_align">justify : Lorem ipsum dolor, sit amet consectetur adipisicing elit. Magni, et dolorum. Deserunt sint atque voluptas vel blanditiis ex sed nulla quia explicabo architecto officia minus eum non, natus saepe cumque.</p>
<p class="text_transform">Transform property</p>
<p class="text_decoration">Decoration property</p>
<p class="text_indent">Indent property</p>
<p class="line_height">Height property</p>
<p class="direction">Direction property</p>
<p class="text_shadow">Shadow property</p>
<p class="word_spacing">Word spacing property</p>
<p class="letter_spacing">Letter spacing property</p>
</body>
</html>
Output
CSS Text Property With Example
justify : Lorem ipsum dolor, sit amet consectetur adipisicing elit. Magni, et dolorum. Deserunt sint atque voluptas vel blanditiis ex sed nulla quia explicabo architecto officia minus eum non, natus saepe cumque.
Transform property
Decoration property
Indent property
Height property
Direction property
Shadow property
Word spacing property
Letter spacing property