YouTip LogoYouTip

Att Object Align

# HTML align Attribute The `align` attribute of the `` element specifies the alignment of an embedded object relative to its surrounding text and elements. --- ## Deprecation Notice > ⚠️ **Important:** The `align` attribute for the `` tag is **deprecated** in HTML 4.01 and is **not supported** in HTML5. Modern web development standards require using **CSS** (Cascading Style Sheets) to handle layout and alignment. For modern alternatives, see the (#css-alternatives) section below. --- ## Browser Support The `align` attribute is legacy but remains widely supported by all major browsers for backward compatibility: * Google Chrome * Mozilla Firefox * Internet Explorer / Microsoft Edge * Safari * Opera --- ## Definition and Usage The `` element is an inline element by default (meaning it does not start on a new line, and surrounding text can wrap around it). The `align` attribute was historically used to control how the object aligns horizontally or vertically with respect to the surrounding inline content. --- ## Syntax ```html ``` ### Attribute Values | Value | Description | | :--- | :--- | | `left` | Aligns the object to the left. Surrounding text wraps to the right of the object. | | `right` | Aligns the object to the right. Surrounding text wraps to the left of the object. | | `middle` | Aligns the vertical center of the object with the baseline of the surrounding text. | | `top` | Aligns the top of the object with the top of the tallest element on the current line. | | `bottom` | Aligns the bottom of the object with the baseline of the surrounding text (default behavior). | --- ## Code Examples ### Legacy HTML Implementation (Deprecated) The following example demonstrates how the `align` attribute was used to align an object to the right: ```html

Your browser does not support this media format.

``` --- ## CSS Alternatives To ensure your code is compliant with modern HTML5 standards, you should use CSS properties like `float`, `vertical-align`, or Flexbox/Grid layouts instead of the `align` attribute. ### 1. Horizontal Alignment (Replacing `left` / `right`) To align an object to the right and let text wrap around it, use the CSS `float` property: ```html

Your browser does not support this media format.

``` ### 2. Vertical Alignment (Replacing `top` / `middle` / `bottom`) To align an object vertically relative to the surrounding text line, use the CSS `vertical-align` property: ```html ``` ### 3. Centering an Object To center an `` horizontally on a page, convert it to a block-level element and set its margins to `auto`: ```html ```
← Att Object BorderAtt Meter Value β†’

YouTip © 2024-2026 | Home | Learn Technology, Build Dreams!

All content is for educational and learning purposes only.