end side, if you feel you are too big, please don’t read this slide. • This slide may contain subjective perception from the author, if you have different thinking please don’t let me know .
Sheet • Some people say that CSS is cosmetics in web. • CSS more critical than just cosmetics. • CSS giving layout, position, existence, variation, etc. • CSS describe how each HTML element should be displayed. • CSS remove style formatting from HTML attribute.
<head> block • CSS can also come with each HTML element in attribute style=“” • CSS can also deliver in external resources like <link rel="stylesheet" type="text/css" href=“somecss.css"> in <head> block • CSS has priority if there is same style from different delivery : + Inline style (inside an HTML element) + External and internal style sheets (in the head section) + Browser default
(:) as separator and semicolon (;) for ending each declaration. • Ex : color:blue; font-size:17px; • If using external resources or internal style, CSS use bracket ({}) after its selector (*in next page) • Ex : .row{color: blue; font-size: 17px;}
will be style-ed. • CSS will styling element that select by selector that used like HTML element, Id, or class, attribute, etc. • HTML element will apply to all HTML element that given style. Ex : input[type=“text”], a, ul li, etc. • ID is unique in one web page, represented by attribute id=“” in HTML element. • Class is NOT unique, can be reuse to any HTML element in one web page, represent in attribute class=“” in HTML element. • Class can be multiple in one HTML element using space separator. • CSS use hash (#) for select id, and dot (.) for select class
using space ( ) or (>). (>) is child selector and space ( ) is descendant selector. Ex : .class1 p { color: blue; } .class1 > p { color: blue; } • Sibling : We can select sibling element with (+) or (~). (+) adjacent sibling selector and (~) general sibling selector. Ex : div + p { color: blue; } div ~ p { background-color: yellow; }
: normal position - Relative : relative to its normal position - Fixed : positioned relative to the viewport, which means it always stays in the same place even if the page is scrolled - Absolute : positioned relative to the nearest positioned ancestor • We can shift position with top, left, bottom, right rule.
o Linkedin : /in/irfanmaulanamazipan o Slideshare : /IrfanMaulana21 o Github : mazipan o Email : [email protected] o Blog : mazipanneh , mazipan.github.io