CSS INTRODUCTION

Unique beauty



CSS Introduction 

  • CSS is the acronym of “Cascading Style Sheets”. CSS is a computer language for laying out and structuring web pages (HTML or XML). This language contains coding elements and is composed of these “cascading style sheets” which are equally called CSS files.
  • It allows users to define how HTML content is displayed, making it easier to format and style web pages. 
  • CSS can manage various aspects of a webpage, such as text color, font styles, and paragraph spacing, among other things. 
  • While CSS is straightforward to learn, it offers powerful control over HTML documents. 

Who Is The Father Of CSS?

Hakon wium lie is know as father of CSS. CSS was proposed in 1994 as a web styling language, to solve some of the problems of Html 4.

What is CSS?

CSS stands for Cascading Style Sheets. CSS is utilized to style HTML elements. CSS is a commonly used language for web design. Together with HTML and JavaScript, CSS enables web designers to apply visual styles to HTML tags.


Selectors:

Target HTML elements to apply styles. For example, p { color: red; } changes all paragraph text to red.


Box Model:

Elements have margins, borders, padding, and content areas. Adjust these with properties like margin, border, padding.


Colors and Fonts:

Use color for text and background-color for backgrounds. Define fonts with font-family, font-size.


Layout:

 Use properties like display, position, flex, and grid to arrange elements.


Responsive Design:

Use media queries like @media (max-width: 600px) { ... } to adapt styles for different screen sizes.

Program:

<!DOCTYPE html>  
<html>  
<head>  
<style>  
h1 {  
  colorwhite;
  background-color: red;
  padding5px;
}
p {
  color: blue;
}
</style>  
</head>  
<body>
<h1>Hello Friends</h1>
<p>This is a paragraph.</p>
<body>
</html>

Output:




Why Do We Use CSS? 

CSS is a powerful language used to style and control the design of HTML documents, enhancing the appearance of webpages.

Program:

<!DOCTYPE html>  
<html>  
<head>  
<style>  
body {  
  background-color: Aqua;  
}  
h1 {  
  color: black;  
  text-align: center;  
}  
p {  
  font-family: Verdana, sans-serif;  
  font-size: 20px;  
}  
</style>  
</head>  
<body>  
<h1>HELLO FRIENDS</h1>  
<p>This is a paragraph.</p>  
</body>  
</html>

Output:




Three Types Of CSS:

  1. Inline CSS
  2. Internal CSS
  3. External CSS

Main Concepts Of CSS:

There are three main parts of CSS - selectors, properties, and values.

CSS Latest Version:

CSS3 is the most recent and currently used. It has XHTML specification.

Program:

<html>
<body>
<p style="color: #616aeb; font-size: 50px; font-style: italic; text-align: center;">Gocourse</p>
</body>
</html>

Output:





Tags
Our website uses cookies to enhance your experience. Learn More
Accept !

GocourseAI

close
send