Scanner class Methods in Java

HTML Phrase Tags

Phrase Tags

In HTML, some tags are used  to format text in a certain ways.These tags makes the text look highlighted as the client wants them. We have already discussed some of them as <b>,<i> and <strong> etc.

Phrase tags are the tags that make text formatted like a particular template. For example, If we write a java program in the html body and we also wants it to look like a code as written in IDE,then we can use a Phrase tag to make that program look like code.

Here we will discuss some important Phrase tags. Lets begin!
  • Emphasized Tag:-  Emphasize means to give stress on important part. It highlights the text which is written within this tag.It is paired tag.The notation of this tag is <em>...</em>.
 Syntax: <em>...</em>
Example: 
<html>
<head> 
<title>  Emphasized Tag</title>
</head>
<body>
<p>This is a paragraph an it has an <em>emphasized text</em></p>
</body>
</html>
Result:

 

  • Strong Tag:-It makes the text bold. It is a paired tag

Syntax: <strong>...</strong>

Example:

<html>
<head>
<title>
Strong Tag
</title>
</head>
<body>
<p>This is a paragraph and it has a <strong>strong text.</strong> </p>
</body>
</html>

  • Marked Tag:-  This tag marks the enclosed text with yellow color. 

Syntax: <mark>...</mark>
 
 Example: 
<html>
<head> 
<title>Marked Tag</title>
</head>
<body>
<p>
This text is <mark>marked</mark> with yellow color.
</p>
</body>
</html>
 
Result:

 

  • Abbreviation Tag:- This is used to write abbreviation of terms. We can write short name of terms using this tag. Place abbreviation under the opening tag as title attribute's value.

Syntax: <abbr title="abbreviation here">Abbreviation term</abbr>

Example:

<html>
<head>
<title>
Abbreviation Tag
</title>
</head>
<body>
<p>The abbreviation is <abbr title=" Cascading Style Sheet" >CSS</abbr> for Cascading Style Sheet.</p>
</body>
</html>

Result:

  • Definition Tag:- This is used to write definition of terms. When you want to define a term write the term's name within definition tag.It will make the term look special.

Syntax: <dfn>Term name here</dfn>

Example:

<html>
<head>
<title>
Definition Tag
</title>
</head>
<body>
<p>The <dfn >Java</dfn> is a programming language..</p>
</body>
</html>


Result:
  • Coding Tag:-  This tag makes the text look like a code.The text placed inside this tag is changed into the code format. 
Syntax: <code>...</code>
 
 Example:
 
<html>
<head> 
<title>Coding Tag</title>
</head>
<body>
<h1>Java Code </h1>
<p>
<code>class First 
{
 public static void main(String[] args)
{
 System.out.println("Hello Java!");
}
}
</code>
</p>
</body>
</html>
 
 Result:

                                      • Quoting Tag:-  This tag  shows the enclosed text is quoted from some other source or site.The source URL is placed inside this tag as a value to its "cite" attribute. The text is quoted using <blockquote>tag and the source name is represented within <cite> tag.  
                                      Syntax: <blockquote cite="url here">...</blockquote> & <cite>.....</cite>
                                       
                                      Example: 
                                       
                                      <html>
                                      <head>
                                      <title>
                                      QuotingTag
                                      </title>
                                      </head>
                                      <body>
                                      <blockquote>
                                      <p>This text is taken from other source.It is quoted text</p>
                                      </blockquote>
                                      <cite>codeBlogger</cite>
                                      </body>
                                      </html
                                       
                                      Result
                                                              • Short Quotation Tag:-  This tag will enclose the text with double quotation marks("")
                                                              Syntax: <q>...</q>
                                                               
                                                               Example: 
                                                               
                                                              <html>
                                                              <head> 
                                                              <title>Short Quotation Tag</title>
                                                              </head>
                                                              <body>
                                                              <p>
                                                              <q>
                                                              This text is enclosed with double quotes.
                                                              </q>
                                                              </p>
                                                              </body>
                                                              </html>
                                                               
                                                              Result:

                                                                                      • Keyboard Tag:-  This tag makes the text look keyboard input.The text paced inside this tag will have a different font to make it special.We can use this tag tell the user to press certain key form keyboard.
                                                                                      Syntax: <kbd>...</kbd> 
                                                                                       
                                                                                      Example: 
                                                                                       
                                                                                      <html>
                                                                                      <head> 
                                                                                      <title>Keyboard Tag</title>
                                                                                      </head>
                                                                                      <body>
                                                                                      <p>Please press 
                                                                                      <kbd>Ctrl</kbd>
                                                                                      +
                                                                                      <kbd>Alt</kbd>
                                                                                      +
                                                                                      <kbd>Del</kbd>
                                                                                       to  log off from our computer.
                                                                                      </p>
                                                                                      </body>
                                                                                      </html>
                                                                                       
                                                                                       Result:
                                                                                       
                                                                                                                    • Address Tag:-  This tag is used to add the contact information of author.The contact information is formatted in italic style.
                                                                                                                    Syntax: <address>...</address> 
                                                                                                                     
                                                                                                                    Example: 
                                                                                                                     
                                                                                                                    <html>
                                                                                                                    <head> 
                                                                                                                    <title>Address Tag</title>
                                                                                                                    </head>
                                                                                                                    <body>
                                                                                                                    <address>Please press 
                                                                                                                    For queries , please contact us on 
                                                                                                                    <a href="">abc@gmail.com</a><br/>
                                                                                                                    visit us at: <br/>
                                                                                                                    15 c,abc street,xyz,GA 12009
                                                                                                                    </address>
                                                                                                                    </body>
                                                                                                                    </html>
                                                                                                                     
                                                                                                                     Result:

                                                                                                                    These tags are very useful in making your webpage attractive. Keep on practicing!
                                                                                                                     

                                                                                                                    Comments