Unit I
Unit I
Notes
<html dir="rtl">
<body>
<p id=”paragraph1”>
This webpage is authored in English language
</p>
<p contenteditable="true" spellcheck="true">
This paragraph is editable
</p>
<p>
<abbr title="World Health Organization">
WHO
</abbr>
was founded in 1948.
</p>
</body>
</html>
Tag Description
<TABLE>
This tag defines the starting of a table and supports the following attributes:
Attribute Description
BORDER Border of the table. E.g. BORDER=1. In order to have an overall control of a site it is
recommended to use Style sheets instead of controlling HTML
WIDTH Width of the table. E.g. WIDTH=100%. It can also contain absolute values in pixels but
percentages are preferred. Again style sheets can do this job better!
ALIGN Relative alignment of the complete table. Can take three values LEFT, CENTER,
RIGHT
<TH>
This tag defines a table heading i.e. the title row. By default the text in this cell is bold and centered.
Cellspacing – It is the distance between each cell in a table which is same as the distance from the
border of the table to the cell position.
Cellpadding – It is the distance between the cell content and cell border used to compress or expand
the content within a cell.
Column Span
You can merge the columns using “colspan” attribute like below:
Row Span
Similar to column space, you can merge any rows together using “rowspan” attribute
<p
Jersey Number: <input type="number" name="num" min="1" max="99">
</p>
<p>
Jersey Color: <input type="color" name="jerseycolor">
</p>
<p>
Birthday: <input type="date" name="bday">
</p>
<p>Position</p>
<div>
<select name="Position">
<option value="sf">Small Forward</option>
<option value="pf">Power Forward</option>
<option value="pg">Point Guard</option>
<option value="sg">Shooting Guard</option>
<option value="c">Center</option>
</select>
</div>
<p>Cities</p>
<div>
<input list="cities">
<datalist id="cities">
<option value="Kakinada">
<option value="Rajahmundry">
<option value="Visakhapatnam">
<option value="Vijayawada">
<option value="Tirupathi">
</datalist>
</div>
<p>Biography</p>
Example:
<p>HTML is building block of Internet </p>
<p>HTML is building block of <del>Internet</del> <ins>WWW</ins></p>
Media:
Any website must be able to engage well with its visitors, be entertaining, and be able to
quickly deliver information.
Embedding content like audio clips, videos, images, maps, and so on... are a great way of
engaging, be entertaining and be able to quickly deliver information to the website users.
HTML5 supports the following types of embedded elements:
Image Element:
Video Element:
Videos can be embedded into web pages using <video>…</video> tag. The <audio> tag has
an attribute 'src' which defines the location of the audio file. It also has an attribute 'controls'
which specifies whether to display the player controls.
Iframe:
We might have requirements to include documents, videos, interactive videos, or even other
web content into a web page directly from external sources. The <iframe> element is used to
meet the above requirement. Using the iframe element, contents from external sources can be
integrated anywhere on our web page. It is defined using <iframe>…</iframe> tag.
Example :
<html>
<body>
<iframe src="table.html" width="1000" height="1000" border=”10”></iframe>
</body>
</html>
Click here for output:
The following is the list of a few vulnerabilities that are possible in HTML:
1. HTML Injection
2. Clickjacking
3. HTML5 attributes and events vulnerabilities
4. Web Storage Vulnerability
5. Reverse Tab nabbing.
HTML Injection?
HTML Injection is one of the possible attacks in HTML5 apps.HTML Injection is an
attack where an attacker can inject malicious HTML code into a vulnerable web application.
An attacker can send malicious code through HTML input fields or website links. Malicious
code can be simple HTML tags that display some information on the page or a form replacing
localStorage.setItem("bgcolor", document.getElementById("bgcolor").value);
localStorage.setItem("textcolor",document.getElementById("textcolor").value);
localStorage.setItem("fontsize",document.getElementById("fontsize").value);
getItem() method is used to fetch values from local storage. Below is the code to retrieve
values from local Storage document.
getElementById("page").style.backgroundColor = localStorage.getItem("bgcolor");
document.getElementById("page").style.color = localStorage.getItem("textcolor");
document.getElementById("page").style.fontSize = localStorage.getItem("fontsize");
Tab nabbing:
Reverse tab nabbing is an attack where a page linked from the target page is able to rewrite that page,
for example to replace it with a phishing site. As the user was originally on the correct page they are
less likely to notice that it has been changed to a phishing site, especially if the site looks the same as
the target. If the user authenticates to this new page, then their credentials (or other sensitive data) are
sent to the phishing site rather than the legitimate one.
<body>
<form>
<label for="">Username</label>
<input type="text" name="username"> <br/>
<label for="">Password</label>
<input type="password" name="password"><br/>
<input type="submit">
</form>
</body>
</html>
Head Elements:
Table Elements:
Embedded Elements: