-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCSSTutorials.txt
More file actions
641 lines (368 loc) · 17.1 KB
/
Copy pathCSSTutorials.txt
File metadata and controls
641 lines (368 loc) · 17.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
CSS TUTORIALS
cascading style sheet
CSS three approaches
1 - internal
2 - external
3 - inline
tagname
byclassname
byid
universal *
color
background-color
height
width
min-width
max-width
min-height
max-height.....
border-width: specify
border-style: specific styles
border-color: specify
Shorthand: border: width style color;
outline-width: specify
outline-style: specific styles
outline-color: specify
outline-offset: specify
Shorthand: outline: width style color;
internal spacing..
padding-top:
padding-right:
padding-left:
padding-bottom:
Shorthand:
padding: top left bottom right
padding: 20px;
padding : top-bottom right-left;
margin-top:
margin-right:
margin-left:
margin-bottom:
Shorthand:
margin: top left bottpm right
margin: 20px;
margin : top-bottom , right-left;
margin : 10px auto; for center but use with width.
box-sizing : values border-box , content-box;
by default content-box;
over-flow: values hidden , scroll , auto , visible
over-flow-x: values hidden , scroll , auto , visible
over-flow-y: values hidden , scroll , auto , visible
border-top-left-radius:
border-top-right-radius:
border-bottom-right-radius:
border-bottom-left-radius:
border-radius: top-left top-rigth bottom-right bottom-left;
box-shadow: x-offset y-offset blur spread color;
Float is use for making gallery and use for floating the div.
float values right , left
Clear Property use for clearing float property on sibling elements..
clear values : right , left , both;
Front -end website
Font properties..
font-size:
font-family:
font-weight:
font-style:
font-variant: ;
line-height: ;
Text-Formating Properties..
text-align : values : left , right , justify , center
text-align-last : values : left , right , justify , center , auto.
text-transform : uppercase , lowercase , capatlize , none .
text-indent : specify in px. it is only use for first line.
word-spacing : specify in px.
letter-spacing : specify in px.
-----------------
text-decoration.
text-decoration-line: underline , overline , line-through , none;
text-decoration-color: any color.
text-decoration-style: solid , dotted , dashed , double , wavy.
Short-Hand text-decoration: line color style;
syntax: text-decoration : underline red dotted.
text-shadow : x-offset y-offset blur color;
List Style:
list-style-type: disc , square , circle , none;
list-style-position
list-style-image: url;
ShortHand : list-style : image position type;
syntax: list-style-none;
==============================================================================================
Display : values : none , inline , block , inline-block..
Visibility: valus : visible , hidden.
display vs visibility...
=========================================================================
Position : static , relative , absolute , fixed , sticky.
but it all use with helper property : left , right , top , bottom..
z-index: it is use with multiple divs because it work on z-axis...
===========================================================================
Background Image::
background-image: url();
background-repeat: repeat , no-repeat , repeat-x , repeat-y , space , round(stretch image).
background-position: x , y ; example : left top and center center.
you can give own values in px and %.
Short-hand : background-image background-repeat background-position.
background-attachment : values : scroll , fixed.
background-size : auto , length(px or % ) cover , contain (try to adjust).
background-origin: values padding-box , border-box(default) , content-box.
background-clip :
values : padding-box , border-box(default) , content-box , text(new).
text work on bg image on text with color transparent.
background-gradient:
Background-Gradient types:
1) liner gradient
2) radial gradients
3) repeating linear gradient
4) repeating radia gradient
1) Linear Gradient: top to bottom , left to right , right to left , bottom to top.
syntax: linear-gradient(direction , color1 , color2);
we should give multiple colors..
Like : (to bottom left , green , blue).
we should give in degree.
(60deg , orange , yellow);
2) Radial Gradient: center , right bottom , left bottm, left top.
radial-gradient(green,blue)
more properties use with percntage.
================================================================================================================================================
opacity : it is use for the transparent of the any thing. rgba() vs opacity.
it's value between 0 to 1.
Cursor : it is the mouse cursor property..
CSS Units: px , % , em , rem , vh , vw..'
Absoulte Units
cm
px
relative units.
100%
Variable Make in CSS.
:root{
--color : blue;
}
p{
color : var(--color);
}
================================================================================================================================
calc function for calculations
clip-path ..for making shapes. values circle , ellipse , inset , polygon
circle( size at x-axis y-axis)
ellipse( x-size y-size at x-axis y-axis)
inset for taking internal part (top right bottom left)
polygon for making shapes if have three points (x1 y1 , x2 y2 , x3 y3);
shape outside for nonspacing for clip path: value same clip-path;
shape-margin use in shapeoutside; in pixels.
Filter for apply on images .. values none, blur(),brightness(),constrast(),drop-shadow(),grayscale(),hue-rotate(),invert(),opacity(), saturate() ,sepia() , url()
transition-property values : width , border-radius and so ... , all;
transition-duration values : numbers in seconds or miliseconds;
transition-delay values : numbers in seconds or time units;
transition-timing-function: ease , linear , ease-in , ease-out , ease-in-out , step-start , step-end , steps(6,start) , cubic-bezier(0.3,0.8,1,0.5)
Short Hand : transition values : T-P , T-Duration , T-T-F , T-Delay;
----------------------------------------------------
CSS Transform
there are two tranform type in CSS. 2D and 3D.
transform-origin: left top;
CSS Transform 2D values:
rotate(angle); use for rotate any element. like rotateZ(angle);
translate(x,y); use for place change any element with x,y. like translate(50%,50%);
translateX(x); use for place change any element but in X. like translateX(50px);
translateY(y); use for place change any element but in Y like translateY(100px);
scale(x,y); use for 2x or 3x of widht and height like scale(2,2)
scaleX(x); use for 2x or 3x of widht like scaleX(2)
scaleY(y); use for 2x or 3x of height like scaleY(2)
skew(x-deg,y-deg); use for change the angle of x point and y point.
skewX(x-deg); use for change the angle of x point.
skewY(y-deg); use for change the angle of y point.
none;
CSS Transform 3D values:
rotateX(angle); use for rotate any element on x-axis. like rotateX(angle);
rotateY(angle); use for rotate any element on y-axis. like rotateY(angle);
rotateZ(angle); use for rotate any element on z-axis. like rotateZ(angle);
rotate3d(x,y,z,angle); use for rotate any element on three axis. like rotate3d(3,4,3,deg);
translateZ(z); use for place change any element with z. like translateZ(100px);
translate3d(x,y,z); use for place change any element on three axis. like translate3d(50px,40px,10px);
scale3d(x,y,z); use for 2x or 3x of widht and height like scale(2,2,3);
scaleZ(z); use for 2x or 3x scaleZ(2);
perspective(n); perspective depend on view like perspective(800px);
CSS perspective property.
it is depend on view that is compulsory use for 3D transform;
Example: perspective: 1000px;
CSS Transform-style:
it is use to 3D transform for view the backend of 3D divs.
it has two values: flat , preserve-3d;
flat is by default value;
perserve-3d is for view 3D form.
Backface Visibility : values visible , hidden.
.
this property like visibility but this use for backface..
use for see back of cards.
CSS Selectors:
1)Simple Selectors
Type selector by tag name
Class selector by class name .
ID selector by id name with #
Universal Selector *
2)Combinator Selectors
Descendent selectors:
Target all tags in any specific tag.
Example: .div p{ props... }
Example: p span{ props... }
Direct Child Selectors:
Target direct tags in any specific tag.
Example: ul > li{ props... }
Example: #div > p{ props... }
Adjacent Sibling Selectors:
Target sibling tag but only first tag target.
Example: div + p{ props... }
Example: ul + p{ props... }
General Sibling Selectors:
Target sibling tags all but after specific tag.
Example: div ~ p{ props... }
Example: ul ~ p{ props... }
3)Attribute Selector:
Styling tags but only specific attribute.
A[attribute]
Styling on specific attribute.
Example: input[type]
img[alt]
A[attribute=value]
Styling on attribute but specific or exact values.
Example: input[type='text']
img[alt='cat']
A[attribute^=value]
Styling on begins with value.
Example: img[alt^='cat']
A[attribute|=value]
Styling on attribute begins with value with dash separated.
Example: img[alt|='cat']
A[attribute$=value]
Styling on attribute ends with value.
Example: img[alt$='cat']
A[attribute*=value]
Styling on attribute any where in the value.
Example: img[alt*='cat']
A[attribute~=value]
Styling on attribute value with separated with spaces.
Example: img[alt~='cat']
Pseudo Classes:
:hover important
:active
:link
:visit
:focus imporatant
:root important
:nth-child important
:checked important
pseudo Elements
::placeholder
::first-line
::first-letter
::selection
::before
::after
Animation in CSS..
animation-name: give name .
animation-duration: in seconds
animation-timing-function: same functions like transition.
animatin-delay:
animation-iteration-count: times and count
animation-direction: values: alternate , normal , reverse , alternate-reverse; (it is need count)
animation-fill-mode: none , forwards(it does not come at 0% state) , backwards(fill delay time at 0%) , both.
animation-play-state: paused , running; it is work on hover or other pseudo class.
ShortHand : animation : name duration count direction;
Syntax:
@keyframes animationname{
from{}
to{}
0%{}
30%{}
50%{}
100%{}
}
User-select: it is use for privacy a copy content..
user-select: values : auto , none , text , all.
ScrollBar styling.
scrollbar pseudo elements use with prefix (non standard).
::scrollbar{} the entire scrollbar:
with prefix ::-webkit-::scrollbar{}
::scrollbar-thumb {} the draggable scrolling handle.
with prefix ::-webkit-::scrollbar-thumb{}
::scrollbar-track{} the track (progress bar) of the scrollbar, where there is a gray bar on top of a white bar.
with prefix ::-webkit-::scrollbar-track{}
::scrollbar-corner{} the bottom corner of the scrollbar, where both horizontal and vertical scrollbars meet.
This is often the bottom-right corner of the browser window.
with prefix ::-webkit-::scrollbar-corner{}
Discuss !important Hack..
Priority level..
Filter for apply on images .. values none, blur(),brightness(),constrast(),drop-shadow(),grayscale(),hue-rotate(),invert(),opacity(), saturate() ,sepia() , url()
Discuss Backdrop-filter: The backdrop-filter property in CSS is used to apply filter effects (grayscale,contrast,blur, etc) to the background/backdrop of an element
backdrop-filter : values none, blur(),brightness(),constrast(),drop-shadow(),grayscale(),hue-rotate(),invert(),opacity(), saturate() ,sepia();
most use value is blur ...
-----------------------------------------------------------------------------------------------------------------------------------------------------------
dicuss Grid system..
In css we have grid system that is use look like a float.
it is two dimensional grid system.
but we learn flexbox.
it is one dimensional..
first me we use display : flex property on parent or main class(container).
we have properties to use flexbox..
this all properties use for flex box. all properties use in parent class except two or something.
1) flex-direction:
2) flex-wrap:
3) flex-flow:
4) justify-content:
5) align-items:
6) align-content:
7) align-self:
8) order:
9) flex-grow:
10) flex-basis:
11) flex-shrink:
12) flex:
Firts of fall discuss display property with flex value.
1) flex-direction:
values: row (default), row-reverse(it is use for reverse childs) , column , column-reverse.
2) flex-wrap:
values : nowrap (default) , wrap (use for prevent overflow) , wrap-reverse ((use for prevent overflow but in reverse).
3) flex-flow: it is the shorthand of flex-direction and flex-wrap
syntax: flex-flow: flex-direction flex-wrap;
4) justify-content: it the horizontal alignment.
justify-content: center , flex-start , flex-end , space-around(equal spaces end but in center 2x) , space-between (first and last at the end) , space-evenly(equal spaces).
5) align-items: it is the vertical alignment. (it is use for single row but also work on two or more lines).
align-items : values : flex-start , flex-end , center , stretch (default value), basline (is is align on font-size).
6) align-content: it is also the vertical alignment. (it is use for mutliple rows with flex-wrap (width-specific))
align-content : values : flex-start , flex-end , space-around(equal spaces end but in center 2x) , space-between (first and last at the end) , space-evenly(equal spaces).
7) align-self: it is the vertical alignment. (but in specific item) or indivisual item.
align-items : values : auto , flex-start , flex-end , center , stretch (default value), basline (is is align on font-size) .
8) order: giver property in indivisual item to set a item order. its default value (0).
but we give -1 it will be at 1st postion. and so on .. -2 , -3
9) flex-grow : it is work on child(common class) class or individual class. expend width
The flex-grow property specifies how much the item will grow relative to the rest of the flexible items inside the same container.
syntax: flex-grow: 0 , 1 , 2;
10) flex-basis: it is for give width child divs for responsive. It's value in px or %. it is also like max-width.
11) flex-shrink: it is use for responsive width.. but dismiss the flex-wrap.
flex-shrink: 1; 1 is default value
1 , 2, 3..
12) flex : The flex property sets the flexible length on flexible items.
The flex property is a shorthand property for:
flex-grow
flex-shrink
flex-basis
Syntax : flex : grow , shrink , basis;
Media Query for Creating A responsive Website..
Media types.
All
print
screen it is only works.
speech
CSS Logical Operator.
And
Not
Only.
breakpoint
Syntax: @media screen and (max-width: 100px){
do css any divs..
}
font awesome : for icons
google fonts : for font family
cssmatics : for box-shadow
cubic-bezier : for transition
uigradients : for background-linear.
icon finder : for icons