diff --git a/files/en-us/learn_web_development/howto/design_and_accessibility/html_features_for_accessibility/index.md b/files/en-us/learn_web_development/howto/design_and_accessibility/html_features_for_accessibility/index.md
index 438a34c0aae9b43..200e6d20dcdb349 100644
--- a/files/en-us/learn_web_development/howto/design_and_accessibility/html_features_for_accessibility/index.md
+++ b/files/en-us/learn_web_development/howto/design_and_accessibility/html_features_for_accessibility/index.md
@@ -58,7 +58,7 @@ To aid tabbing, you can supply a [skip link](/en-US/docs/Web/HTML/Reference/Elem
## Alt attribute for image
-Every image should have an [`alt`](/en-US/docs/Web/HTML/Reference/Elements/img#alt) attribute. If the image is purely decoration and adds no meaning to the content or context of the document, the `alt` attribute should be present, but empty. You can optionally also add [`role="presentation"`](/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/presentation_role). All other images should include an `alt` attribute providing [alternative text describing the image](/en-US/docs/Web/API/HTMLImageElement/alt#usage_notes) in a way that is helpful to users who can read the rest of the content but can't see the image. Think about how you would describe the image to someone who can't load your image: that's the information you should include as the value of the `alt` attribute.
+Every image should have an [`alt`](/en-US/docs/Web/HTML/Reference/Elements/img#alt) attribute. If the image is purely decoration and adds no meaning to the content or context of the document, the `alt` attribute should be present, but empty. You can optionally also add [`role="presentation"`](/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/presentation_role). All other images should include an `alt` attribute providing [alternative text describing the image](/en-US/docs/Web/HTML/Reference/Elements/img#accessibility) in a way that is helpful to users who can read the rest of the content but can't see the image. Think about how you would describe the image to someone who can't load your image: that's the information you should include as the value of the `alt` attribute.
```html
diff --git a/files/en-us/web/api/htmlimageelement/align/index.md b/files/en-us/web/api/htmlimageelement/align/index.md
index 403f803e4931501..95790f24d01d552 100644
--- a/files/en-us/web/api/htmlimageelement/align/index.md
+++ b/files/en-us/web/api/htmlimageelement/align/index.md
@@ -10,53 +10,31 @@ browser-compat: api.HTMLImageElement.align
{{APIRef("HTML DOM")}}{{deprecated_header}}
-The _obsolete_ **`align`**
-property of the {{domxref("HTMLImageElement")}} interface is a string which indicates
-how to position the image relative to its container.
+The _deprecated_ **`align`** property of the {{domxref("HTMLImageElement")}} interface is a string which indicates how to position the image relative to its container. It reflects the `` element's [`align`](/en-US/docs/Web/HTML/Reference/Elements/img#align) content attribute.
-You should instead use the
-CSS property {{cssxref("vertical-align")}}, which does in fact also work on images
-despite its name. You can also use the {{cssxref("float")}} property to float the image
-to the left or right margin.
-
-The `align` property reflects the HTML [`align`](/en-US/docs/Web/HTML/Reference/Elements/img#align)
-content attribute.
+You should instead use the CSS property {{cssxref("vertical-align")}}, which does in fact also work on images despite its name. You can also use the {{cssxref("float")}} property to float the image to the left or right margin.
## Value
-A string specifying one of the following strings which set the
-alignment mode for the image.
-
-### Baseline alignment
-
-These three values specify the alignment of the element relative to the text baseline.
-These should be replaced by using the CSS {{cssxref("vertical-align")}} property.
+A string. For the permitted values, see the HTML [`
`](/en-US/docs/Web/HTML/Reference/Elements/img#align) reference.
-- `bottom`
- - : The bottom edge of the image is to be aligned vertically with the current text
- baseline. **Default value.**
-- `middle`
- - : The center of the object should be aligned vertically with the current baseline.
-- `top`
- - : The top edge of the object should be aligned vertically with the current baseline.
+## Examples
-It may be worth noting that {{cssxref("vertical-align")}} offers several additional
-options for its value; you may wish to consider these when changing your code to use it.
+### Setting the align attribute
-### Floating images horizontally
+```js
+const img = new Image();
+img.src = "example.png";
+img.align = "top";
+```
-The `left` and `right` properties don't affect the
-baseline-relative alignment. Instead, they cause the image to "float" to the left or
-right margin, allowing the following text to flow around the image. You should instead
-use the CSS {{cssxref("float")}} property, specifying as the value
-either `left` or `right`.
+Instead of doing this, consider:
-- `left`
- - : Floats the image over to place the left edge flush against the current margin. Any
- text that follows will flow against the image's right edge.
-- `right`
- - : Floats the image to place its right edge flush against the right margin. Subsequent
- text will flow along the image's left edge.
+```js
+const img = new Image();
+img.src = "example.png";
+img.style.verticalAlign = "top";
+```
## Specifications
diff --git a/files/en-us/web/api/htmlimageelement/alt/index.md b/files/en-us/web/api/htmlimageelement/alt/index.md
index 3daeeca7c7b4bab..0c25bbbed839e50 100644
--- a/files/en-us/web/api/htmlimageelement/alt/index.md
+++ b/files/en-us/web/api/htmlimageelement/alt/index.md
@@ -8,241 +8,24 @@ browser-compat: api.HTMLImageElement.alt
{{APIRef("HTML DOM")}}
-The {{domxref("HTMLImageElement")}} property **`alt`** provides fallback (alternate) text to display when the image specified by the {{HTMLElement("img")}} element is not loaded.
+The **`alt`** property of the {{domxref("HTMLImageElement")}} interface provides fallback (alternate) text to display when the image specified by the {{HTMLElement("img")}} element is not displayed, whether because of an error, because the user has disabled the loading of images, or because the image hasn't finished loading yet. It reflects the `
` element's [`alt`](/en-US/docs/Web/HTML/Reference/Elements/img#alt) content attribute.
-This may be the case because of an error, because the user has disabled the loading of images, or because the image hasn't finished loading yet.
-
-Perhaps the most important reason to use the `alt` property is to support [accessibility](/en-US/docs/Web/Accessibility), as the `alt` text may be used by screen readers and other assistive technologies to help people with a disability make full use of your content.
-It will be read aloud or sent to a braille output device, for example, to support blind or visually impaired users.
-
-> **Think of it like this:** When choosing `alt` strings for your images, imagine what you would say when reading the page to someone over the phone without mentioning that there's an image on the page.
-
-The alternate text is displayed in the space the image would occupy and should be able to take the place of the image _without altering the meaning of the page_.
+There are important accessibility implications of providing appropriate alt text, and the requirements may differ based on the purpose of the image. See the HTML [`
`](/en-US/docs/Web/HTML/Reference/Elements/img#authoring_meaningful_alternate_descriptions) reference for more information.
## Value
-A string which contains the alternate text to display when the image is not loaded or for use by assistive devices.
-
-The `alt` attribute is officially mandatory; it's meant to always be specified.
-If the image doesn't require a fallback (such as for an image which is decorative or an advisory icon of minimal importance), you may specify an empty string (`""`).
-For compatibility reasons, browsers generally will accept an image without an `alt` attribute, but you should try to get into the habit of using it.
-
-## Usage notes
-
-The fundamental guideline for the `alt` attribute is that every image's alternate text should be able to replace the image _without altering the meaning of the page_. You should never use `alt` for text that could be construed as a caption or title.
-There are separate attributes and elements designed for those purposes.
+A string.
## Examples
-Beyond that, there are additional guidelines for using `alt` appropriately which vary depending on what the image is being used for.
-These are shown in the examples below.
-
-### Decorative images
-
-Images with no semantic meaning—such as those which are solely decorative—or of limited informational value, should have their `alt` attributes set to the empty string (`""`).
-This is shown in the example below.
-
-#### HTML
-
-In the HTML for this example, shown below, the {{HTMLElement("img")}} element includes the `alt` property, which will prevent the image from having any alternate text, since it's a decorative detail.
-
-```html
-
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque quis orci - ligula. Lorem ipsum dolor sit amet, consectetur adipiscing elit. In ac - neque libero. Vivamus consectetur rhoncus elit eget porta. Etiam pulvinar - ex id sapien laoreet, quis aliquet odio lobortis. Nam ac mauris at risus - laoreet cursus vitae et sapien. Etiam molestie auctor eros, ac porta risus - scelerisque sit amet. Ut nunc neque, porta eu auctor at, tempor et arcu. -
-- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque quis orci - ligula. Lorem ipsum dolor sit amet, consectetur adipiscing elit. In ac neque - libero. Vivamus consectetur rhoncus elit eget porta. Etiam pulvinar ex id - sapien laoreet, quis aliquet odio lobortis. Nam ac mauris at risus laoreet - cursus vitae et sapien. Etiam molestie auctor eros, ac porta risus - scelerisque sit amet. Ut nunc neque, porta eu auctor at, tempor et arcu. -
-Image height: ?px (resize to update)
@@ -51,8 +39,7 @@ otherwise, it's drawn at 300px. ### JavaScript -The JavaScript code looks at the `height` to determine the height of the -image given the width at which it's currently drawn. +The JavaScript code looks at the `height` to determine the height of the image given the width at which it's currently drawn. ```js const clockImage = document.querySelector("img"); @@ -82,6 +69,8 @@ This example may be easier to try out {{LiveSampleLink('Examples', 'in its own w ## See also +- {{domxref("HTMLImageElement.width")}} +- {{domxref("HTMLImageElement.naturalHeight")}} - {{domxref("HTMLCanvasElement.height")}} - {{domxref("HTMLEmbedElement.height")}} - {{domxref("HTMLIFrameElement.height")}} diff --git a/files/en-us/web/api/htmlimageelement/hspace/index.md b/files/en-us/web/api/htmlimageelement/hspace/index.md index 40669985c551a06..19c95c9a9de464c 100644 --- a/files/en-us/web/api/htmlimageelement/hspace/index.md +++ b/files/en-us/web/api/htmlimageelement/hspace/index.md @@ -10,30 +10,13 @@ browser-compat: api.HTMLImageElement.hspace {{APIRef("HTML DOM")}}{{deprecated_header}} -The -_obsolete_ **`hspace`** property of the -{{domxref("HTMLImageElement")}} interface specifies the number of pixels of empty -space to leave empty on the left and right sides of the {{HTMLElement("img")}} element -when laying out the page. +The _deprecated_ **`hspace`** property of the {{domxref("HTMLImageElement")}} interface specifies the number of pixels of empty space to leave empty on the left and right sides of the {{HTMLElement("img")}} element when laying out the page. It reflects the `