PhuHoai Group7
PhuHoai Group7
PhuHoai Group7
Group: 07
Mai Xuân Hoài -20119131
Nguyễn Hoàng Phú -20119193
HTML (tag, features), CSS (style), Javascript [1]
Tag name, features
Sample codes
Results
HTML HEADING: HTML headings are titles or subtitles that you want to display on a webpage.
<!DOCTYPE html>
<html>
<body>
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
</body>
</html>
A paragraph always starts on a new line, and browsers automatically add some white
space (a margin) before and after a paragraph.
<!DOCTYPE html>
<html>
<body>
<p><b>Lee Sang-hyeok</b></p>
<p><i>Legneds never die</i></p>
<p>This is 2<sub> subscript</sub> and 2<sup>2</sup></p>
</body>
</html>
HTML Styles
The HTML style attribute is used to add styles to an element, such as color, font, size, and
more.
<!DOCTYPE html>
<html>
<body style="background-color:powderblue;">
<h1>This is a heading</h1>
<p>This is a pen.</p>
<p>This is a apple.</p>
</body>
</html>
</body>
</html>
HTML Quotations
The HTML <q> tag defines a short quotation. Browsers normally insert quotation marks around the
quotation.
<!DOCTYPE html>
<html>
<body>
TT CƠ SỞ VÀ ỨNG DỤNG IOTS – ITFL316064
<p>Here is a quote from WWF's website:</p>
<blockquote cite="http://www.worldwildlife.org/who/index.html">
Conservation endures as a living discipline because it is inhabited by a magnificent collection of people.
Only by working together can we create solutions to the most vexing problems we face.
</blockquote>
</body>
</html>
HTML Color
HTML colors are specified with predefined color names, or with RGB, HEX, HSL, RGBA, or HSLA
values.
<!DOCTYPE html>
<html>
<body>
<h1 style="background-color:Blue;">Blue</h1>
<h1 style="background-color:Tomato;">Tomato</h1>
<h1 style="background-color:orange;">Orange</h1>
<h1 style="background-color:red;">Red</h1>
<h1 style="background-color:green;">Green</h1>
<h1 style="background-color:brown;">Brown</h1>
<h1 style="background-color:yellow;">Yellow</h1>
<h1 style="background-color:purple;">Purple</h1>
</body>
</html>
CSS saves a lot of work. It can control the layout of multiple web pages all at once.
<!DOCTYPE html>
<html>
<body>
</body>
</html>
<h1>Link Youtube</h1>
</body>
</html>
HTML Images
Images can improve the design and the appearance of a web page.
<!DOCTYPE html>
<html>
<body>
<h2>HTML Image</h2>
<img src= " mancity_vodich.jpg" alt="City" width="1000" height="600">
</body>
</html>
td, th {
border: 1px solid #dddddd;
text-align: left;
padding: 8px;
}
tr:nth-child(even) {
background-color: #dddddd;
}
</style>
</head>
<body>
<h2>HTML Table</h2>
<table>
<tr>
<th>Name</th>
<th>Student ID</th>
<th>Class</th>
</tr>
<tr>
<td>Mai Xuân Hoài</td>
<td>20119131</td>
<td>CLA4</td>
</tr>
<tr>
<td>Nguyễn Hoàng Phú</td>
<td>20119192</td>
<td>CLA3</td>
</tr>
<tr>
</table>
</body>
</html>
HTML Lists
HTML lists allow web developers to group a set of related items in lists.
<!DOCTYPE html>
<html>
<body>
<h2>Sensor List</h2>
<ul>
<li>Temperature</li>
<li>Humidity</li>
<li>Pressure</li>
</ul>
<h2>Device List</h2>
<ol>
<li>PC</li>
<li>Tablet</li>
<li>Laptop</li>
</ol>
</body>
</html>
Every HTML element has a default display value, depending on what type of element it is.
<!DOCTYPE html>
<html>
<body>
</body>
</html>
HTML Iframes
An HTML iframe is used to display a web page within a web page.
<!DOCTYPE html>
<html>
<body>
<h2>HTML Iframes</h2>
<p>You can use the height and width attributes to specify the size of the iframe:</p>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<button type="button"
onclick="document.getElementById('demo').innerHTML = Date()">
Click me to display Date and Time.
</button>
<p id="demo"></p>
</body>
</html>
<p>The content of the body element is displayed in the browser window 1</p>
<p>The content of the body element is displayed in the browser window 2</p>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<title>IoT Website</title>
<style>
*{
box-sizing: border-box;
}
body {
font-family: Arial, Helvetica, sans-serif;
}
header {
background-color: #500;
padding: 30px;
text-align: center;
font-size: 35px;
color: white;
}
nav {
float: left;
width: 30%;
height: 300px;
background: #ccc;
padding: 20px;
}
nav ul {
list-style-type: none;
padding: 0;
}
article {
float: left;
padding: 20px;
width: 70%;
background-color: #f1f1f1;
height: 300px;
}
section::after {
content: "";
display: table;
clear: both;
}
footer {
background-color: #500;
padding: 10px;
text-align: center;
color:
TT CƠ SỞ VÀ ỨNG DỤNG IOTS – ITFL316064
white;
}
}
</style>
</head>
<body>
<header>
<h2>IoT Lab</h2>
</header>
<section>
<nav>
<ul>
<li><a href="#">Sensor A</a></li>
<li><a href="#">Sensor B</a></li>
<li><a href="#">Sensor C</a></li>
</ul>
</nav>
<article>
<h1>Sensor 1</h1>
<p>This sensor we use for measuring the temperature.</p>
</article>
</section>
<footer>
<p>Footer</p>
</footer>
</body>
</html>
HTML Symbols
Symbols that are not present on your keyboard can also be added by using entities.
<!DOCTYPE html>
<html>
<body>
</body>
</html>
HTML Emojis
Emojis are characters from the UTF-8 character set: 😄 😍 💗
<!DOCTYPE html>
<html>
<style>
body {
font-size: 20px;
}
</style>
<body>
<span style='font-size:100px;'>🦁</span>
<p>I will display 🦁</p>
<p>I will display 🦁</p>
</body>
</html>
https://www.example.com/search?q=coffee&filter=hot drinks
to
https://www.example.com/search?q=coffee&filter=hot%20drinks%26
HTML Forms
An HTML form is used to collect user input. The user input is most often sent to a server for processing.
<!
TT CƠ SỞ VÀ ỨNG DỤNG IOTS – ITFL316064
DOCTYPE html>
<html>
<body>
<h2>HTML Forms</h2>
<form action="/action_page.php">
<label for="fname">Username:</label><br>
<input type="text" id="fname" name="fname" value="username"><br>
<label for="lname">Password:</label><br>
<input type="password" id="lname" name="lname" value="password"><br><br>
<input type="checkbox" id="rules" name="rules1" value="rules">
<label for="lname">Remember password</label><br>
<br><input type="submit" value="Login">
</form>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<script>
</body>
</html>
HTML Video
The HTML <video> element is used to show a video on a web page.
<!DOCTYPE html>
<html>
<body>
<p>
Video courtesy of
<a href="https://www.bigbuckbunny.org/" target="_blank">Big Buck Bunny</a>.
</p>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<audio controls>
<source src="horse.ogg" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
</body>
</html>
HTML Plug-ins
Plug-ins are computer programs that extend the standard functionality of the browser.
<!DOCTYPE html>
<html>
<body>
</body>
</html>
</body>
</html>