OnlineCBT Logo OnlineCBT
CSS Tutorial
CSS · LESSON 1

Introduction to CSS and Web Styling

By Ratan Updated: 15 Oct 2026

Learn the role of CSS in web design and how styles transform plain HTML.

Level: Beginner to Advanced
Duration: ~60 Mins Deep-Dive

Give structure a visual presentation

HTML describes content and meaning. CSS controls presentation: color, spacing, typography and layout. A useful stylesheet makes the page easier to read and use; it should not be required to understand the content's basic order.

First styling experiment


Learn CSS

Build one readable component before styling a whole page.

Place the style element in your document's head and the article in its body. The article should appear as a centred card on a wide screen. max-width limits long lines without forcing a fixed width on a narrow screen. Padding creates internal breathing room; margin separates the card from surrounding content.

How to inspect a rule

Open browser developer tools, select the article and inspect its Styles and Computed panels. Toggle padding off: the border moves closer to the text. Change the background to a different color. A crossed-out declaration usually lost in the cascade; an invalid declaration may be ignored.

Do not lose semantics

A large font does not turn a paragraph into a heading. A styled span does not provide the behavior of a button. Keep semantic HTML and keyboard-operable controls, then use CSS to support them. Never convey an error by red color alone; include an explanatory message.

Practice

  1. Change the maximum width to 24rem and observe line wrapping.
  2. Remove border-radius and compare the shape.
  3. Zoom the page to 200% and confirm the text remains readable without clipping.
  4. Explain which property affects internal spacing. Answer: padding.

हिन्दी संकेत: पहले readable HTML बनाएं, फिर CSS से spacing और layout सुधारें।

📝 Live Lesson Practice

HTML/CSS JavaScript Python C++ C PHP
⌨️ Practice Inputs (लाइव इनपुट भरें) (खाली होने पर RED, भरने पर GREEN underline)
💻 Code Editor (Monaco VS Code Engine)
👀 Live Preview
Address Contact

+91 7877547686

E-mail

onlinecbtportal@gmail.com

Helpline Number

+91 7877547686


Click To Download
Get it on Google Play

ऐप डाउनलोड करने
के लिए Google Play पर
उपलब्ध है

WhatsApp Chat