
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. 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. How do I make letters change colors and flash brightly in Html code? Posted by: heatherb at March 30, 2008 6:50 PMI 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 AMI have a lot to say, but ...
I do have a comment, now that you mention it!
|
![]()
Search
Find just the answers you seek from among our 1700+ free tech support articles by using our Lijit search engine.
Help!
Subscribe to
Ask Dave Taylor!
Free Updates!
Sign up and get free weekly updates and special offers on books, seminars, workshops and more.
Articles and Reviews
Auctions and Online Shopping Blogs and RSS Feeds Building Web site traffic Business and Management Cell Phones and Mobile Phones CGI Scripts and Web Site Programming Computer and Internet Basics d) None of the Above HTML and CSS Mac OS X Help MySpace, Facebook, Twitter and Social Network Help Pay Per Click (PPC) Search Engine Optimization Shell Script Programming Sony PSP, MP3 Players, Etc. The Writing Business Unix and Linux Help Video Game Tips and Help Windows Help
Recent Entries
Join the List!
Book Links
|