html basics
source:https://htmldog.com/guides/html/beginner/
20210605
HTML is used for meaning and CSS is used for presentation.
1. getting started
type a sentence with notepad, save is as test.html, opened with browser : ./path/test.html, there is your first web page.
2. tags, atrributes and elements
2.1 <!DOCTYPE html>, document type declaration
2.2 tags: <html> </html> is opening and closing tag. some tags are “self-closing”, such as <img> <br>
2.3 attributes: <body id=“moss”>body line text</body>, “id”,“name”,…is attributes
2.4 elements: body line text is a body elements.
3. page titles
text in title element appears on the title bar of the window, not canvas area
<head>
<title>My first web page</title>
</head>
4. paragraphs
4.1 paragraph: <p> </p>
4.2 emphasis: <em> </em>
4.3 strong importance: <strong> </strong>
4.4 line breaks: <br>
5. headings
h1, h2, h3, h4, h5 and h6, h1 is the almighty emperor of headings, h6 lowest pleb
6. lists
unordered lists: <ul> </ul>
ordered lists: <ol> </ol>
7. links
7.1 anchor tag (a tag) define link
7.2 absolute link: <a href=“http://www.htmldog.com”>HTML Dog
7.3 relative link: <a href=“flyingmoss.html”>The miracle of moss in flight
7.4 link to another file or another part of the same page: <h2 id=“moss”>Moss, and then link to it by using something like this: <a href="#moss">Go to moss
8. images
<img src=“http://www.htmldog.com/badge1.gif” width=“120” height=“90” alt=“HTML Dog”>
9. tables
tr: table row
td: table data cell
<table>
<tr>
<td>Row 1, cell 1</td>
<td>Row 1, cell 2</td>
<td>Row 1, cell 3</td>
</tr>
</table>
10. forms
<form action="contactus.php" method="post">
<p>Name:</p>
<p><input type="text" name="name" value="Your name"></p>
<p>Species:</p>
<p><input name="species"></p>
<!-- remember: 'type="text"' isn't actually necessary -->
<p>Comments: </p>
<p><textarea name="comments" rows="5" cols="20">Your comments</textarea></p>
<p>Are you:</p>
<p><input type="radio" name="areyou" value="male"> Male</p>
<p><input type="radio" name="areyou" value="female"> Female</p>
<p><input type="submit"></p>
</form>