Solutions for Industrial Computing Blog

Solutions for Industrial Computing

The Solutions for Industrial Computing Blog is the place for conversation and discussion about industrial computers, systems and controllers; communications and connectivity; software and control; and power strategies. Here, you'll find everything from application ideas, to news and industry trends, to hot topics and cutting edge innovations.

Previous in Blog: How Does Windows 7 Compare to Vista? (Part 2)   Next in Blog: Why Upgrade to Windows 7?
Close
Close
Close
3 comments
Rate Comments: Nested

Basic HTML: Images, Links, and Colors.

Posted September 03, 2009 11:17 AM by baumah

Adding text to your first web page is exciting. But to make a web site look the way that you want, you need to know how to change the colors of the text or background and how to add pictures and links. Fortunately, this is almost as easy as adding the tags you've already learned.

Changing Colors

Colors in HTML are defined by a 6-digit hexadecimal number that represents the amount of red, green, and blue. Some colors also have names. For a list of named colors supported by major browsers, click here.

The background color can be changed by adding the desired color to the body tag.

<body style="background-color:aqua">

The text color can be changed by adding the style tag to the desired paragraph.

<p style="color:green;">This text is green.

To change the color of text that is shorter than a paragraph, just put the style tag inside a span tag.

<span style="color:red">This text is red.</span>

Another way of adding colors is with a style sheet. Style sheets keep track of the colors, fonts, and sizes for the page. They are very useful for using multiple pages with the same format. Styles sheets are beyond the scope of this blog-entry, but may be a topic for a future one if there is sufficient interest.

Adding Images and Links

Adding a link to a website can be done with this tag.

<a href="url to link">link text</a>

Adding images is pretty much the same.

<img src="picture.jpg" height=150 width=150>

Here, the size of the picture is defined here by the width and the height in pixels. Defining just the height or width keeps the same ratio as the original picture. Note that the picture.jpg needs to be the location where the image is stored. Upper and lowercase letters matter.

Troubleshooting

As explained in the previous blog entry in this series, most HTML problems are due to a spelling error or a misplaced or forgotten bracket. The same is true when you're trying to change the colors of the text or background, or trying to add pictures and links. If you're having a hard time, look for common problems first.

Editor's Note: Click here for Part 1 of this series.

Reply

Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.
Guru
United States - Member - New Member Engineering Fields - Electrical Engineering - New Member

Join Date: Jul 2008
Posts: 1149
Good Answers: 36
#1

Re: Basic HTML: Images, Links, and Colors.

09/03/2009 1:32 PM

An easy way to solve common problems: copy and paste and then change either the color or the text. I find that when I do this, my errors are nearly eliminated. Some of the prompts or commands in HTML seem complex. But that may be because I am used to C programming language.

Excellent instructions...

Reply
Associate

Join Date: Jan 2009
Posts: 37
Good Answers: 1
#2

Re: Basic HTML: Images, Links, and Colors.

09/05/2009 6:31 AM

I found Macromedia very useful in eliminating spelling error in tag and forgotten closing bracket. It will also ease the burden of memorizing all HTML tags.

A note to all members of CR4, HTML tags wont work here for CR4 uses BBCode.

Reply
Guru

Join Date: Feb 2005
Location: New York
Posts: 575
Good Answers: 16
#3
In reply to #2

Re: Basic HTML: Images, Links, and Colors.

10/28/2009 10:25 AM

Macromedia was bought by Adobe in 2005 and no longer makes any products under that name.

__________________
Kaplin
Reply
Reply to Blog Entry 3 comments
Copy to Clipboard

Users who posted comments:

Jaxy (1); Kaplin (1); RTFVerterra (1)

Previous in Blog: How Does Windows 7 Compare to Vista? (Part 2)   Next in Blog: Why Upgrade to Windows 7?

Advertisement