Text Properties
Selectors
there are some other ways to select the content:
- Descendent Selector
space between two selectors create descendent selectors
here p .para is the descendent selector which will select .para class inside p2.The Adjacent & Direct-Descendent Selectors
Direct descendent are selected by > sign so in above ex all p with tick sign are direct descendents but one with cross sign comes under another div
3.Attribute Selector
4.Psuedo Class Selector
Pseudo Elements
1.::first-letter
2.::first-line
3.::selection
4.::after
Box Model
Display Property
1.Inline
2.Block
CSS UNITS
1.Absolute Unit
2.Relative Unit
- Percentage
- em
- rem
Position Property
Notice middle element space is taken over by adjacent
Transition
Introduction
- Dont use transition all,use it seperatly
- Generally use the transition time of .5s or 1s
- There is one website called easing.net here youcan select transition timing function like ease-in,go visit website you will understand
Transform
What is flexBox
it is a one dimensional layout method used to laying our items in rows and columns.The basic properties of flexbox which i know are
- display:flex;
- flex-direction
- justify-content
- align-items
- flex-wrap
- align-self
Align Content
if we have many rows and columns with flex-wrap as wrap and we have to control the space between rows and column then align-content is used with properties center,flex-start,flex-end,space between etc.before align-content we have this structure
Flex-sizing Properties
Media Queries
CSS Grid
It is a 2 dimensional way to create the layout for the web pages
Grid Template colomn
It divide the items inside the container into desired columns
HTML
CSS
Output
Other ways to write grid template column are:
grid-template-column:300px 100px 100px;
grid-template-column:1fr 4fr 1fr;
grid-template-column:300px auto 200px;
Grid Template rows(Not used much)
It is same as grid-template-column but it will generally define rows.Here is the code
grid-template-rows:1fr 2fr 2fr;
this will create three rows with the above fraction and if there is extra row then it will be 1fr.
Grid Gap
As we have done coding and used grid gap so many times so want to share that you can give row and column gap seperatly ex
grid-row-gap:1rem;,grid-column-gap:5rem;
You can clearly notice that column have more gap than row
Spanning Of Grid(Very Important)
So i will tell you the trick which i understoood after practicing few times.So first count how many divs are in container and then divide it equally with grid-template-column ex if 4 div then grid-template-column:repeat(4,1fr); then with individual box do the spanning.Here is the example to make you understand.
Above is html
As you can see above in css file that div is divided into 4 equal parts
Currently the output is like above divided 4 equal divs.Now here comes the magicNow here is the important thing that create confusion when you count the span then you count the box or column whatever you want to say but when you count starting point then you count the border of the box ex in .box:nth-of-type(2) in above figure two columns are merged bcoz of first box span 2 so it will start from 3 border(imagine in your mind when two boxes are merged what will be the count of second box right border) Hope You get the point,Now one more thing at this point if you comment grid-template-column also there will be no effect and for responsiveness you need media query
Note-You can study auto-fit min-max() in harry course if you dont want to use media query for responsiveness.but if your layout is quite critical then it will disturb your layout better to use it when you have equal distribution of columns.
Grid Template Area
if you want to achieve the above layout then it can be done easily with the help of grid-template-areas plz see the code below
Here we define the grid area of each box and then use that name in grid-template-area .It is just this simple and for responsiveness you can again declare grid-templates-area in media query
What is bootstrap
bootstrap is a css framework used to design our website.It basically consists of two elements.
1.Components-components consist of buttons,badge,nav etc that can be useful to add in our website.
2.Grid System-it is used to design layout of our website which makes our website very responsive.
Important Component
- Container & Container-fluid
- buttons-There color is just the label dont focus on color you can modify it focus on label like primary,success,danger etc
- badge
- Nav
Typography
- Display-1/2/3/4-Display-1 class is used to display heading at slighly large size and different style.
- lead->it can be used for lead text of the page.Font size is greater and font-weight is extra.
- BlockQuote->It is used for quotation purposes
- BlockQuote-Footer->Here the name of the author will come
Here 12 units of row is divided into 3 columns of unit 2,6 and 4 with syntax col-2,col-6,col-4
Comments
Post a Comment