Professional Documents
Culture Documents
HTML Interview Prep
HTML Interview Prep
Basic Syntax
<html>
<body>
<h1> Hello world </h1>
</body>
</html>
Another Syntax
<html>
<head>
<title> This is website</title>
</head>
<body>
<h1> Hey how Are you?</h1>
<p> website content goes here</p>
</body>
</html>
Another one
<html>
<head>
Document header related tags
</head>
<body>
Document body related tags
</body>
</html>
CORE ATTRIBUTES
In Html there are core attributes like
1)ID
2)title
3)class
4)style
1)ID attribute is use to uniquely identify any element within an html page
It is used to idntify two elements of the same name in the web page(or Style
sheet)
Example
<p id="html"> This explains what is Html</p>
<p id="css"> This explains what is css </p>
________________________________________________________________
________________________________________________________________
____________________________
Internationalization Attributes
1)dir
2)lan
3)xml:lang
1)dir attribute
-> the dir attribute allows you to indicate to the browser the direction in which
the text should flow
-> the dir attribute can take one of two values, as you can see below
ltr-> left to right
rtl-> right to left
syntax
<!DOCTYPE html>
<html dire="rtl>
<body>
HI this is arbaaz
</body>
</html>
output : the text we can see from right to left
2) lang Attribute
it is use to indicate the main language used in a document but it was used in
previous versions in we can also use in xml:lang for to indicate the main
language in html newer versions
<!DOCTYPE html>
<html dire="en">
<body>
HI this is arbaaz
</body>
</html>
________________________________________________________________
________________________________________________________________
_____________________________
HTML Formatiing
1)BOLD TEXT
<b> it is used to do bold text </b>
2)ITALIC TEXT
<i> it is used to do italic text</i>
3)UNDERLINE TEXT
<u> it is used to underline the text</u>
4)STRIKE TEXT
<strike>It is used to strike the text</strike>
5)SUPERSCRIPT TEXT
IT IS USED TO DISPLAY THE TEXT IN OTHER HEIGHT
<sup> hi how are you</sup>
6) SUBSCRIPT TEXT
IT IS USED TO DISPLAY THE TEXT HEIGHT BENEATH THE OTHER
CHARACTERS
<sub>hi how </sub>
Output
HI JO KAHA
hi how
7) INSERTED TEXT
Anything that appears within <ins>..</ins> element is displayed as inserted text
Code
<p> I want to do job as a <del>Customer support</del> <ins>Software</ins>
Output
I want to do job as a Customer support Customer support Software
8) BIG text
This is used to make the text big
<big> </big>
Example
<p> the thing use a <big> gg</big>
Output
9)small text
This is used to make the text big
<small></small>
Example
<p> the thing use a <small> gg</small>
Output
the thing use a gg
Image Tag
<img src=”” alt=””
Example:
<img src="images/product201.jpg" alt="">
Links Tag
<a href="#home">home</a>
Lists
unorder list
<ul>
<li> betroot </li>
<li> soap </li>
Order list
<ol>
<li> soap </li>
<li> beetroot</li>s
</ol>