image alignment with text html

By | 24.08.2018
w3schools.com

THE WORLD’S LARGEST WEB DEVELOPER SITE

HTML
CSS
JAVASCRIPT
SQL
PHP
BOOTSTRAP
HOW TO
JQUERY
W3.CSS
PYTHON
XML
MORE


FORUM
EXAMPLES
REFERENCES

×

HTML Reference

HTML by Alphabet
HTML by Category
HTML Attributes
HTML Global Attributes
HTML Events
HTML Colors
HTML Canvas
HTML Audio/Video
HTML Character Sets
HTML Doctypes
HTML URL Encode
HTML Language Codes
HTML Country Codes
HTTP Messages
HTTP Methods
PX to EM Converter
Keyboard Shortcuts

HTML Tags

<!–>
<!DOCTYPE>
<a>
<abbr>
<acronym>
<address>
<applet>
<area>
<article>
<aside>
<audio>
<b>
<base>
<basefont>
<bdi>
<bdo>
<big>
<blockquote>
<body>
<br>
<button>
<canvas>
<caption>
<center>
<cite>
<code>
<col>
<colgroup>
<data>
<datalist>
<dd>
<del>
<details>
<dfn>
<dialog>
<dir>
<div>
<dl>
<dt>
<em>
<embed>
<fieldset>
<figcaption>
<figure>
<font>
<footer>
<form>
<frame>
<frameset>
<h1> – <h6>
<head>
<header>
<hr>
<html>
<i>
<iframe>
<img>
<input>
<ins>
<kbd>
<label>
<legend>
<li>
<link>
<main>
<map>
<mark>
<meta>
<meter>
<nav>
<noframes>
<noscript>
<object>
<ol>
<optgroup>
<option>
<output>
<p>
<param>
<picture>
<pre>
<progress>
<q>
<rp>
<rt>
<ruby>
<s>
<samp>
<script>
<section>
<select>
<small>
<source>
<span>
<strike>
<strong>
<style>
<sub>
<summary>
<sup>
<svg>
<table>
<tbody>
<td>
<template>
<textarea>
<tfoot>
<th>
<thead>
<time>
<title>
<tr>
<track>
<tt>
<u>
<ul>
<var>
<video>
<wbr>

HTML <img> align Attribute

❮ HTML <img> tag

Example

Align an image in the middle of a text:

<p>This is some text. <img src="smiley.gif" alt="Smiley face" align="middle"> This is some text.</p>

Try it Yourself »


Definition and Usage

The align attribute specifies the alignment of an image according to the surrounding element.

The <img> element is an inline element (it does not insert a new line on a page), meaning that text and other elements can wrap around it. Therefore, it can be
useful to specify the alignment of the image according to surrounding elements.


Browser Support

Attribute
alignYesYesYesYesYes

The align attribute is deprecated, but still supported in all major browsers.


Compatibility Notes

The align attribute of <img> is not supported in HTML5. Use CSS instead.

For the image to align middle, top, or bottom use the CSS property
vertical-align .

For the image to align left or right use the CSS property
float .

CSS
Example: Align image


Syntax

<img align="left|right|middle|top|bottom">

Attribute Values

ValueDescription
leftAlign the image to the left
rightAlign the image to the right
middleAlign the image in the middle
topAlign the image at the top
bottomAlign the image at the bottom

❮ HTML <img> tag

COLOR PICKER

colorpicker

HOW TO

Tabs
Dropdowns
Accordions
Convert Weights
Animated Buttons
Side Navigation
Top Navigation
Modal Boxes
Progress Bars
Parallax
Login Form
HTML Includes
Google Maps
Range Sliders
Tooltips
Slideshow
Filter List
Sort List

SHARE

CERTIFICATES

HTML ,
CSS ,
JavaScript ,
PHP ,
jQuery ,
Bootstrap and
XML .

Read More »



REPORT ERROR
PRINT PAGE
FORUM
ABOUT

×

Your Suggestion:

×

Thank You For Helping Us!

Your message has been sent to W3Schools.

Top 10 Tutorials

HTML Tutorial
CSS Tutorial
JavaScript Tutorial
How To Tutorial
W3.CSS Tutorial
Bootstrap Tutorial
SQL Tutorial
PHP Tutorial
jQuery Tutorial
Python Tutorial

Top 10 References

HTML Reference
CSS Reference
JavaScript Reference
W3.CSS Reference
Bootstrap Reference
SQL Reference
PHP Reference
HTML Colors
jQuery Reference
Python Reference

Top 10 Examples

HTML Examples
CSS Examples
JavaScript Examples
How To Examples
W3.CSS Examples
Bootstrap Examples
PHP Examples
jQuery Examples
Angular Examples
XML Examples

Web Certificates

HTML Certificate
CSS Certificate
JavaScript Certificate
jQuery Certificate
PHP Certificate
Bootstrap Certificate
XML Certificate


W3Schools is optimized for learning, testing, and training. Examples might be simplified to improve reading and basic understanding.
Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content.
While using this site, you agree to have read and accepted our terms of use ,
cookie and privacy policy .
Copyright 1999-2018 by Refsnes Data. All Rights Reserved.
Powered by W3.CSS .

W3Schools.com