ad

Wednesday, September 3, 2025

learn HTML link tag

 

learn HTML link tag 

 HTML link tag 

The LINK element indicates a relationship between the current document and an external LINK The LINK element indicates a relationship between the current document and an external resource. The <link> tag is the most  used to the link a external style sheets:

 LINK element  empty (does not have  closing tag), takes to the  same attributes as the anchor element.


HTML link tag program 

<html>

<head>

<title> Linking stylesheet</title>

<link rel="stylesheet" href="style.css">

 </head>

</html>

The syntax is <link rel=" " href=" ">. rel attribute specifies to the relationship between  document containing the hyperlink and the destination resources. href attributes specifies to address of the hyperlink.

HTML link tag program 

Explain Program

Step 1 ]  

<!DOCTYPE html>

  • Declares that the document is an HTML5 document.

Step  2]  

<html> & <body>

  • Root and body of the HTML page. The content of the page goes inside <body>.

Step 3]  

    <head> tag section contains metadata , resources for page.
     It does not display web page.
    contains:
         <title>  page in browser tab
      Links to stylesheets or scripts and Meta tags  charset, viewport, SEO data.

Step 4]

<title> link stylesheet </title>

  title of the web page.

  text use linking stylesheet on web browser tap

  Step 5]  

<link rel ="stylesheet" href="style.css">
    link  external css file  your HTML
  
   rel = "stylesheet"  web browswer that is a css stylesheet.
   href =  style.css"   path  to css file.
  
  assumrs file style.css in same folder as html file

Related Post:-

html form pattern attribute
html frame tag
html table attribute

No comments:

Post a Comment