• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 5. Advanced Graphics > Layout Considerations When Using the <img /> Ele...

Layout Considerations When Using the <img /> Element

After you have an image stored and ready to be posted on the Web, you must use the XHTML <img /> element to place the image on a page. <img /> is a standalone element that takes the attributes shown in Table 5.1. According to the XHTML 1.0 standard, only the src and alt attributes are mandatory. You will quickly find, however, that you want to use many of the attributes.

Table 5.1. Attributes of the <img /> Element
AttributePurpose
altSupplies a text-based alternative for the image
alignControls alignment of text following the image
borderSpecifies the size of the border to place around the image
heightSpecifies the height of the image in pixels
hspaceControls the amount of whitespace to the left and right of the image
ismapDenotes an image to be used as part of a server-side image map
longdescProvides the URL of a link to a longer description of the image's content
srcSpecifies the URL of the file where the image is stored
styleProvides Cascading Style Sheet formatting information for the image
usemapSpecifies a client-side image map to use with the image
vspaceControls the amount of whitespace above and below the image
widthSpecifies the width of the image in pixels



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint