In css ,text contains below properties:
1. color: It is used to set the color of the text.
2.direction :It is used to set the text direction.
3.letter-spacing : It is used to add or subtract space between the letters that make up a word.
4.word-spacing : It is used to add or subtract space between the words of a sentence.
5.Line-spacing : It is used to add or subtracat space between the line in a paragraph.
6.text-indent : It is used to indent the text of a paragraph or the first line of a text.
7.text-align : It is used to align the text of a document with center,left,right and justified properties.
8.text-decoration : It is used to set underline, overline, and strikethrough text or remove decoration of the text.
9. text-transform : It is used to capitalize text or convert text to uppercase or lowercase letters or to capitalize first letter.
10. white-space :It is used to control the flow and formatting of text.
11. text-shadow : It is used to set the text shadow around a text.
12.text-direction: it is used to change the direction of text.
13.vertical-align: it is used to align the image vertically.
Example:16
<html><head>
<style>
body {color:red; text-align:justified;}
h1 {color:#00ff00; text-align:center;text-decoration:overline;}
h2 {color:yellow;text-decoration:underline;}
p.color {color:rgb(0,0,255); text-align: right;text-decoration:
line-through;}
a {text-decoration:none;}
</style></head>
<body>
<h1>welcome to css-text formatting</h1>
<p> this text is red.it is right aligned with strike through.</p>
<p class="color">This is a paragraph with class="color". This text is blue.</p>
<h2>visit again</h2>
<p>visit: <a href="http://www.pssmovement.org">pssmovement</a></p>
</body></html>
----------------------------------------------------------------------------------
Example:17
<html><head>
<style>
p.uppercase {text-transform:uppercase;text-indent:10px;letter-spacing:2px;}
p.lowercase {text-transform:lowercase;text-indent:50px;letter-spacing:-2px;}
p.capitalize {text-transform:capitalize;text-indent:100px;}
p.small {line-height:70%;}
p.big {line-height:200%; word-spacing:30px;}
div.rtl1
{
direction:rtl;
unicode-bidi:bidi-override;
}
</style></head>
<body>
<p class="uppercase">Medha computers.</p>
<p class="lowercase">MEDHA COMPUTERS.</p>
<p class="capitalize">medha computers.</p>
<p>
This is a paragraph with a standard line-height.<br>
This is a paragraph with a standard line-height.<br>
The default line height in most browsers is about 110% to 120%.<br>
</p>
<p class="small">
This is a paragraph with a smaller line-height.<br>
This is a paragraph with a smaller line-height.<br>
This is a paragraph with a smaller line-height.<br>
This is a paragraph with a smaller line-height.<br>
</p>
<p class="big">
This is a paragraph with a bigger line-height.<br>
This is a paragraph with a bigger line-height.<br>
This is a paragraph with a bigger line-height.<br>
This is a paragraph with a bigger line-height.<br>
</p>
<div>raja mom rani</div>
<div class="rtl1"> pack my box </div>
</body></html>
Example:for vertical alignment of an image.
Example18
<html><head>
<style>
img.top {vertical-align:text-top;}
img.bottom {vertical-align:text-bottom;}
</style>
</head>
<body>
<p>An <img src="d:\css\bomma.gif" alt="hi" width="270" height="50" /> image with a default alignment.</p>
<p>An <img class="top" src="d:\css\bomma.gif" alt="hello!" width="270" height="50" /> image with a text-top alignment.</p>
<p>An <img class="bottom" src="d:\css\bomma.gif" alt="namaste" width="270" height="50" /> image with a text-bottom alignment.</p>
</body></html>
No comments:
Post a Comment