Set hspace and vspace Attribute for img in HTML and CSS
Description
The following code shows how to set hspace and vspace Attribute for img.
Example
<html>
<body>
<h1>hspace and vspace</h1>
<p>
<img src="http://java2s.com/style/download.png"
alt="disk"<!--from w w w. ja v a2 s . com-->
width="50"
height="66"
align="left"
hspace="10"
vspace="10"/>
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
In a metus et sem tempus mollis. Phasellus vel ante non
ligula posuere ultrices ut ac metus. Cras quam odio,
bibendum ac dignissim pulvinar, sodales eget justo.
Ut eget neque est, in tempor tellus. Fusce ut risus nulla.
Pellentesque tempus metus sit amet magna tempor condimentum.
Quisque dapibus facilisis gravida. Suspendisse vehicula
mauris id nulla convallis congue. Nulla tempor venenatis
congue. Nullam nulla nisl, sollicitudin sed eleifend a,
tempus vitae eros. <br />
</body>
</html>
The code above generates the following result.
HTML CSS Tutorial Image
Add alt Attribute to an image in HTML and C...
Add img element and set src, alt, width and...
Adjust Image Sizes in HTML and CSS
Align image vertically along baseline in HT...
Align image vertically to middle in HTML an...
Align image vertically to text-bottom in HT...
Align image vertically to text-top in HTML ...
Align image vertically using the value sub ...
Align image vertically using the value supe...
Create an Image Map with clickable regions ...
Include images in document in HTML and CSS
Position image in relation to containing el...
Use image a link in HTML and CSS
Add alt Attribute to an image in HTML and C...
Add img element and set src, alt, width and...
Adjust Image Sizes in HTML and CSS
Align image vertically along baseline in HT...
Align image vertically to middle in HTML an...
Align image vertically to text-bottom in HT...
Align image vertically to text-top in HTML ...
Align image vertically using the value sub ...
Align image vertically using the value supe...
Create an Image Map with clickable regions ...
Include images in document in HTML and CSS
Position image in relation to containing el...
Set hspace and vspace Attribute for img in ...
Use align attribute to align image to parag...Use image a link in HTML and CSS