HTML Afbeeldingen

HTML <img> hspace attribuut

  • Het hspace attribuut is verouderd, er wordt aangeraden deze te vermijden.
  • Het hspace attribuut creëert ruimte links en rechts van de afbeelding.
      Dit om te voorkomen dat tekst te dicht bij de afbeelding staat, of dat afbeeldingen te dicht tegen elkaar staan.
  • De waarde kan uitgedrukt worden in pixels, of als percentage van de beschikbare ruimte.

Attribuut voorbeeld

<html>
<body>

<img src="html-t-logo.png" height="41" width="60">
<img
src="html-totaal.png" width="250" height="100" hspace="30px">
<img
src="html-t-logo.png" height="41" width="60">
</body>
</html>
middelste afbeelding met 30px hspace
logo

Verschil HTML - XHTML

Het hspace attribuut van het img element is verouderd en wordt NIET ondersteunt in HTML 4.01 Strict / XHTML 1.0 Strict DTD.

Attribuut waarde

Waarde Beschrijving
pixels De ruimte in pixels (bv. "20px" of "20") links en rechts van de afbeelding.

naar boven 

Opbouw

<img src="url" hspace="pixels"> In HTML
<img src="url" hspace="pixels" /> In XHTML
tip

Maak gebruik van CSS om de vrije ruimte rond afbeeldingen te bepalen !

  Syntaxis: <img style="margin: 10px 30px" />

Browser ondersteuning

Internet Explorer Firefox Chrome Opera Safari

  • Het <img> hspace attribuut wordt ondersteunt in de bekende browsers.
naar boven naar boven naar vspace attribuut
naar boven naar het vspace attribuut