Web developer bootcamp - HTML

Web developer bootcamp - HTML

general rule:

<tagName> Some Content </tagName>

Every HTML document we create will start with this boilerplate:

<!DOCTYPE html> 
<html> 
<head> 
<!-- Our metadata goes here --> 
    <title></title> 
</head> 
<body> 
<!-- Our content goes here --> 
</body> 
</html>

Common Tags

<!-- block elements -->
<h1>I'm a header </h1>
<h2>I'm a slightly smaller header </h2>
<h6>I'm the smallest header </h6>
<p>I'm a paragraph</p>
<button>I'm a button!</button>

<ul>
    <li>List Item 1</li>
    <li>List Item 2</li>
</ul>

<ol>
    <li>List Item 1</li>
    <li>List Item 2</li>
</ol>
<!-- generic container: group content together in block-->
<div> </div>


<!-- inline elements -->

<!-- bold -->
<strong> </strong>
<!-- emphensize -->
<em> </em>
<!-- generic inline container : group content together inline-->
<span> </span>

Closing Tags

<h1>I need a closing tag </h1>
<p>Me too!</p>

Self-Closing Tags

<!-- No closing tag or inner text needed -->
<img src="corgi.png">
<link href="style.css">

Attributes

key: value pair

<tag name="value"></tag>

<p class="selected">woof woof</p>
<link rel="stylesheet" type="text/css" href="style.css">

Images

<img src="corgi.png">

Links

<!-- The <a> tag defines a hyperlink, which is used to link from one page to another. -->
<!-- inline -->
<a href="url">Link Text</a>

<a href="http://www.google.com">Click me to go to Google</a>

HTML tables

<table>
    <thead>
        <tr> 
            <!-- table header -->
            <th></th>
        </tr>
    </thead>
    <tbody>
        <!-- table row -->
        <tr> 
            <!-- table cell -->
            <td></td>
        </tr>
    </tbody>
</table>

 

The <form> tag

<form action="/my-form-submitting-page" method="post">
    <!-- All our inputs will go in here -->
</form>
  • action - the URL to send form data to
  • method - the type of HTTP request

The <input> tag

The Input tag creates interactive controls.

  • type - determines the type of input.
  • placeholder - for text temporarily fill in the input
  • name- same name can connect the input
<input name="" type="" placeholder = "", value="">

<!-- text, email, password, button, submit, date, color, file, radio, checkbox -->

The <label> tag

make the site accessible

<label> </label>

connect label and input with for and id attributes

<label for="username"> </label>
<input id="username"> </input>

<!-- OR nested -->
<label>
    TEXT
    <input id="username"> </input>
</label>

simple validations

  • required attribute validates that an input is not empty
  • There are also type validations. Try changing "type" from "text" to "email"

The <select> tag

drop down menu

<select name = "">
    <option value=""> </option>
</select>

<textarea>

create input more than one line

<textarea name = "" rows="10" cols="50"> </textarea>

 

When submit with button, name and value can be send along with the reqest.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值