www.webdeveloper.com
Results 1 to 7 of 7

Thread: Using align attribute with img tag, does it obsoleted

  1. #1
    Join Date
    Jan 2003
    Location
    Egypt
    Posts
    185

    Using align attribute with img tag, does it obsoleted

    Hi,

    Does the using of align attribute in img tag becomes obsoleted and should we migrate to another solution?

    Please take care about the modern solution to give me the same effect of the following -notice align="absmiddle":
    PHP Code:
    <h3 style="color:red; font-weight:bold"><img src="images/warning.gif" alt="Warining!" align="absmiddle" style="display:inline" />Login is required!</h3
    If there is any online article about this topic, I will be appreciated too.

  2. #2
    Join Date
    Mar 2010
    Posts
    2,803
    According to w3schools align in <img> is deprecated.

    One option to get the same effect is to use css positioning.

  3. #3
    Join Date
    Jan 2003
    Location
    Egypt
    Posts
    185
    Well,
    Is there any tutorial or article, which is meant by discussing positioning images using css?

  4. #4
    Join Date
    Mar 2010
    Posts
    2,803
    yes there are plenty.

    If you google something like 'css positioning' you will get a truck load of references.

    css positioning can be used to position jst about any element. That element can contain an image, as in your case, or just about any other content.

    As a starting point, maybe have a look at the w3schools tute on css positioning.

    A few months ago I posted code demonstrating how positioning works where you can enter X and Y coordinates for an element in text boxes and then watch the <div>s move accordingly.

  5. #5
    Join Date
    Jan 2003
    Location
    Egypt
    Posts
    185
    Hi,
    The truck of references may get one to be lost too. The tutorial I search for, to safe time, should talks, directly, about replacing align img tag's attributes with css.

    The align attribute for img tag has the following values:
    • left
    • right
    • middle
    • bottom
    • top
    • absleft
    • absright

  6. #6
    Join Date
    Mar 2010
    Posts
    2,803
    Quote Originally Posted by said_fox View Post
    The tutorial I search for, to safe time, should talks, directly, about replacing align img tag's attributes with css.
    There probably are tutes specifically on positioning images but since you want to save time, I would recommend googling for the many more tutes on positioning <div>s and then simply add your <img> to the <div>. With css positioning you can then remove all your <img> align attributes.

    But how you go about googling is up to you.

  7. #7
    Join Date
    Jan 2003
    Location
    Egypt
    Posts
    185
    Good Idea. However, If there is one of our friends in this community know a specific tutorial about this topic, I will be appreciated too.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles