Find the Best Cosmetic Hospitals

Explore trusted cosmetic hospitals and make a confident choice for your transformation.

“Invest in yourself — your confidence is always worth it.”

Explore Cosmetic Hospitals

Start your journey today — compare options in one place.

What is CSS and How does CSS works?

Introduction To CSS

CSS (Cascading Style Sheets) is used to style and layout web pages – for example, to change the font, color, size, and spacing of your content, break it into multiple columns, or animations And add other decorative features.

What is CSS?

CSS stands for Cascading Style Sheet. It is a style sheet language that is used for shaping the HTML sheet, which will be displayed on the web-page of browsers. CSS is a simple mechanism for describing the presentation semantics common to each page of a website. It can control the layout of the web page all over at once. Its latest version is CSS 3.

CSS Syntax

CSS is a rules-based language – you define rules that specify groups of styles that should be applied to particular elements or groups of elements on your web page. For example, “I want to show as the main title big red text on my page.”

Selector:- The selector indicates the HTML element or HTML tag you want to style. It is used more to select or select HTML elements based on their element name, id, class, attribute.

Property:- When we write something in the property, it indicates that it is a particular property, you have to apply to the selector, which is written as a selector.

Property-Value:- In property-value, we write what we want to assign.

EX:-

p {color: red; font-size: 22px;}

p {
   color: red;
   font-size: 22px;	
  }Code language: CSS (css)

There are three type of CSS? And how to work.

  • Inline style
  • Internal style sheet / Embedded style sheet
  • External style sheet

Inline styles

Inline-styles are CSS declarations that affect a single HTML element, which is contained within a style attribute. An implementation of inline style in an HTML document can be as follows:

The inline CSS style that will look like below code:

<h1 style="color: green;">DevOpsSchool</h1>
Code language: HTML, XML (xml)

Internal stylesheet

An internal stylesheet resides in an HTML document. To create an internal stylesheet, you place the CSS inside a <style> element inside the HTML <head>.

The internal CSS style that will look like below code:

<!DOCTYPE html>
<html>
  <head>
    <title> internal CSS </title>
    <style>
     h1 {
        color: green;
     } 
    </style>
  <head>
  <body>
    <h1">DevOpsSchool</h1>
  </body>
</html>Code language: HTML, XML (xml)

External stylesheet

An external stylesheet contains CSS in a separate file with the .css extension. CSS is the most common and useful way to get a document. You can do the same CSS file can add several web pages, all styled with a CSS stylesheet. To begin with CSS, we added an external stylesheet to our web page.

The external CSS style that will look like below code:

<style>
h1 {
   color: green;
}
</style>Code language: HTML, XML (xml)

Advantages of CSS:

  • Maintenance: It is easy to maintain, changing in one place will affect your web site globally. There is no need to change every specific location.
  • Time-saving: You can use any CSS script to easily reach many places.
  • Support: CSS makes the site faster and enhances the search engine capabilities to crawl web pages.
  • Native front-end: CSS has a huge list of features and functions that are helpful in designing HTML pages
  • Selectors: In CSS, there are many selectors (ID selectors, class selectors, etc.) that will be helpful in performing specific tasks.

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at <a href="https://www.cotocus.com/">Cotocus</a>. I share tech blog at <a href="https://www.devopsschool.com/">DevOps School</a>, travel stories at <a href="https://www.holidaylandmark.com/">Holiday Landmark</a>, stock market tips at <a href="https://www.stocksmantra.in/">Stocks Mantra</a>, health and fitness guidance at <a href="https://www.mymedicplus.com/">My Medic Plus</a>, product reviews at <a href="https://www.truereviewnow.com/">TrueReviewNow</a> , and SEO strategies at <a href="https://www.wizbrand.com/">Wizbrand.</a> Do you want to learn <a href="https://www.quantumuting.com/">Quantum Computing</a>? <strong>Please find my social handles as below;</strong> <a href="https://www.rajeshkumar.xyz/">Rajesh Kumar Personal Website</a> <a href="https://www.youtube.com/TheDevOpsSchool">Rajesh Kumar at YOUTUBE</a> <a href="https://www.instagram.com/rajeshkumarin">Rajesh Kumar at INSTAGRAM</a> <a href="https://x.com/RajeshKumarIn">Rajesh Kumar at X</a> <a href="https://www.facebook.com/RajeshKumarLog">Rajesh Kumar at FACEBOOK</a> <a href="https://www.linkedin.com/in/rajeshkumarin/">Rajesh Kumar at LINKEDIN</a> <a href="https://www.wizbrand.com/rajeshkumar">Rajesh Kumar at WIZBRAND</a> <a href="https://www.rajeshkumar.xyz/dailylogs">Rajesh Kumar DailyLogs</a>

Related Posts

What is CSS and use cases of CSS?

What is CSS? CSS stands for Cascading Style Sheets. It is a style sheet language used to define the presentation and layout of HTML documents. CSS allows…

Read More

Top 21 Firefox Addon every software engineers must know

Mozilla Firefox is a very popular browser, especially among web designers and developers. These days, with such a crowded field, staying at the top of the browser…

Read More

Top 50 interview questions and answers for CSS

CSS stands for cascading styles sheets. In short, CSS may be a style language that creates an internet site look a lot of appealing than simply plain…

Read More

How to add Media Query in your HTML Websites?

Media Query: A media query is a CSS technique introduced in CSS. A media query consists of the optional media type and zero or more expressions that…

Read More

CSS Tutorial for beginners (Step by Step) with Examples(Part3).

i. Universal Style Class It is a type of style class which is used by any element of the HTML document. Universal Style Class Starts with a…

Read More

CSS Tutorial for beginners (Step by Step) with Examples(Part2).

What is Internal Style Sheet? An internal style sheet is a set of style that is created as a part of an HTML document. An internal style…

Read More