Dave Taylor answers free tech support questions about a wide variety of business and technical topics, including blogging, iphone help, ipod help, AdSense, MySpace, Sony PSP help, Mp3 players, Windows XP, Windows Vista, Linux, SEO, Mac OS X, Facebook, Twitter and LinkedIn.

How do I change text formatting in HTML?

This is a really basic question, but I'm still just trying to figure all this Internet stuff out. I don't know any HTML. I would like to know how to a) place HTML in my coding to turn a paragraph color to red and b) increase the font size.


Dave's Answer:

Nothing wrong with being at the beginning of the journey of learning about HTML and the Web. You're definitely not alone and, frankly, there are precious few people who aren't somewhere on that road too, even if sometimes it seems that they're unimaginably far ahead. :-)

It turns out that there are two different ways to accomplish what you seek within the HTML world, one that's an old-fashioned style that is pretty much obsolete, but still works, and the other, Cascading Style Sheets, that's much more powerful, albeit a bit more complex.

Let's start with the simple solution. To make text red, simply preface it with <font color="red"> and end with </font>. You can increase the font size, on a scale of 1 to 7, where 7 is pretty large and 1 is pretty tiny, also using the font tag, just with what we HTML folk call a different attribute. This time, instead of using color, use size="x", where you replace x with the number of your choice.

Here's how it might all fit together:

This sentence has a word buried within it that
will be shown as
<font size="6" color="red">big and red</font>
when displayed.

Not too hard, I hope.

The smarter, cooler, and frankly more powerful solution, however, is to use Cascading Style Sheets. With style sheets, you simply specify style= and then use "name: value;" pairs to get the exact result you seek. Colors are fairly similar, but font size can be specific in a zillion different ways. To keep things simple, let's use relative sizing and specify 150%:

This sentence has a word buried within it that
will be shown as
<span style="color:red;font-size:150%">big and red</span>
when displayed.

The reason that CSS is a better solution is because it allows you a tremendous level of control over the presentation of text, from colors to typefaces, size to letter and word spacing, and even line spacing in paragraphs. Far more capability than even the best standard HTML code.

If you'd really like to learn more about HTML and CSS, then may I suggest that my best-selling book Creating Cool Web Sites with HTML, XHTML, and CSS could be a splendid place to start.



Help others find this article at Del.icio.us, Digg, Netscape, Reddit, and Stumble Upon    
Categorized: HTML and CSS   (Article 4225)
Tagged:
Previous: Change password on child's AOL (America Online) screen name?
Next: What is Tagyu?

Subscribe!

Never miss another useful Q&A article again! Subscribe to AskDaveTaylor with Google Reader.

Comments

How do I make letters change colors and flash brightly in Html code?

Posted by: heatherb at March 30, 2008 6:50 PM

I am running under an old version of Office (Office 97) and can't reinstall it to enable the .html file type. Are there any downloads to convert a text or .doc document to an html file? - I am retired and trying to learn HTML from scratch.

Thanks.

Posted by: Mike Lambert at August 28, 2008 4:18 AM


I have a lot to say, but ...
Starbucks coffee cup I have a lot to say, and questions of my own for that matter, but most of all I'd like to say thank you for all your efforts on this Web site by buying you a chai!

I do have a comment, now that you mention it!









Remember personal info?


Please note that I will never send you any unsolicited commercial email. Ever.

While I'm at it, please note that by submitting a question or comment you're agreeing to my terms of service, which are: you relinquish any subsequent rights of ownership to your material by submitting it on this site.









Uniblue: Free Virus Scan

Search
Find just the answers you seek from among our 1700+ free tech support articles by using our Lijit search engine.


Member of the B5Media Network

Help!





Subscribe to
Ask Dave Taylor!

Add to Google Reader
Add to My Yahoo!
Subscribe in NewsGator Online

RDF   XML

Free Updates!
Sign up and get free weekly updates and special offers on books, seminars, workshops and more.


Recent Entries
Join the List!
Join my author info mailing list, where you'll learn about my upcoming books, speaking gigs, and more!


Book Links
© 2002 - 2008 by Dave Taylor. All Rights Reserved.

Note: This web site is for the purpose of disseminating information for educational purposes, free of charge, for the benefit of all visitors. We take great care to provide quality information. However, we do not guarantee, and accept no legal liability whatsoever arising from or connected to, the accuracy, reliability, currency or completeness of any material contained on this web site or on any linked site.

[whiteboard marker tray]