Css-Ghid Rapid in Romana

Download as pdf or txt
Download as pdf or txt
You are on page 1of 21

Ce este CSS?

CSS acronim la Cascading Style Sheets
CSS scurteaza timpul de lucru. Poate
controla aspectul mai multor pagini web
pages deodata
CSS este un limbaj de stilizare
Se poate utiliza CSS in HTML
Atributele HTML si CSS sunt diferite.
Structure of CSS

Va stiliza conform declaratiilor, toate


elementele <h1> din site-ul web
Moduri de inserare CSS

Inline
Internal
External
1. Inline CSS
CSS scris intr-un tag HTML se numeste Inline CSS.

<p style=“color:blue; background-color:pink;”>Hi , the element is styled with CSS</p>


2. Internal CSS
Internal Css se scrie in interiorul blocului <style>, in zona <head> a fisierului HTML
3. External CSS
Acest fisier va contine doar elementele de stilizare intr-un fisier cu extensia .css

Index.html Mystyle.css

Save this as filename.html Save this as filename.css


Selectori CSS

A) Element Selector
B) ID Selector
C) Class Selector
Element Selector
Selecteaza pentru stilizare doar elementele de baza HTML
ID Selector
Utilizeaza atributul id al unui element HTML pentru o stilizare unica.
Class Selector
Selectează mai multe elemente HTML cu acelasi atribut de clasa
Grupare Selectori
CSS Comentarii

Single Line Multi Line


CSS Background
• background-color:red;

• background-image:url(‘mypic.png’);

• background-repeat:no-repeat/repeat-X/repeat-y;

• background-attachment:scroll/fixed;

• background-position:left top/left center/left bottom/right top;


CSS Borders
Border Style
border-style:dashed/dotted/double/inset/outset/none/hidden;
border-top/bottom/left/right-style:borderStyle_values;
Border Color
border-color:colorname;
border-top/bottom/left/right-color:colorname;
Border width
border-width: value;
border-top/bottom/left/right-width:values;

border:5px green inset;


CSS Margin/Padding

margin-top: value ; padding-top: value ;


margin-left: value; padding-left: value;
margin-bottom: value; padding-bottom: value;
margin-bottom: value; padding-bottom: value;

margin: value; padding: value;


margin:20px; padding:20px;
CSS Text
color:colorname/hex value;
direction:ltr/rtl;
text-decoration:overline/underline/line-through;
word-spacing:value;
letter-spacing:value;
line-height:value;
text-indent:value;
text-align:left/center/right;
text-transform:uppercase/lowercase/capitalize;
text-shadow:value value value colorname;
CSS Font
font-family:fontname;
font-size:value;
font-style:italic/normal/oblique;
font-variant:small-caps;
font-weight:bold/lighter/normal;
CSS Position
position: static/absolute/relative/fixed;
top: value;
left: value;
bottom: value;
right: value;
CSS Image
height: value;
width: value;
border: border_value;
opacity: 0.1-1;(0-invisible, 1-total visible)
border-radius:value;
CSS Transform
transform:rotate(value in deg);
transform:skew(value in deg);
transform:scale(value in ratio ,another value in ratio);
transform:translate(x,y);
CSS Animation
@keyframes animationName{
0%{css properties;}
25%{css properties;}
50%{css properties;}
100%{css properties;}
}

animation: animationName animationTime animationLoop;

.div{animation: animate 5s 5;}

You might also like