$100 Website Offer

Get your personal website + domain for just $100.

Limited Time Offer!

Claim Your Website Now

CSS (CASCADING STYLE SHEETS)

What is CSS?

CSS is a language used to style a web page. It describes how HTML pages should displayed on media or websites.

What are the uses of CSS?

CSS is used to define the styles for your web pages , including deisgns, layout variations, colors, variations etc.

CSS sytnax:

  • A css syntax csonsists of two blocks declaration block and selector block.
  • selector block points to the html you want to design or style
  • The declaration block contains one or more declarations separated by semicolons. Each declaration includes a CSS property name and a value, separated by a colon.

p {
  color: red;
  text-align: center;
}

In this code p is selector part which indicates the html element to style. and color and text-align are property. red and cente are property value.

CSS Selectors: These are used to find the HTML elements to style.

Simple selectors: Selects based on id, class

  • id selector: The id selector uses the id attribute of an HTML element to select a specific element. To select an element with a specific id, write a hash (#) character, followed by the id of the element.
  • Class Selector: The class selector selects HTML elements with a specific class attribute. To select elements with a specific class, write a period (.) character, followed by the class name.
SelectorExampleExample description
#id#firstnameSelects the element with id= “first name”
.class.introSelects all elements with class=”intro”
element.classp.introSelects only <p> elements with class=”intro”
**Selects all elements
elementpSelects all <p> elements
element.elementdiv, pSelects all <div> elements and all <p> elements

How to add CSS?

There are 3 ways to add CSS

  1. External CSS: With an external css we change the look of the website with changing one file. External CSS are defined inside the <link> tag.
  2. Internal CSS: An internal style sheet may be used if one single HTML page has a unique style. The internal style is defined inside the <style> element, inside the head section.
  3. Inline CSS: An inline style may be used to apply a unique style for a single element. To use inline styles, add the style attribute to the relevant element. The style attribute can contain any CSS property.

CSS Comments: Comments are used to explain the code. These are used for later purpose to correct the source code. These comments are given inside the <style> attribute and starts with /* and ends with */.

CSS Borders:

CSS Borders allow to specify the style, width and color of the elements border

  • dotted- Defines a dotted border
  • dashed – Defines a dashed border
  • solid – Defines a solid border
  • double – Defines a double border
  •  groove- Defines a 3D grooved border. The effect depends on the border-color value
  • ridge – Defines a 3D ridged border. The effect depends on the border-color value
  • inset – Defines a 3D inset border. The effect depends on the border-color value
  • outset – Defines a 3D outset border. The effect depends on the border-color value
  • none – Defines no border
  • hidden – Defines a hidden border

Related Posts

WordPress Website Development: The Small Business Growth Guide

Introduction: The Digital Front Door for Small Businesses For a small business, a website serves as the primary storefront, customer service desk, sales representative, and trust anchor….

Read More

Why CMS-Based Websites Are Useful for Growing Businesses: The Complete Strategy Guide

Introduction: The Digital Engine of Business Growth A modern company’s website is its primary storefront, lead generation engine, customer support portal, and brand foundation. When prospective clients…

Read More

Navigating Legal Care in India: How to Evaluate Advocates, Practice Areas, and Consultations

Introduction Facing a legal question, business compliance issue, or court dispute can feel overwhelming. Whether you are dealing with a property transaction, a family dispute, an employment…

Read More

Navigating International Dental Care: How to Evaluate Hospitals, Dentists, and Treatment Abroad

Introduction Choosing a dental provider is one of the most critical health decisions a person can make, especially when considering travel outside one’s home country. Today, millions…

Read More

Navigating Modern Indian Taxation, Business Compliance, and Strategic Financial Advisory

Introduction Managing personal finances, scaling a startup, or running an established corporate enterprise in India requires strict adherence to an evolving regulatory landscape. From seasonal tax updates…

Read More

Navigating the Modern Event Ecosystem: Event Discovery, Digital Ticketing, and Management in Bangalore

Introduction Bangalore—often celebrated as India’s Silicon Valley and cultural melting pot—pulses with non-stop energy. On any given day, thousands of working professionals, students, creators, startup founders, and…

Read More
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x