What is html tags
What is html tags ?
HTML Text is written using tags. By default, the text written in body is called plain text. All text elements are written inside body. <p> is the common tag use to write paragraphs. There are many tags to write plan text in html.
- Plan text
- Paragraph tag
- Address tag
- Blokquote tag
- pre tag
- Bold tag
- Italic tag
- Underline
- Small tag
- Big tag
- Delete tag
- Font tag
Plan text
Any text written directly inside body without any tag is known as Plain text in html.The default font size pf plain text is 16px.
Plain text
<!DOCTYPE html> <html lang="en"> <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>Document</title> </head> <body> This is an example of Plain text This is an example of Plain text </body> </html>
Output
This is an example of plain text.
Paragraph tag
Paragraph Tag or p tag is use to write a paragraph in HTML. By default p tag is Block level and occupy 1 em font size. P tag always start and ends with a new line. Default width of p tag is 100% of parent element.
Paragraph tag
<!DOCTYPE html> <html lang="en"> <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>Document</title> </head> <body> <p>This ia an example of paragraph tag</p> </body> </html>
Output
This is an example of paragrapg tag
Address tag
Address tag is used to add postal address in a webpage. Address is function element, and italic in style. Default font-size is 1em.
Paragraph tag
<!DOCTYPE html> <html lang="en"> <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>Document</title> </head> <body> <address> Shineskill <br> 1rd Floor,Diputy Para , <br> Kutchery chowk Ranchi, 834001<br> <abbr title="Phone No">Ph</abbr> 1234567890 </address> </body> </html>
Output
!st Floor, Diputy Para ,
Kutchery chowkRanchi, 834001
Phone No. 1234567890
Blockquote tag
Blockquote tag is used to write a Block Level quotation with extended quotation in HTML. This is mainly a text with Extended Quotation. By-default there is a margin of 40px from left and right in blockquote.
Blockquote tag
<!DOCTYPE html> <html lang="en"> <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>Document</title> </head> <body> <blockquote> This ia an example tag of blockquote</blockquote> </body> </html>
Output
This ia an example tag of blockquote
Pre tag
PRE Tag is the only tag which follow the exact format in which you are writing. with yor own format
Pre tag
<!DOCTYPE html> <html lang="en"> <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>Document</title> </head> <body> <pre> This is an example of, pre tag</pre> </body> </html>
Output
This
is an example of,
pre tag
Bold tag
Html b tag is used to bold text. b tag is inline level element.
Bold tag
<!DOCTYPE html> <html lang="en"> <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>Document</title> </head> <body> <b>this is an example of bold tag</b> </body> </html>
Output
This is an example of bold tag
Italic tag
Html b tag is used to bold text. b tag is also inline level element.
Italic tag
<!DOCTYPE html> <html lang="en"> <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>Document</title> </head> <body> <i>this is an example of italic tag</i> </body> </html>
Output
This is an example of italic tag
Underline tag
Html u tag is used to underline text. u tag is also inline level element.
Underline tag
<!DOCTYPE html> <html lang="en"> <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>Document</title> </head> <body> <u>this is an example of underline tag</u> </body> </html>
Output
This is an example of underline tag
Small tag
html small tag is used to print small text. The default font-size of small tag is smaller (relative to parent element). small tag is also inline level element.
Small tag
<!DOCTYPE html> <html lang="en"> <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>Document</title> </head> <body> <h1>this is an example of <small>small</small> tag</h1> </body> </html>
Output
This is an small tag.
This is an small tag
Underline tag
Html u tag is used to underline text. u tag is also inline level element.
Underline tag
<!DOCTYPE html> <html lang="en"> <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>Document</title> </head> <body> <u>this is an example of underline tag</u> </body> </html>
Output
This is an example of underline tag
Big tag
html big tag is used to print big text. The default font-size of big tag is big (relative to parent element). Big tag is also inline level element.
Big tag
<!DOCTYPE html> <html lang="en"> <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>Document</title> </head> <body> <h1>this is an example of <big>big</big> tag</h1> </body> </html>
Output
This is an Big tag.
This is an Big tag
Delete tag
html delete tag is used to print deleted text. it is use to show the text but in deleted way. Delete tag is also inline level element.
Delete tag
<!DOCTYPE html> <html lang="en"> <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>Document</title> </head> <body> <h1>this is an example of <del>delete</del> tag</h1> </body> </html>
Output
This is an Big tag.
This is an Big tag
Font tag
Font Tag was used to add color, font-family and size to the text inside font tag. But in HTML5, we use css to change style of text.
font tag
<!DOCTYPE html> <html lang="en"> <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>Document</title> </head> <body> <font>This is an Default font tag.</font> <font size="7">This is an example of font size</font> <font color="blue">This is an example of font color</font> <font face="cursive">This is an example of font face</font> <font size="5" color="red" face="Comic sans MS">This is an example of all font attribute </font> </body> </html>