CSS
Cascading Style Sheet (CSS) is to to format the webpage. It describes how the HTML elements are displayed in a webpage. Its flexibility and cascading nature make it a powerful tool for creating visually appealing and responsive user interfaces.
Linking CSS to HTML:
- Inline:
<div style="property: value;">Content</div>
- Internal:
<style> /* CSS code */ </style>
within the HTML file. - External: Link an external CSS file using
<link rel="stylesheet" type="text/css" href="styles.css"
>
Key Concepts
Selectors
- Selectors target HTML elements to apply styling.
- element, universal selector (*), id name(#<id name>), class name(.<class name>)
- Examples:
div
,.class
,#id
,:hover
. Properties
- Properties define the style to be applied.
- Examples:
color
,font-size
,margin
. Values
- Values specify the setting for a property.
- Examples:
#0000FF
(color),16px
(font size),10px 20px
(margin). Box Model
- The box model describes the layout of elements, including content, padding, border, and margin.
Selectors and Combinators
- CSS allows complex selections using combinators like space,
>
,+
, and~
.
SASS also known as Syntactically Awesome Style Sheets, is a preprocessor scripting language that is interpreted or compiled into CSS. SASS offers features such as variables, mixins, and nested rules, which can help streamline the process of writing and maintaining CSS code.
Comments
Post a Comment