Home arrow HTML arrow Page 3 - HTML Working with Images
HTML

HTML Working with Images


In our last tutorial we discussed working with forms in HTML. In this episode we will cover how to work with images, such as floating images, image maps, and background images.

Author Info:
By: James Payne
Rating: 5 stars5 stars5 stars5 stars5 stars / 1
February 22, 2008
TABLE OF CONTENTS:
  1. · HTML Working with Images
  2. · Alternatives to Images
  3. · Setting an Image as the Background
  4. · Setting Your Image as a Hyperlink

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
HTML Working with Images - Setting an Image as the Background
(Page 3 of 4 )

Aside from setting your background to a specific color, you can also set it as a particular image. You will need to keep in mind, however, how the background image will fit in with the rest of your site, in regards to color and theme. Also, if the image is smaller than your web page, it will be tiled and repeated across the page, which may or may not be your intention. Although this should be blatantly obvious, if you background is dark blue and your text is blue, users may have trouble reading the text.

Since this article is really more of a how-to rather than a what-to, we'll stick with how to insert the image and let you worry about the aesthetics:


<html>

<body background="somebackground.jpg">

</body>

</html>

Floating Images

You can set how an image floats next to a paragraph using the align attribute once more. Only this time we do it in conjunction with our paragraph:


<html>

<body>

<p>

<img src ="sample.gif"

align ="left" width="50" height="50">

It was a dark and stormy night. A fat man stood in the rain eating a burrito and adding to his already incredible mass...

</p>

<p>

<img src ="sample.gif"

align ="right" width="50" height="50">

A skinny man sat in the rain, watching a fat man eating a burrito and adding to his already incredible mass. He thought to himself: "What a fat ass."

</p>

</body>

</html>

By assigning the align attribute a left or right value, it dictates which side the image will appear on (left or right...duh).


blog comments powered by Disqus
HTML ARTICLES

- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5
- BBC Adopts HTML 5, Mozilla Addresses Issues
- Advanced Sticky Footers in HTML and CSS
- HTML and CSS Sticky Footers
- Strategy Analytics Predicts HTML5 Phones to ...
- HTML5 Guidelines for Web Developers
- Learning HTML5 Game Programming
- More Engaging CSS3 and HTML Background Effec...
- Engaging HTML and CSS3 Background Effects
- More Web Columns with CSS3 and HTML
- Columns with CSS3 and HTML
- Creating Inline-Block HTML Elements with CSS
- Drag and Drop in HTML5: Parsing Local Files

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 1 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials