CSS Notes
CSS Notes
Class selector
Universal selector
If we apply different classes on same tag preference given to last given class, inline styling have most preference.
CSS Units
CSS Properities
color
font-size
font-weight
text-transform
text-decoration
text -indent
line-height
word spacing
letter spacing
font family
font google
font awesome
text-shadow
white space
verticle-align
font -size
font-size: vw
font-variant
div tag
Layout Portion of website:
Header, footer, Menu Bar, Google add
Div Tag: To make portion in web page we use div tag, without div we can not make portion inside the web page.
Default width of div tag is 100%, to make portion we have to specify the width and also first left position is default
position.
<div id="aa"></div>
to make portion use html portions inside the div
CSS Properity
comment
float
Margin
Padding
Border size
border color
border Radius
over flow
Hover
Box shadow
Url
Backgroud-repeat
Background cover
position absolute
span
Opacity
z-index
Url
Background-position
background-attachement
background
Background-clip
Background -size
Background-contain
Background-origin
Border-blend mode
margin collaspe
Max width
outline
icon
link
list -style-image
list -style-position
list-style
Table
Transistion
Transform
Animation
Clearfix
Display
Transform
Combinator
Pseudo Class
Matric 2d
Filter image
transform:scaleX(-1)
object-fit: cover;
resize
out-line offset
var()
flex
max-width
media queries
Describe the style of html, how to display on screen,paper or media.
CSS control multiple webpage all at once
Description Represented by
when we apply style by tag name p,ul,ol
If we want to make something unique we use id and class selectors, practically there is # (hash)
difference between id and class, practically in output-wise no difference but normally for
group styling we use class and for specifically styling we use id.
. (dot)
use where we want same styling to all the tags * (star)
classes on same tag preference given to last given class, inline styling have most preference.
d class
e between characters when assigning the name
haracter
ead
cm,in,mm,%, em,px
Description
For color of text
cm/in/mm/px/em
same as bold,here we increase px wise increase sixe
Capital/lowercase/uppercase text
overline/underline/through/none line, line adopt same color as text
give start space to only first line
spacing between lines
spacing between words
spacing between characters
select the font calibri, time roman, arial etc.
if we want ot select icon we use image tag,but professionally we use font awesome
font awesome.com---> email---.verify--> select icon link paste in head--.cheatsheet
for font awesome we use I tag
<I class="fa-fa-icon name fa:4x;>
div tag
ebsite:
u Bar, Google add
tion in web page we use div tag, without div we can not make portion inside the web page.
tag is 100%, to make portion we have to specify the width and also first left position is default
Description
*/----*/
forcefully assign the first left empty space in web page
float( left, rigth, center, none infered)
Specify the spacing in outer boundry
Margin (left, right, Top, bottom) we gaive give foure location at a time (Tpx, Rpx, Bpx, Lpx)
value move clockwise.
if we assign margin to to div then priority given to higher px value of direction
Specify the spacing in inner boundry of an element
properties same work as margin
padding: 25px 50px; (top and bottom 25px, left and right 50px)
padding: 25px ; (top, right,bottom, left same value 25px)
size of border
color of border (by default black color)
radius of border, values in %
in web page we make the border /page width in % and assign the value of height auto if
the height is fixed then text can come out of border called overflow
to control over flow value is overflow:hidden, also make border height auto
use to zoom, color, size the object when we scroll the mouse at the point
Background-image:url ("image.jpg");
Make background image inside the box , of web page, also used in hover
background-sixe:covered
to adjust the picture inside the box as per assign width and height
position:absolute: the box we remain in to left position
to write text in background of image we use span command and then use padding
properity to move text inside the image.
z-index:1;
value =1 or -1,
1 move box downside of other box
-1 move upside of other
Background-image:url ("image.jpg");
Make background image inside the box , of web page.
position the left, right ,top left, top right ect
image scroll are fixed with web page, when we scroll down the web page.
background: #ffffff url("img_tree.png") no-repeat right top;
apply all properity in once
auto:
200px: one value syntax set the width, height is auto.(normally as per width)
200px 200px: two value syntax describe the width and height of image
resize the image, so it is fully visible
image start from upper left corner
border, padding, initial, content
only for top and bottom select highest value between two
The problem with the <div> above occurs when the browser window is smaller than the
width of the element (500px). The browser then adds a horizontal scrollbar to the page.
Using max-width instead, in this situation, will improve the browser's handling of small
windows.
Improve browser handling
<a>
a:link (unvisited link)
a:visited(visited link)
a:hover
a:active
rules: hovers comes after visited and unvisited and active comes after hover
add image in list style
position of bullet inside or outside the table/list item.
Inside option make bullet as a part of text
all properities in one declaration
border:size properity: if this apply border outside the table: (table, th, td,tr) where you
want border.
Height & width,
horizontal align: left/right center content align (text-align:center)
verticle align: top bottom content align (verticle-align)
padding
horizontal: (not border only horizontal bottom border (border-bottom: size, pro)
stripted table: table:nth-child (even/odd)
responsive table: style="overflow-x:auto;" this make horizontal slide bar
empty-cell:hide/show(want to you border in empty cell or not
caption: caption-side:bottom;/caption-side:top; place caption at table top or bottom.
table-layout:auto/fixed; row and column layout width fixed or auto as per no of row and
columns
transition-property:width;
transition-duration:0s;
transition-timing-function:linear;
transition-delay:1s;
transform: rotate(360deg);
same as transition but here we can change the position
to change the position we use % we have to follow the % sequence.
Name of each animation is different , while writing the name name of animation don’t use
the space.
Example:
animation-name:myfirst;
animation-duration:4s;
animation-timing-function:linear;
animation-delay:1s;
animation-iteration-count:infinite;
animation-direction:alternate;
animation-play-state:running;
@keyframes myfirst
{
0% {background:red; left:0px; top:0px;}
25% {background:yellow; left:340px; top:100px;}
50% {background:blue; left:300px; top:300px;}
75% {background:green; left:0px; top:300px;}
100% {background:red; left:0px; top:0px;}
}
Syntax:
selector:pseudo-class {
property:value;
}
matrix(scaleX(),skewY(),skewX(),scaleY(),translateX(),translateY())
filter: grayscale(100%);
other propertities:
blur(px)
invert(%)
contrast(%)
hue(%)
saturate(%)
drop-shadow(px px px px)
sepia(%)
hue-rotate(deg)
brightness(%)
opacity(%)
flip image/text/element
if image size is larger then box, this properity cut the sides of image and fit it inside the box
fill, contain , cover, none,scale-down
«, »
column-count
column-gap
column-fill
column-rule (line width and style and color)
column-width
column-span
display:flex;
make like ul list
act like a container for child element
flex-direction:column/row
flex-direction:column-reverse
flex-wrap
justify-content,