DONATE  
MENU
JSON
HTML
AJAX
JAVASCRIPT

HTML Tutorials

INTRODUCTION

» Introduction to HTML

» PRACTICE IT Editor

» Getting Started

» HTML Example

» HTML Tags

» HTML Elements

» Nesting Tags

» Block & Inline Elements

» HTML Attributes

» HTML Comments

» File Paths

» HTML Entities & Symbols

TAGS/ELEMENTS

» Important Tags

» HTML Headings

» Text Formatting

» HTML Links

» HTML Lists

» HTML Tables

» HTML Images

» HTML Audios

» HTML Videos

» HTML Iframes

» HTML Styles

» HTML Scripts

» Semantic Elements

» HTML Metadata

ATTRIBUTES

» Elements' ID

» Elements' Class

» Elements' Style

» Element's Align

» Element's Height & Width

HTML FORMS

» HTML Forms

» Input Elements

» HTML Textarea

» HTML Select

HTML EXAMPLE

» Login Page

.. » HTML » Attributes » Element's Height & Width
Share Tweet WhatsApp

Element's Height & Width

The height and width attributes enable you to define the height and width respectively for inline - block elements. Remember the width of inline - block elements is determine by their content and it is adjustable to whatever extent. The height and width attributes enable us to achieve that.
<img height='120px' width='150px' src='happy_children.jpeg'/><br/><br/>
<img height='150px' width='100%' src='happy_children.jpeg'/>

Copy PRACTICE IT

NOTE:
  • This (height and width attributes) applies to inline block elements only. You can use CSS to adjust that of block elements.
SUMMARY
  1. The HTML height and width attributes enable you to define or set a height and a width for an inline - block elements.
  2. You must not use both at the same time. That is, you may decide to set a height and leave the width and vice - versa. Finally, you can use both at same time.
  3. Heights and widths are usually set in pixels and percentages.
Take a short quiz on Element's Height & Width.
Ask a question or tell us if Element's Height & Width is easy or not.
cent?

Join our 1,090 subscribers to receive tutorials' updates!

  We won't spam your mail box. We hate it.





StackBeginner 2021 © Joseph Omamode