html basics

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>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值