Belajar CSS
Belajar CSS
sintax
selector{
property: value;
property2: value2;
}
Internal styles
<style type="text/css">
div { color: #444;}
</style>
Inline styles
Clearfix
.clearfix:after {
clear: both;
content: " ";
display: block;
font-size: 0;
height: 0;
visibility: hidden;
}
.clearfix { display: inline-block; }
* html .clearfix { height: 1%; }
.clearfix { display: block; }
Selectors
*all elements
divall div tags
div,pall divs and paragraphs(semua div dan paragraf)
div pparagraphs inside divs(paragraf di dalam div)
div > pall p tags, one level deep in div
div + pp tags immediately after div
div ~ pp tags preceded by div
.classnameall elements with class(semua element dengan class)
#idnameelement with ID(element id)
div.classnamedivs with certain classname(div dengan class tertentu)
div#idnamediv with certain ID(div dengan dengan id tertentu)
#idname *all elements inside #idname(semua element didalam idname
Pseudo classes
Attribute selectors
Properties
align-contentbehavior of the flex-wrap property
align-itemsalignment for items inside the container
align-selfalignment for the selected item
box-shadowshadow to element
box-sizingbox sizing properties
Color Picker
0% 0% 50% 0% 100% 0%
0% 50% 50% 50% 100% 50%
0% 100% 50% 100% 100% 100%
X= px
Y= px
Gradient
background: #1C6EA4;
Button Generator
.myButton {
padding: 8px; border-radius: 11px; font-family: Georgia, serif; font-weight: normal; text-decoration:
none; font-style: normal; font-variant: normal; text-transform: none; background-image: linear-
gradient(to right, rgb(28, 110, 164) 0%, rgb(35, 136, 203) 31%, rgb(20, 78, 117) 100%); box-shadow:
rgba(0, 0, 0, 0.89) -2px -1px 26px 31px; border: 2px solid rgb(28, 110, 164); display: inline-block;}
.myButton:hover {
background: #1C6EA4; }
.myButton:active {
background: #144E75; }
Taxt shadow
Boroder
style solid dotted dashed double groove ridge inset outset hidden none
font generator
font
size
leter spc
word spc
color
Trasfrom
reset css
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,
a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,
strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,l
abel,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,d
etails,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,se
ction,summary,time,mark,audio,video { margin: 0; padding: 0; border: 0;
font-size: 100%; font: inherit; vertical-align: baseline;}
article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,secti
on { display: block;}
body { line-height: 1;}
ol,ul { list-style: none;}
blockquote,q { quotes: none;}
blockquote:before,blockquote:after,q:before,q:after { content: ''; content:
none;}
table { border-collapse: collapse; border-spacing: 0;}
media Queris
Print style
@media print { ... }
Media types
all, print, screen, speech
Media features
widthviewport width
heightviewport height
orientationorientation of the viewport
aspect-ratioratio between width & height
colornumber of bits per color
color-indexnumber of displayable colors
monochromecolor on greyscale device
resolutionresolution of the device
scanscanning process of the device
griddevice is a grid or bitmap