-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path13_HTML_Images.html
More file actions
46 lines (34 loc) · 1.58 KB
/
Copy path13_HTML_Images.html
File metadata and controls
46 lines (34 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<!DOCTYPE html>
<head>
<style>
/* This style sets the width of all images to 100%: */
img {
width: 100%;
}
</style>
</head>
<body>
<h2>Width/Height Attributes or Style?</h2>
<p>The first image uses the width attribute (set to 128 pixels), but the style in the head section overrides it, and sets the width to 100%.</p>
<img src="/images/html5.gif" alt="HTML5 Icon" width="128" height="128">
<p>The second image uses the style attribute to set the width to 128 pixels, this will not be overridden by the style in the head section:</p>
<img src="/images/html5.gif" alt="HTML5 Icon" style="width:128px;height:128px;">
<h2>Animated Images</h2>
<p>HTML allows moving images:</p>
<img src="/images/programming.gif" alt="Computer man" style="width:48px;height:48px;">
<h2>Floating Images</h2>
<p><strong>Float the image to the right:</strong></p>
<p>
<img src="/images/smiley.gif" alt="Smiley face" style="float:right;width:42px;height:42px;">
A paragraph with a floating image. A paragraph with a floating image. A paragraph with a floating image.
</p>
<p><strong>Float the image to the left:</strong></p>
<p>
<img src="/images/smiley.gif" alt="Smiley face" style="float:left;width:42px;height:42px;">
A paragraph with a floating image. A paragraph with a floating image. A paragraph with a floating image.
</p><br>
<h1>Summary:</h1>
<img src="/images/HTML Images.jpeg" alt="HTML Images">
<img src="/images/HTML Images 2.jpeg" alt="HTML Images">
</body>
</html>