Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > HTML > HTML Code Clinic
|
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 12th, 2003, 04:54 AM
Authorized User
 
Join Date: Oct 2003
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to phpsharma Send a message via Yahoo to phpsharma
Default font color, what different possibilites are

When I want to show some part of a text displayed on an HTML page in red font color, what different possibilites are there to do this? What are the advantages/disadvantages of these methods?

please help me

bye
sharma

God Knows better than US
__________________
God Knows better than US
 
Old November 12th, 2003, 05:27 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You have a couple of possibilities. First of all, you can use images, or Flash Animations or some other external product. This may help to ensure you have the exact font you need.

If you want just plain text, you have two options: the HTML tag, and CSS (Cascading Style Sheets). The tag is deprecated and is considered bad practice if you use it. Use it like this (or actually, since it's bad practice, don't use it like this ;) ):

[red]I am in a red font

The alternative is CSS. You can use style information on all kinds of HTML elements, like a <a> tag, a <td> tag, and so on. If you have just plain text, wrap the text inside a <span> tag, and apply the style info like this:

<span style="color: #FF0000;">I am also in a red font</span>

This use of CSS is the way to go. Almost all browser support it, and since it's part of the CSS standard, it will continue to work in the future.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old November 12th, 2003, 06:44 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

You can also use named colours as opposed to hexadecimal, the names cover a wide range and the standard ones are available on the web. These are like "red", "blue", "goldenrod" etc.



--

Joe





Similar Threads
Thread Thread Starter Forum Replies Last Post
not enable textbox or combobox font color SabinoFonseca VB.NET 2002/2003 Basics 1 March 15th, 2007 01:52 PM
Cell/Font Color in DataGrid. su C# 1 December 3rd, 2006 04:58 AM
how to get font ,color,font size of text in win32 satishsatao Visual C++ 0 April 5th, 2006 05:05 AM
change font color of label red pritz BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0 0 November 14th, 2005 03:48 AM
Font Color OzzyUltra Linux 1 October 22nd, 2004 10:01 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.