Question:
Which of the following is the syntax to write an external CSS?
बाहरी CSS (external CSS) को जोड़ने के लिए निम्नलिखित में से कौन सा सिंटैक्स सही है?
Options:
- <style rel=”stylesheet” type=”text/css” href=”style.css”>
- <style> href=”style.css” </style>
- <link rel=”stylesheet” type=”text/css” href=”style.css”>
- <a href=”style.css” rel=”stylesheet” type=”text/css”>
- <style rel=”stylesheet” type=”text/css” href=”style.css”>
- <style> href=”style.css” </style>
- <link rel=”stylesheet” type=”text/css” href=”style.css”>
- <a href=”style.css” rel=”stylesheet” type=”text/css”>
Correct Answer: c)
Explanation:
To link an external stylesheet to an HTML file, the <link> tag is placed inside the <head> section: <link rel=”stylesheet” type=”text/css” href=”style.css”>. The <style> tag is used for internal CSS, while <a> tags are used for hyperlinks.
HTML फ़ाइल में बाहरी CSS स्टाइलशीट जोड़ने के लिए <head> सेक्शन के अंदर <link> टैग का उपयोग किया जाता है: <link rel=”stylesheet” type=”text/css” href=”style.css”>। <style> टैग का उपयोग आंतरिक CSS के लिए किया जाता है।