SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Zealot Darren Lewis's Avatar
    Join Date
    Jul 2002
    Location
    UK
    Posts
    172
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Deprecated attributes of IMG tag

    Looking at this page the align attribute of the IMG tag is deprecated. How should I now get my text to flow around images, and align images?

    Thanks.
    Censura - Add reviews and ratings to your site

  2. #2
    SitePoint Zealot
    Join Date
    Aug 2002
    Location
    Bristol, UK
    Posts
    122
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It will probably still work, most browsers will support deprecated stuff.
    A deprecated element or attribute is one that has been outdated by newer constructs.
    There is probably a replacement coming, or around, have a look.
    Andy: Always Morphin Dwarfs

  3. #3
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Darrin...

    You would create a style that would do this for you:

    <style type="text/css">
    <!--

    img.right {float:right;}
    img.left {float:left;}

    -->
    </style>

    Apply it like so:

    <img src="someimage.jpg" class="right">

    That should cause the image to be aligned to the right, allowing text to flow around it.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  4. #4
    SitePoint Zealot Darren Lewis's Avatar
    Join Date
    Jul 2002
    Location
    UK
    Posts
    172
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, I see now how it can be done with CSS.

    But why did they deprecate it anyway, it seems like a good solution for individual images?
    Censura - Add reviews and ratings to your site

  5. #5
    (****** or Deleted)
    Join Date
    May 2002
    Location
    Melbourne, Australia
    Posts
    299
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The current plans are to seperate formatting from structure, and alignment is a formatting issue, so it should be handled by a stylesheet
    Jordan Windebank

  6. #6
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    You can also wrap your image in a div tag, like so:
    Code:
    ...html code previous...
    <div align="right">
    <img src="images/mystuff.jpg" height="58" width="370" />
    </div>
    ...following html code...
    That's always worked for me.

    --Vinnie

  7. #7
    SitePoint Enthusiast plattopus's Avatar
    Join Date
    Aug 2002
    Location
    Melbourne, Australia
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The align attribute has also been depreciated for DIV tags... so that wouldn't be valid either.

    The point is to completely separate content and design... and align is a design issue, therefore it belongs in a style sheet.

  8. #8
    One website at a time mmj's Avatar
    Join Date
    Feb 2001
    Location
    Melbourne Australia
    Posts
    6,282
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    If your are using a "Transitional" DTD, you can use deprecated attributes without warning or error.

    Then, when you've removed all your deprecated things, you can switch to "Strict".

    There's no shame in transitional though. It's just that in future versions of html, these deprecated tags will probably disappear, so you have to be aware of that when creating new code. Avoid them when coding anything new.
    Last edited by mmj; Oct 1, 2002 at 07:04.
    [mmj] My magic jigsaw
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The Bit Depth Blog Twitter Contact me
    Neon Javascript Framework Jokes Android stuff


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •