Link to External CSS | CSS
External style sheet : ਇਸਦੀ ਵਰਤੋਂ ਵੱਖਰੀ ਫਾਈਲ ਬਣਾ ਕੇ ਕੀਤੀ ਜਾਂਦੀ ਹੈ। ਸਾਰੀ Coding ਇਸ ਵੱਖਰੀ ਫ਼ਾਈਲ ਵਿੱਚ ਕੀਤੀ ਜਾਂਦੀ ਹੈ ਅਤੇ ਇਸ ਫ਼ਾਈਲ ਦੀ ਐਕਸਟੈਂਸ਼ਨ .css ਹੁੰਦੀ ਹੈ। ਇਹ ਫਾਈਲ ਦੇ ਰੂਪ ਵਿੱਚ ਬਣਾਈ ਜਾਂਦੀ ਹੈ ਅਤੇ ਇਸ ਫਾਈਲ ਨੂੰ ਅਲੱਗ-ਅਲੱਗ ਦੇ ਥਪੇਜਿਜ਼ ਨਾਲ ਲਿੰਕ ਕਰਕੇ ਵਰਤਿਆ ਜਾ ਸਕਦਾ ਹੈ। ਜਦੋਂ ਇਸ ਫ਼ਾਈਲ ਵਿਚ ਤਬਦੀਲੀ ਕੀਤੀ ਜਾਂਦੀ ਹੈ ਤਾਂ ਸਾਰੇ ਲਿੰਕ ਕੀਤੇ ਵੈੱਬਪੇਜਾਂ 'ਤੇ ਇਹ ਤਬਦੀਲੀ ਦਿਖਾਈ ਦਿੰਦੀ ਹੈ। ਅਸੀਂ ਇਹ ਐਕਸਟਰਨਲ ਸਟਾਈਲ ਸੀਟ ਫਾਈਲ ਨੂੰ ਲਿੰਕ ਕਰਨ ਲਈ, ਵੈੱਬਪੇਜ ਦੇ <head> ਸੈਕਸ਼ਨ ਵਿਚ <link ਟੈਗ ਦੀ ਵਰਤੋਂ ਕਰਦੇ ਹਾਂ | ਉਦਾਹਰਣ :
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
Exteral CSS ਫਾਈਲਜ਼ ਕਿਸੇ ਵੀ ਟੈਕਸਟ ਐਡੀਟਰ ਵਿੱਚ ਬਣਾਈਆਂ ਜਾ ਸਕਦੀਆਂ ਹਨ। ਵਿੱਚ ਕੋਈ ਵੀ hian] ਟੈਗ ਨਹੀਂ ਹੋਣੇ ਚਾਹੀਦੇ। ਸਟਾਈਲ ਸੀਟ ਫਾਈਲ ਦੀ ਉਦਾਹਰਣ CSS Filename: "myStyle.css":
An external style sheet is used to define the style for many HTML pages.
To use an external style sheet, add a link to it in the <head>
section of each HTML page:
<!DOCTYPE html>
<html>
<head>
<title>External CSS</title>
<!-- Below Link is External CSS -->
<link rel="stylesheet" href="/html/css/styles.css">
</head>
<body>
<h1>External CSS</h1>
<p>after title tag <BR><BR>
href="/html/css/styles.css"
<BR><BR>
is <B>external css file
</p>
<BR>
<a href="/html/css/styles.css" download>Download External CSS File</a>
</body>
</html>
An external style sheet is used to define the style for many HTML pages.
To use an external style sheet, add a link to it in the <head>
section of each HTML page:
The external style sheet can be written in any text editor. The file must not contain any HTML code, and must be saved with a .css extension.
Here is what the "styles.css" file looks like:
body {
background-color: powderblue;
}
h1 {
color: blue;
}
p {
color: red;
}