Skip to main content

Posts

Showing posts with the label Types of CSS

TYPES OF CSS

We can write a CSS 3 ways in HTML  ðŸ‘‰ Inline CSS: Description: Applied directly within HTML tags using the style attribute. Use Case: Ideal for small-scale styling adjustments on specific elements. Example:          <p style="color:blue; font-size 16px;"> This is Inline css </p>   ðŸ‘‰Internal or Embedded CSS: Description: Placed within the <style> tags in the HTML <head> section. Use Case: Suited for styling a specific webpage; allows for a balance between specificity and reusability. Example: <head> <style> h1{color:green;} p{font-size: 16px;} </style> </head>  ðŸ‘‰External CSS: Description: Defined in a separate CSS file and linked to HTML using the <link> tag. Use Case: Promotes reusability across multiple pages; facilitates a centralized approach to styling. Example (HTML): <head> <link rel="stylesheet" type="text/css" href="style.css"> </head>

TYPE OF HTML CSS

 Types of HTML CSS To change a HTML documents style Three Types to Add CSS in HTML 1.      Inline CSS: To using by <p style> change a style of HTML Attribute.      2.     Internal CSS: by using <style> tag in the below of <head> tag.           3.    External CSS : By using <link> element in link to external CSS file. INLINE CSS We use inline CSS in a line      Example : <p style=“color:green;”> Green Text </p> Here we use inline css… INTERNAL CSS In this section we use Internal CSS.      We use <style> element under the <head> section. Example:           <style>                 p {color:green ;}                      </style> EXTERNAL CSS External CSS create a new file in sublime text and save with filename.css extention. Link with your css file code in below <link rel=“stylesheet” href=“filename.css”> This code also write on under <head> tag....