- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to import styles from another style sheet in CSS
To import styles from another style, use the @import rule. It should appear right at the start of the style sheet before any of the rules, and its value is a URL.
You can write it like this
<style> <!-- @import "mystyle.css"; or @import url("mystyle.css"); .......other CSS rules ..... --> </style>
The significance of the @import rule is that it allows you to develop your style sheets with a modular approach. You can create various style sheets and then include them wherever you need them.
- How to use inline CSS (Style Sheet) in HTML?
- How to use internal CSS (Style Sheet) in HTML?
- Rules to override Style Sheet Rule in CSS
- How to use Style Sheet in HTML?
- How to import classes from within another directory/package in Java?
- Indicate what character set the style sheet written in with CSS
- How to add comments in the style sheet blocks
- Standard Link Styles in CSS
- Add different styles to hyperlinks using CSS
- How to style images with CSS?
- How to style labels with CSS?
- Usage of CSS @import: rule
- The @import At-rules in CSS
- How to style outline buttons with CSS?