HTML Basic
HTML Basic
Basic tags:
<!DOCTYPE html> ----> declaration of document type
<html> ----> represent the root of element
_____________
<head> -----> collection of meta data from the document
|
<body> ------> defines the document's body.
|
(contains for all visible contents such as
headings,paragraph,images,hyperlinks,tables,list etc). |------>Nested Html
element
<h> ----------> defines large heading.(contains
<h1></h1>,..................<h6></h6> |
<p> -------> defines paragraph
_____________|
link tag:
<a href="url">url name</a>
where,
<a> -represent hyperlinks
href- specify the url
image tag:
<img src=" image file name" alt="image text" width="image width size" heigth="
image height size">
where,
<img> -represent the image
src -source of image file
alt -alternate text the image
width,height-->image size
Empty tag:
<br> ----> line break
<hr> ----> draw the horizontal line
it does not contain the end tag or closeing tag.
HTML style.;
style: ----attribute for styling HTML elements.
syntax:
<tagname style="property:value;">
example:
<!DOCTYPE html>
<html>
<body>
<p>I am normal</p>
<p style="color:red;">I am red</p>
<p style="color:blue;">I am blue</p>
<p style="font-size:50px;">I am big</p>
</body>
</html>
background color :
---->for background color
ex:
<body>
</body>
text color :
-------->-for text colors
ex:
<body>
<h1 style="color:blue;">This is a heading</h1>
<p style="color:red;">This is a paragraph.</p>
</body>
font family:
-for text fonts
ex:
<body>
<h1 style="font-family:verdana;">This is a heading</h1>
<p style="font-family:courier;">This is a paragraph.</p>
</body>
font size:
-for text sizes
ex:
<h1 style="font-size:300%;">This is a heading</h1>
<p style="font-size:160%;">This is a paragraph.</p>
text align:
- for text alignment
ex:
<h1 style="text-align:center;">Centered Heading</h1>
<p style="text-align:center;">Centered paragraph.</p>