HTML
  Home arrow HTML arrow Page 2 - HTML Working with Images
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
HTML

HTML Working with Images
By: James Payne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2008-02-22

    Table of Contents:
  • HTML Working with Images
  • Alternatives to Images
  • Setting an Image as the Background
  • Setting Your Image as a Hyperlink

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    HTML Working with Images - Alternatives to Images


    (Page 2 of 4 )

    Sometimes, for whatever reason, an image may not appear on a page. Maybe it wasn't linked properly or maybe you forgot to upload the image to the server. Or maybe the the link you put in the src attribute is no longer there; who knows what crazy thing you did. Normally the visitor will just see a large red x in lieu of the image you intended. You can, however, choose to display some text if your image is not there (or even if the image is there; if the image does work, whenever the user hovers over the image, a tool-tip with text will appear), like so:


    <html>

    <body>

    <p>

    Here is a sample image:

    <img src="sample.gif"

    width="144" height="50" alt=”Here is a sample image”>

    </p>

    <p>

    Here is the same image, only bigger:

    <img src="sample.gif"

    width="288" height="100" alt=”Here is an example of the same image, only larger”>

    </p>

    <p>

    Here is the same image, only smaller:

    <img src="sample.gif"

    width="77" height="50" alt=”Here is yet another example of the same image only smaller”>

    </p>

    </body>

    </html>

    Aligning Images

    You can determine where your image appears within text by using the align attribute:


    <html>

    <body>

    <p>

    This image

    <img src="sample.gif"

    align="bottom" width="48" height="48">

    is bottom aligned

    </p>

    <p>

    This image

    <img src ="sample.gif"

    align="middle" width="48" height="48">

    is aligned in the middle

    </p>

    <p>

    This image

    <img src ="sample.gif"

    align="top" width="48" height="48">

    is aligned to the top

    </p>

    <p>

    <img src ="sample.gif"

    width="48" height="48">

    Here an image appears before the text

    </p>

    <p>

    Here the image appears after the text

    <img src ="sample.gif"

    width="48" height="48">

    </p>

    <p>

    Image left aligned:

    </p>

    <p>

    <img src ="sample.gif"

    align="left" width="48" height="48">

    </p>

    <p>

    Image right-aligned:

    </p>

    <p>

    <img src ="sample.gif"

    align="right" width="48" height="48">

    </p>

    </body>

    </html>

    More HTML Articles
    More By James Payne


       · Thanks for dropping by. In thia article we discuss working with images in HTML. Some...
     

    HTML ARTICLES

    - Hello HTML 5, Goodbye Gears
    - Comparing Browser Response to Active Client ...
    - Testing Browser Response to Active Client Pa...
    - Active Client Pages: Completing the Code for...
    - ACP and Browsers: Setting up an Example
    - How Browsers Respond to Active Client Pages
    - Completing a Tree with Active Client Pages
    - HTML Form Verification and ACP
    - Building an ACP Tree
    - Completing an ACP 3D HTML Table Image Gallery
    - Building an ACP 3D HTML Table Image Gallery
    - A Multiple Page Image Gallery with Active Cl...
    - Building an Image Gallery with Active Client...
    - Concluding a Menu for All Browsers
    - A Vertical Menu for All Browsers







    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 12 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek