Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > HTML > HTML Code Clinic
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 12th, 2003, 04:54 AM
Authorized User
 
Join Date: Oct 2003
Location: hyderabad, andhra, India.
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
Reply With Quote
  #2 (permalink)  
Old November 12th, 2003, 05:27 AM
Imar's Avatar
Wrox Author
Points: 72,022, Level: 100
Points: 72,022, Level: 100 Points: 72,022, Level: 100 Points: 72,022, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,076
Thanks: 80
Thanked 1,587 Times in 1,563 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.
Reply With Quote
  #3 (permalink)  
Old November 12th, 2003, 06:44 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 03:17 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.