About US
            Contact Us
            Book     Book Preface

html Text Color Codes

Chapter - 3 : Text, Font, Size, Color (html Text Color Codes) : (Page 2/2)    

(Cotinued from previous page)

Command: <font size='3' color='blue'>TEXT</font>
<font size='3' color='html Text Color Codes0000ff'>TEXT</font>

For both the above mentioned command line, the out put will be same

Output: TEXT

Command: <font size='3' color='red'>TEXT</font>
<font size='3' color='html Text Color Codesff0000'>TEXT</font>
Output: TEXT

You can also define the default color of the complete page body and color of text with the following command. Whenever, there is no separate 'font' tag for a text section, the web browser will use this color as default.

<body bgcolor='yellow' text='blue'>
This will make the whole body color yellow and all texts as blue.
Command: <body bgcolor='yellow' text='blue'> Your text 1 your text 2

Output: Color Codes

However any <font> command in between the 'body' tag will supersede this.

Command: <body bgcolor='yellow' text='blue'> Your text 1 <font color='red'>your text 2</font>

Output:web Color Codes

iv) Text Direction: In general the web browser will display the text from Left to Right direction. But if you want to write the text in reverse direction i.e. Right to Left direction then use '<bdo dir'rtl'>' tag. To resume to the Left to Right direction, use closing tag '</bdo>

Command: <bdo dir='rtl'>Text to be written from right to left</bdo>
Output: tfel ot thgir morf nettirw eb ot txeT

© funandhobby.com (html Text Color Codes)