Css selectors
səhifə 1/2 tarix 15.07.2022 ölçüsü 254,36 Kb. #117403
CSS Lab CSS Selectors Selector Type Element selector Grouped selectors – use comma Descendant selectors – use space Id selectors – use # character Class selectors – use . Character * - to apply for all Combinator Descendant selector(space) Child selector (>) Adjacent sibling selector(+) General sibling selector( Cont’d Note: class values are case sensitive To prevent a specific rule from being overridden you can assign it “important” with the !important indicator Example p {color : blue !important} Inline style sheet red Embedded style sheet Conflicting Style To prevent a specific rule from being overridden you can assign it “important” with the !important indicator Example p {color : blue !important} Background background-color background-image background-repeat background-position background-attachment background Font font-weight normal, bold, bolder, lighter, 100 – 900 font-size xx-small, x-small, small, medium, large, x-large, xx-large, smaller, larger, size in pixels or in %. font-variant font-color font-family font-style Text Color direction letter-spacing word-spacing text-indent text-transform white-space text-shadow text-align left, right, Center, justify. text-decoration none, underline, overline, line-through. Border Border-style Border-width Border –color Border :width style color Margin
margin-top
Margin-right
margin-bottom
Margin-left
Margin: top right bottom left;
Padding
padding-top
padding-right
padding-bottom
padding-left
Padding: top right bottom left;
Position static : HTML elements are positioned static by default. not affected by the top, bottom, left, and right properties. it is always positioned according to the normal flow of the page Position relative works the same way as static but it lets you change an element's position. affected by the top, bottom, left, and right properties. working in reverse. top in fact moves the element towards the bottom of the element's parent container. bottom pushes the element towards the top of the element's parent container, and so on Position absolute positioned elements are completely taken out of the regular flow of the web page. They are not positioned based on their usual place in the document flow , but based on the position of their ancestor. Dostları ilə paylaş: