Lab 1 - HTML - GOOGLE FIREBASE
Lab 1 - HTML - GOOGLE FIREBASE
Group:
HTML (tag, features), CSS (style), Javascript [1]
Tag name, features:
An inline frame is used to embed another document within the current HTML document.
Tip: It is a good practice to always include a title attribute for the <iframe>. This is used by screen readers
to read out what the content of the <iframe> is.
Sample codes:
<script>
function myName() {
document.getElementById("demo").innerHTML = "Tran Anh Huy";
}
</script>
Results:
HTML JavaScript
Sample codes:
<script>
function myName() {
document.getElementById("demo").innerHTML = "Tran Anh Huy";
}
</script>
Results:
HTML Head
The <head> element is a container for metadata (data about data) and is placed between the <html> tag and
the <body> tag.
HTML metadata is data about the HTML document. Metadata is not displayed.
Metadata typically defines the document title, character set, styles, scripts, and other meta information.
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Introductin of HTML</title>
</head>
Results:
Sample code:
<!DOCTYPE html>
<html lang="en">
<head>
<title>CSS Template</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
*{
box-sizing: border-box;
}
article {
float: left;
padding: 20px;
width: 70%;
/* Responsive layout - makes the two columns/boxes stack on top of each other instead of next to each
other, on small screens */
@media (max-width: 600px) {
nav, article {
width: 100%;
height: auto;
}
}
</style>
</head>
<body>
<header>
<h2>Cities</h2>
</header>
<section>
<nav>
<ul>
<li><a href="#">London</a></li>
<li><a href="#">Paris</a></li>
<li><a href="#">Tokyo</a></li>
</ul>
</nav>
<article>
<h1>London</h1>
<p>London is the capital city of England. It is the most populous city in the United Kingdom, with a
metropolitan area of over 13 million inhabitants.</p>
<p>Standing on the River Thames, London has been a major settlement for two millennia, its
history going back to its founding by the Romans, who named it Londinium.</p>
</article>
</section>
<footer>
<p>Footer</p>
</footer>
</body>
</html>
Result:
TT CƠ SỞ VÀ ỨNG DỤNG IOTS – ITFL316064
Tag name, features:
HTML Symbols
Many mathematical, technical, and currency symbols, are not present on a normal keyboard.
To add such symbols to an HTML page, you can use the entity name or the entity number (a decimal or a
hexadecimal reference) for the symbol.
Results:
HTML Emojis
They are letters (characters) from the UTF-8 (Unicode) character set.
Sample codes:
<p style="font-size:48px">
🐶 😄 😍 💗🖕
Results:
A URL can be composed of words (e.g. w3schools.com), or an Internet Protocol (IP) address (e.g.
192.68.20.50).
Most people enter the name when surfing, because names are easier to remember than numbers.
Sample codes:
<form method="get">
<input type="text" name="get method">
<input type="submit">
</form>
Results:
HTML Form
An HTML form is used to collect user input. The user input is most often sent to a server for processing.
Sample codes:
<form action="/action_page.php">
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="fname" value="Khoa"><br>
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname" value="Doan"><br><br>
<input type="submit" value="Submit">
</form>
Results:
HTML Grafics
SVG has several methods for drawing paths, boxes, circles, text, and graphic images.
Sample codes:
HTML Video
Sample codes:
<video width="320" height="240" controls>
<source src="movie.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
</video>
Results:
Tag
HTML Audio
The HTML <audio> element is used to play an audio file on a web page.
Sample codes:
<audio controls>
<source src="horse.ogg" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">
</audio>
Results:
HTML Plug-in
Sample codes:
The <object> element defines an embedded object within an HTML document.
<object width="100%" height="500px" data="snippet.html"></object>
The <embed> element also defines an embedded object within an HTML document.
<embed src="audi.jpeg">
Results:
HTML Youtube
Sample codes:
<iframe width="420" height="315"
src="https://www.youtube.com/embed/tgbNymZ7vqY">
</iframe>
Results:
HTML Geolocation
Since this can compromise privacy, the position is not available unless the user approves it.
Sample codes:
<p>Displaying location using Latitude and Longitude</p>
<script>
var variable1 = document.getElementById("demo1");
function getlocation() {
navigator.geolocation.getCurrentPosition(showLoc);
}
function showLoc(pos) {
variable1.innerHTML =
"Latitude: " +
pos.coords.latitude +
"<br>Longitude: " +
pos.coords.longitude;
}
</script>
Results:
…………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………
TÀI LIỆU THAM KHẢO
(lưu ý: trích dẫn theo chuẩn IEEE và trích dẫn tự động, xem video clip hướng dẫn trên trang dạy học số)
Clip demo: link (youtube)
References
[1] P. M. Tien, Ky nang dinh huong noi dung nghien cuu khoa hoc, Tp. HCM: ĐH SPKT Tp. HCM, 2021.
[2] N. C. Đức, Kỹ năng lập trình C lần 2, Tp.HCM: NXB ĐH SPKT Tp.HCM, 2021.