-
Notifications
You must be signed in to change notification settings - Fork 0
/
htmlAttributes.html
85 lines (69 loc) · 2.23 KB
/
htmlAttributes.html
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
<!DOCTYPE html>
<html lang="en-US">
<body>
<h2>The href attribute</h2>
<p>HTML links are defined with the a tag. The link address is specified in the href attribute:</p>
<a href="https:www.w3schools.com">visit w3schools </a>
<br>
<h2>The src Attribute</h2>
<p>HTML images are defined with the img tag, and the filename of the image source is specified in the src attribute:</p>
<img src="imageGirl.png" width="500" height="600" alt="girl with a jacket">
<br>
<h2>The style Attribute</h2>
<p>The style attribute is used to add styles to an element, such as color:</p>
<p style="color:red">this is a red paragraph</p>
<p title="I am a header">I am a title</p>
<p title="I'm a tooltip">Mouse over will display the tooltip,</p>
<br>
<a href="https://www.w3schools.com/html/">visit our html tutorial</a>
<h1>About W3Schools</h1>
<p title="About W3Schools">
You cannot omit quotes around an attribute value
if the value contains spaces.
</p>
<p><b>
If you move the mouse over the paragraph above,
your browser will only display the first word from the title.
</b></p>
<p title="John 'ShortGun' Nelson">John with double quotes</p>
<p title='John "ShortGun" Nelson'>John with single quotes</p>
<p>You can change the size of a heading with the style attribute, using the font-size property.</p>
<h1 style="font-size:60px">this is the h1 heading</h1>
<p>this is a paragraph</p>
<p>this is another paragraph</p>
<p>this is the next paragraph</p>
<p>This paragraph
contains a lot of lines
in the source code,
but the browser
ignores it.</p>
<p>
This paragraph
contains a lot of spaces
in the source code,
but the browser
ignores it.
</p>
<h1>This is heading 1</h1>
<p>This is some text.</p>
<hr>
<h2>This is heading 2</h2>
<p>This is some other text.</p>
<hr>
<h2>This is heading 2</h2>
<p>This is some other text.</p>
<p>In HTML, spaces and new lines are ignored:</p>
<p>
My Bonnie lies over the ocean.
My Bonnie lies over the sea.
My Bonnie lies over the ocean.
Oh, bring back my Bonnie to me.
</p>
<pre>
My Bonnie lies over the ocean.
My Bonnie lies over the sea.
My Bonnie lies over the ocean.
Oh, bring back my Bonnie to me.
</pre>
</body>
</html>