HTML MegaDoc

Structure

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>My test page</title>
  </head>
  <body>
    <img src="images/firefox-icon.png" alt="My test image">
  </body>
</html>
  • <!DOCTYPE html>: required doctype tag.
  • <html>: HTML root tag
    • <head>: all stuff that are essential but not visible to users
      • <meta charset="utf-8">: sets the character set your document should use to UTF-8
      • <title>: the title on the browser tag, not the header on the actual page
    • <body>: the page that is visible to the user

Empty element: a tag that doesn't have a closing tag, e.g. <img src="..." alt="...">

Attributes

  • action: the URL to send the data when the form is submitted.
  • method: HTTP method, get/post, to send form data

Heading

  • In total there are 6 headers, <h1> ~ <h6>
  • Here are <h1> ~ <h6> from top to bottom  

List

2 types of lists

  • Ordered: 有编号,<ol>
  • Unordered: 无编号,有radio button,<ul>

ordered list

<ol>
  <li>technologists</li>
  <li>thinkers</li>
  <li>builders</li>
</ol>

 

unordered list

<ul>
  <li>technologists</li>
  <li>thinkers</li>
  <li>builders</li>
</ul>

Link

  • <a href="...">some text</a
  • a = anchor
  • href = hypertext reference
<a href="https://www.google.com">Google</a>

** DO NOT omit the http/https in the href, they can make a huge difference

Form

HTML user input

<form action="/action_page.php" method="get">
  <label for="fname">First name:</label>
  <input type="text" id="fname" name="fname"><br><br>
  <label for="lname">Last name:</label>
  <input type="text" id="lname" name="lname"><br><br>
  <input type="submit" value="Submit">
</form>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值