CSS Course Hindi - Beginner to Pro ( 2023 ) | Chapter 3
Notes
Pseudo-classes
To access different state of element. we use pseudo classes
To access hover state we use
:hover
selectorsimilarly for active state we use
:active
selectorHeight & Width
The CSS
height
and width
properties are used to set the height and width of an element.example
<style> div { height: 200px; width: 400px; background-color: red; } </style> <div> 400 X 200 </div>
height and width unit you should know:
height: 100vh
/ width: 100vw
, vh & vw will take full height or full width of page according to screen size;height: 100%
/ width: 50%
, % will take height and width according to parent elementsNote : Fixed Height & Width is very practice height:100px, width:200px;
when you will make website responsive fixed height and width is hurt you most.
try to use max-height or max-width
max-width :400px
→ max-width means element will maximum take only 400px if you will increase screen size it will stay at 400px. but if you will shrink screen size it will reduce fixed 400px to parent element width; max-height
will also act same. and min-height & min-width will act opposite to max-height and min-width respectively. look at below image max-width provide. due that container size fixed on large device
Box Model
Box Model is help you analyse how much space your element taking on page.
if you are not sure about your layout then box model will help you visualise your element.
Text
We will look various properties of text→
color: blue
→ it will apply colour to text;
For Text Horizontal Alignment
text-align: center,left,right
→ horizontal alignment of text according to parent elements
text-align:justify;
→ this property will optimise text and spread according to container width.
For Text Vertical Alignment
img.a { vertical-align: baseline; } img.b { vertical-align: text-top; } img.c { vertical-align: text-bottom; } img.d { vertical-align: sub; } img.e { vertical-align: super; }
We Can also change direction of text
p { direction: rtl; unicode-bidi: bidi-override; }
Text Decoration
h1 { text-decoration: overline; } h2 { text-decoration: line-through; } h3 { text-decoration: underline; } p.ex { text-decoration: overline underline; } <h1>Overline text decoration</h1> <h2>Line-through text decoration</h2> <h3>Underline text decoration</h3> <p class="ex">Overline and underline text decoration.</p>
Text Transformation
text-transform: lowercase uppercase capitalize;
Text Spacing Properties
text-indent
- Provide Space before any text
letter-spacing
- spacing between letters
line-height
- height of text
word-spacing
- spacing between words
white-space: wrap,nowrap;
You can also apply text shadow
text-shadow:2px 2px rgba(0,0,0,0.5)
Exercises
CSS Course / Tutorials in Hindi 2023 - CSS 2023 | CSS Tutorials in Hindi Chapter 3 Learn CSS by doing practice question. Video Chapters 00:00 3.1 Introduction 00:39 3.2 Pseudo Classes 04:50 3.3 Height & Width 13:34 3.4 Box Model 16:56 3.5 Text 27:43 3.6 Questions 36:51 3.7 Solutions Notion Notes - https://alkaline-olivine-4e5.notion.site/Chapter-3-c2ae08780db74a689eaf9adc73886a22 Github Repo - https://github.com/anshuopinion/CSS-Course Linkedin - https://linkedin.com/in/anshuopinion Telegram Channel - https://telegram.me/dosomecodinghelp Instagram - https://instagram.com/dosomecoding Github - https://github.com/anshuopinion