-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
199 lines (139 loc) · 6.65 KB
/
index.html
File metadata and controls
199 lines (139 loc) · 6.65 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<header>
<h1>HTML Image</h1>
</header>
<div>
<!-- 1. Put an Image -->
<h2>Put an Image on a Web Page</h2>
<p>Syntax:<br> <span><</span>img src="twitter.png"<span>></span></p>
<img src="twitter.png">
<div>
<h2>Alt Attribute</h2>
<p>Use the "alt" attribute to provide an alternate text for an image. This attribute will show text if your
connection to slow or, if a browser cannot find an image.</p>
<p>Syntax:<br> <span><</span>img src="facebook.png" alt="Facebook"<span>></span></p>
<img src="facebook.png" alt="Facebook">
</div>
<!-- style, width & height attribute -->
<div>
<h2>Width and Height or Style Attribute</h2>
<h3>Width and Height Attribute</h3>
<p>Syntax: <br> <span><</span>img src="flower.jpg" alt="Flower" width="220px" height="140px"<span>></span></p>
<img src="flower.jpg" alt="flower" width="220px" height="140px">
<h3>Style Attribute</h3>
<p>Syntax: <br> <span><</span>img src="beach.jpg" alt="Beach" style="width:220px;
height:140px"<span>></span></p>
<img src="beach.jpg" alt="Beach" style="width:220px; height:140px">
</div>
<!-- Images in Another Folder or Server -->
<div>
<h2>Images in Another Folder or Server</h2>
<h3>In Another Folder</h3>
<p>Syntax:<br> <span><</span>img src="img/smartphone.jpg" alt="Smartphone" width="200px"
height="100px"<span>></span></p>
<img src="img/smartphone.jpg" alt="Smartphone" width="200px" height="100px">
<h3>In Another Server</h3>
<p>Syntax:<br> <span><</span>img
src="https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png"
alt="Google"<span>></span></p>
<img src="https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png"
alt="Google">
</div>
<!-- Animated Images -->
<div>
<h2> Animated Images</h2>
<p>Syntax:<br> <span><</span>img src="google.gif" alt="Google" width="400px"
height="250px"<span>></span></p>
<img src="google.gif" alt="Google" width="400px" height="250px">
</div>
<!-- Images as A Link -->
<div>
<h2>Image as a Link</h2>
<p>Syntax:<br>
<span><</span>a href="https://google.com"<span>></span><br>
<span><</span>img src="google.gif" alt="Google"
width="400px"
height="250px"<span>></span><br>
<span><</span>/a<span>></span></p>
<a href="https://google.com">
<img src="google.gif" alt="Google" width="400px" height="250px">
</a>
</div>
<!-- Image Floating -->
<div>
<h2>Image Floating</h2>
<p>Syntax:<br>
<span><</span>p<span>></span>
<span><</span>img src="Smiley.svg" alt="Google" style="float:left;width: 30px; height:
30px"<span>></span>
<span><</span>/p<span>></span>
</p>
<p><img src="Smiley.svg" alt="Smiley" style="float:right;width: 30px; height: 30px">
Lorem ipsum dolor
sit amet consectetur adipisicing elit. Eos perspiciatis, culpa dolores laborum rem at adipisci harum
iure assumenda aliquam animi esse. Voluptates hic possimus obcaecati fugiat voluptate cum dolore
tempora, architecto praesentium veritatis iste eligendi repellat qui fuga consequuntur.
</p>
<p><img src="Smiley.svg" alt="Smiley" style="float:left;width: 30px; height: 30px">
Lorem ipsum dolor sit
amet consectetur adipisicing elit. Eos perspiciatis, culpa dolores laborum rem
at adipisci harum iure assumenda aliquam animi esse. Voluptates hic possimus obcaecati fugiat
voluptate cum dolore tempora, architecto praesentium veritatis iste eligendi repellat qui fuga
consequuntur.
</p>
</div>
</div>
<header>
<h1>Image Maps</h1>
</header>
<div>
<!-- 2. Image Maps -->
<h2>Image Maps</h2>
<p>Syntax:</p>
<img src="img/imagemaps.png" alt="Image Maps">
<p>Click on the facebook icon or the instagram icon to go to a new page:</p>
<img src="pexels.jpeg" alt="Pexels" usemap="#workmap">
<map name="workmap">
<area shape="rect" coords="204,162,227,140" alt="Facebook" href="https://facebook.com" target="_blank">
<area shape="rect" coords="236,154,260,130" alt="Instagram" href="https://instagram.com" target="_blank">
</map>
</div>
<header>
<h1>Background Images</h1>
</header>
<div style="background-image: url('flower.jpg');">
<!-- 3. Background Image -->
<h2 style="color: white">Background Images</h2>
<p style="color: white">Syntax:<br>
<span><</span>div style="background-image: url('flower.jpg');"<span>></span>
</p>
<p style="color: white">You can add a background image in "div" or "body" element with "style" attribute.</p>
</div>
<div style="background-image: url('emoticon.jpg'); background-repeat: no-repeat;">
<h2>Background Images Repeat</h2>
<p>You can add a background image in "div" or "body" element with "style" attribute.</p>
</div>
<header>
<h1>Picture Element</h1>
</header>
<div>
<!-- 4. Picture Element -->
<h2>Picture Element</h2>
<p>Resize the screen size to see what happens</p>
<picture>
<source media="(min-width: 650px)" srcset="flower.jpg">
<source media="(min-width: 465px)" srcset="beach.jpg">
<img src="pexels.jpeg">
</picture>
</div>
</body>
</html>