How To Store CSS Definitions in External Files?
Submitted by: AdministratorIf you want to share a set of CSS definitions with multiple HTML documents, you should those CSS definitions in an external file, and link it to those HTML documents using the LINK tag in the HEAD tag as:
<HEAD>
...
<LINK REL=stylesheet TYPE="text/css" HREF="css_file_url"/>
...
</HEAD>
Below is a CSS file called, GlobalGuideLine.css, that stores the same CSS definitions used in the previous exercise:
BODY {background-color: black}
P {color: yellow}
If you modify the HTML document with the LINK tag instead of the STYLE tag, you can get the same result:
<html><head>
<title>CSS Linked</title>
<link rel=stylesheet type="text/css" href="GlobalGuideLine.css"/>
</head><body>
<p>Welcome to GlobalGuideLine.com.
You should see this text in yellow on black background.</p>
</body></html>
Submitted by: Administrator
<HEAD>
...
<LINK REL=stylesheet TYPE="text/css" HREF="css_file_url"/>
...
</HEAD>
Below is a CSS file called, GlobalGuideLine.css, that stores the same CSS definitions used in the previous exercise:
BODY {background-color: black}
P {color: yellow}
If you modify the HTML document with the LINK tag instead of the STYLE tag, you can get the same result:
<html><head>
<title>CSS Linked</title>
<link rel=stylesheet type="text/css" href="GlobalGuideLine.css"/>
</head><body>
<p>Welcome to GlobalGuideLine.com.
You should see this text in yellow on black background.</p>
</body></html>
Submitted by: Administrator
Read Online Cascading Style Sheet CSS Job Interview Questions And Answers
Top Cascading Style Sheet CSS Questions
☺ | How To Use IDs to Override Classes in CSS? |
☺ | What Are the Formatting Behaviors of HTML Elements? |
☺ | What Is a ID Selector in CSS? |
☺ | What Is a Mixed Selector in CSS? |
☺ | What Is CSS (Cascading Style Sheets)? |
Top Top World Wide Web Categories
☺ | Cascading Style Sheet CSS Interview Questions. |
☺ | HTML5 Interview Questions. |
☺ | Basic Internet Interview Questions. |
☺ | Domain Name System (DNS) Interview Questions. |
☺ | JavaScript Interview Questions. |