HOME | PHP Tutorial | CSS
facebook icon
AgerNic.com
WEB DEVELOPER SITE, HTML, CSS, PHP
PHP Tutorial

PHP forms
HTML Tutorial

CSS Tutorial

HTML Image Size


HTML Tutorial » HTML Image Size

Images can be easily inserted into any section of HTML pages.
The <img> tag must be inside the <body> ... </body> tag.

Syntax:
<img width="pixels" src="your image file">

Differences Between HTML 4.01 and HTML5
This attributes: border, align, vspace, and hspace are not supported in HTML5.
Note: In HTML the <img> tag has no end tag.
In XHTML the <img> tag must be properly closed.


Adding Image Size to images - examples


Example:
Example 1 Adding Image Size to images - examples:

<!DOCTYPE html>
<html>
<head>
<title>Adding Image Size to < img > tag - example</title>
</head>
<body>
<h1>Adding Image to < img > tag. Original size image - example</h1>
<img src="https://www.agernic.com/uploads/html-img-tag.jpg" alt="html image tag"> <br />
<h2>Adding Image size to < img > tag 100px - example</h2>
<img width="100" src="https://www.agernic.com/uploads/html-img-tag.jpg" alt="html image tag">
</body>
</html>
Note: In HTML 4.01, the width could be defined in pixels or in %, but In HTML5, the value must be in pixels.


Resize image html - examples


Specify the width and height in your IMG SRC HTML tag as the next example.

Example:
Example 2 Resize image html - examples:

<!DOCTYPE html>
<html>
<head>
<title>Resize image html - examples</title>
</head>
<body>
<h1>Resize image html with maintain the aspect ratio - examples</h1>
<img width="250" src="https://www.agernic.com/uploads/html-img-tag.jpg" alt="html image tag"> <h1>Resize image html without maintain the aspect ratio - examples</h1>
<img width="250" height="80" src="https://www.agernic.com/uploads/html-img-tag.jpg" alt="html image tag">
</body>
</html>
Note: When re-sizing an image, you have to maintain the aspect ratio. Otherwise, the image could become distorted and lose quality.

html image size, how to resize images in html css, how to set a image in html HTML Image Size - html tutorial

1927. HTML code, Tags, Example, CSS, Editor, Online Courses, Training
Online HTML Tutorial pdf, what is HTML, Online Courses, Classes, Training, Tutorials for Beginners - agernic.com is a free interactive Code, Tags, Example, CSS, Editor, Online Courses, Training for beginners
http://www.agernic.com/html-tutorial.html

2142. HTML Tutorial - Password field
Password field
https://tutorialehtml.com/en/html-tutorial-password-field/

2663. Links : Introduction - HTML Tutorial
HTML links - HTML tutorial
http://www.echoecho.com/htmllinks.htm

2641. Frames : Borders - HTML Tutorial
HTML frames - HTML tutorial
http://www.echoecho.com/htmlframes04.htm

2669. Links : Image Links - HTML Tutorial
HTML links - HTML tutorial
http://www.echoecho.com/htmllinks06.htm

2197. HTML Tutorial - hochgestelltes
Hochgestellter, exponentieller Text in html, Exponent
https://tutorialehtml.com/de/html-hochgestelltes/

Your add here
PHP isset() Function

PHP md5() function

PHP strrchr() Function

PHP empty() Function

PHP str_repeat() function

PHP strstr() function

PHP str_split() function

PHP explode() function

PHP implode() function

PHP htmlspecialchars() function

PHP ltrim() function

PHP similar_text() function

PHP substr() function

PHP html_entity_decode() function

PHP define() function

PHP strip_tags() function

SQL WHERE AND & OR multiple conditions
CSS Button Style
PHP convert array to string comma separated
HTML Image Align
HTML Introduction
CSS Text Style Bold - Text Decoration - Text Shadow