Computing Magazine

CSS Text Properties

Posted on the 24 January 2014 by Savio Menezes
Hello everyone. Today you will learn css text properties. They are: letter-spacing is used to set space between two text characters. Example
h1{letter-spacing : 5px;} text-align  is used for horizontal alignment of a text. Its values are left, center, right and justify. Example  p{text-align : center;} text-decoration is used to decorate a text. Its values are underline, overline, line-through, none and blink. None value can be used to remove the line below a hyperlink. Example a{text-decoration : none}; text-indent is used to set indentation of first line of a block. You can specify indentation in percent or in numbers (in pixels, centimetres) Example p{text-indent : 20px;} text-shadow is used to set shadow around the text. It can be written as text-shadow : horizontal distance from text   vertical distance from text   blur(amount of shadow text stretched)   color or text-shadow : color   horizontal distance from text   vertical distance from text   blur   Example h3{text-shadow : 2px 3px 2px #000000} white-space css property is used to handle white space inside an element. Its values are normal, pre & no wrap. Example p{white-space : pre;} word-spacing is used to set space between two words. Example h4{word-spacing:10px;}
text-transform property is used to convert text to uppercase or lowercase. It also used to capitalize text. Its values are uppercase, lowercase and capitalize. Example div{ text-transform : capitalize;} Example
Here is an example web page that I have created so that you can understand text properties better. View that html text of document (If your web browser is Firefox or chrome then right click on the page and select view page source. If you are using  Internet Explorer right click on page and click view source ). To go to that web page click here.

Back to Featured Articles on Logo Paperblog

Magazines