08.06.2013 Views

Tehnologii Web

Tehnologii Web

Tehnologii Web

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Tehnologii</strong> <strong>Web</strong> 2007/2008<br />

<strong>Tehnologii</strong> <strong>Web</strong><br />

Dr. Sabin-Corneliu Buraga<br />

Facultatea de Informatica<br />

Universitatea “A.I.Cuza” – Iasi, Romania<br />

http://www.infoiasi.ro/~busaco/<br />

Dr. Sabin Buraga http://www.infoiasi.ro/~busaco/<br />

<br />

<br />

1


<strong>Tehnologii</strong> <strong>Web</strong> 2007/2008<br />

Foi de stiluri in cascada<br />

Prezentare generala<br />

Dr. Sabin Buraga http://www.infoiasi.ro/~busaco/<br />

<br />

<br />

Detalii in [PSW, 163-196 + CD]<br />

[NW, 105-125]<br />

2


<strong>Tehnologii</strong> <strong>Web</strong> 2007/2008<br />

cuprins<br />

• Caracteristici generale<br />

• CSS – nivelul 1<br />

• CSS – nivelul 2<br />

• Resurse<br />

Dr. Sabin Buraga http://www.infoiasi.ro/~busaco/<br />

<br />

<br />

3


<strong>Tehnologii</strong> <strong>Web</strong> 2007/2008<br />

css | caracteristici<br />

Dr. Sabin Buraga http://www.infoiasi.ro/~busaco/<br />

<br />

<br />

• Foi de stiluri: grupuri de proprietati<br />

definind modul de aparitie a elementelor<br />

unor limbaje de marcare (HTML, XML,…)<br />

• Cascading Style Sheets – nivelul 1<br />

(dec. 1996)<br />

• Cascading Style Sheets – nivelul 2<br />

(mai 1998)<br />

• Cascading Style Sheets – nivelul 3<br />

(in curs de standardizare)<br />

4


<strong>Tehnologii</strong> <strong>Web</strong> 2007/2008<br />

css | formatare<br />

• Model orientat boxa<br />

margine, bordura, padding, continut<br />

Dr. Sabin Buraga http://www.infoiasi.ro/~busaco/<br />

<br />

<br />

5


<strong>Tehnologii</strong> <strong>Web</strong> 2007/2008<br />

css | terminologie<br />

h1 { color: #CCC; font-size: 16pt;}<br />

Selector<br />

Proprietate<br />

Valoare<br />

Declaratie Declaratie<br />

Dr. Sabin Buraga http://www.infoiasi.ro/~busaco/<br />

<br />

<br />

6


<strong>Tehnologii</strong> <strong>Web</strong> 2007/2008<br />

css | moduri de utilizare<br />

Dr. Sabin Buraga http://www.infoiasi.ro/~busaco/<br />

<br />

<br />

• Local, la nivelul unui marcator – atributul style:<br />

…<br />

• Gruparea definitiilor CSS in antetul documentului<br />

–elementul:<br />

<br />

h3 { color: #C60; margin: 1em }<br />

<br />

• Extern, definitiile de stiluri fiind stocate<br />

intr-un fisier .css:<br />

<br />

7


<strong>Tehnologii</strong> <strong>Web</strong> 2007/2008<br />

css | clase<br />

Dr. Sabin Buraga http://www.infoiasi.ro/~busaco/<br />

<br />

<br />

• Definirea de proprietati pentru o clasa<br />

(grup) de elemente: .nume_de_clasa<br />

.intens { font-weight: bolder; color: green }<br />

• Utilizare prin intermediul atributului class:<br />

Paragraf ingrosat si verde.<br />

Titlu ingrosat si verde<br />

• Alternativa – via identificator #identificator<br />

#intens { font-weight: bolder; color: green }<br />

Paragraf ingrosat si verde.<br />

8


<strong>Tehnologii</strong> <strong>Web</strong> 2007/2008<br />

css | stiluri<br />

Dr. Sabin Buraga http://www.infoiasi.ro/~busaco/<br />

<br />

<br />

• Stiluri aplicate in functie de context:<br />

p em { color: blue }<br />

Un paragraf albastru doar aici…<br />

Acesta este italic si atit!<br />

• Grupare de stiluri:<br />

h1, h2, a, td { font-family: Arial; font-size: 16pt }<br />

h2 { font-style: italic }<br />

9


<strong>Tehnologii</strong> <strong>Web</strong> 2007/2008<br />

css | pseudo<br />

• Pseudo-clase: a:link, a:visited, a:active<br />

a:link { color: red }<br />

a:visited img { color: yellow; border: solid }<br />

a:active { background-color: blue }<br />

• Pseudo-elemente: first-line, first-letter<br />

p:first-line { text-indent: 5% }<br />

p:first-letter { font-size: 200%; float: left }<br />

Dr. Sabin Buraga http://www.infoiasi.ro/~busaco/<br />

<br />

<br />

10


<strong>Tehnologii</strong> <strong>Web</strong> 2007/2008<br />

css | exemple<br />

Dr. Sabin Buraga http://www.infoiasi.ro/~busaco/<br />

<br />

<br />

• Foile de stiluri folosite in cadrul paginilor<br />

<strong>Web</strong> ale cursului:<br />

– http://www.infoiasi.ro/~busaco/teach/courses/web/web.css<br />

• Foile de stiluri utilizate de situl <strong>Web</strong> al<br />

Facultatii de Informatica – consultati<br />

codul-sursa XHTML al paginii principale:<br />

– http://www.infoiasi.ro/<br />

11


<strong>Tehnologii</strong> <strong>Web</strong> 2007/2008<br />

css | proprietati | fonturi<br />

Dr. Sabin Buraga http://www.infoiasi.ro/~busaco/<br />

<br />

<br />

• font-family: serif (Amherst),<br />

sans-serif (Arial), cursive (Nuptial),<br />

fantasy (STOP), monospace (Courier)<br />

• font-style: normal, italic, oblique<br />

• font-weight: normal, bold, lighter, 100..900<br />

• font-size: x-small, medium, large, 10pt,<br />

16pt, larger, smaller, -10%, +50%<br />

p { font-size: 12pt; font-family: Arial, sans-serif }<br />

h4 { font-style: italic; font-weight: bold; font-size: -25% }<br />

12


<strong>Tehnologii</strong> <strong>Web</strong> 2007/2008<br />

css | proprietati | culori<br />

Dr. Sabin Buraga http://www.infoiasi.ro/~busaco/<br />

<br />

<br />

• color: denumire_culoare | rgb(N,N,N)<br />

• background-color: denumire_culoare | rgb(N,N,N)<br />

• background-image: url (URL)<br />

• background-repeat: repeat-x, repeat-y, no-repeat<br />

• background-position: vertical orizontal<br />

h2 { color: navy; background-image: url(web-bg.png) }<br />

body { background-image:<br />

url(http://www.infoiasi.ro/~busaco/csb-myself2);<br />

background-repeat: no-repeat;<br />

background-position: top right;<br />

}<br />

13


<strong>Tehnologii</strong> <strong>Web</strong> 2007/2008<br />

css | proprietati | text<br />

Dr. Sabin Buraga http://www.infoiasi.ro/~busaco/<br />

<br />

<br />

• letter-spacing: numar<br />

• text-decoration: none, underline, overline,<br />

line-through, blink<br />

• vertical-align: top, middle, bottom<br />

• text-transform: capitalize, uppercase, lowercase<br />

• text-align: left, center, right, justify<br />

• text-indent: numar<br />

• line-height: numar<br />

a { text-decoration: none; text-transform: uppercase }<br />

p.aliniat { text-indent: 2cm; line-height: 1.2; text-align: justify }<br />

14


<strong>Tehnologii</strong> <strong>Web</strong> 2007/2008<br />

css | proprietati | clasif.<br />

clasif<br />

Dr. Sabin Buraga http://www.infoiasi.ro/~busaco/<br />

<br />

<br />

• white-space: normal, pre, nowrap<br />

• list-style-type: disc, circle, square, decimal,<br />

lower-roman, upper-roman, none, …<br />

• list-style-image: url (URL)<br />

• list-style-position: inside, outside<br />

pre { white-space: pre; margin-left: 10px }<br />

li {<br />

list-style-image: url(web-bullet.png);<br />

list-style-type: disc<br />

}<br />

15


<strong>Tehnologii</strong> <strong>Web</strong> 2007/2008<br />

css | nivelul 2<br />

Dr. Sabin Buraga http://www.infoiasi.ro/~busaco/<br />

<br />

<br />

• Selectorii permit descendenti (first-child)<br />

• Mecanism complex de selectare a elementelor<br />

• Dependenta de medii de comunicare<br />

(@media) – ecran, hirtie, audio,…<br />

• Stiluri pentru tabele<br />

• Stiluri aurale<br />

(volume, speak, pause, cue, azimuth, elevation)<br />

• Suport pentru alfabete<br />

• Pozitionare absoluta/relativa a continutului<br />

(top, left, z-index, position)<br />

• Suport pentru redare<br />

(visibility, clip, overflow, width, height)<br />

16


<strong>Tehnologii</strong> <strong>Web</strong> 2007/2008<br />

css | nivelul 2<br />

Dr. Sabin Buraga http://www.infoiasi.ro/~busaco/<br />

<br />

<br />

• Mecanismul de selectare<br />

» Aparitii contextuale<br />

ul li { font-size: 10pt; width: 50% }<br />

» Descendenti ai altor elemente<br />

ol > li { background: rgb(127,200,0) }<br />

» Elemente care urmeaza imediat dupa altele<br />

h1 + h2 { margin-top: -5mm }<br />

» Elemente cu atribute avind diverse valori<br />

a[href=“http://www.infoiasi.ro”] { border: solid thin }<br />

*[lang=“en”] { display: none }<br />

» Elemente avind ID setat cu o anumita valoare<br />

h1#capitolul1 { letter-spacing: 0.3em }<br />

17


<strong>Tehnologii</strong> <strong>Web</strong> 2007/2008<br />

css | nivelul 2<br />

• Medii<br />

» Tipuri: aural, braille, handheld, print,<br />

projection, screen, tty, tv<br />

» Clasificare:<br />

–continue (continuous) | paginate (paged)<br />

–vizuale (visual) | sonore (aural) |<br />

tactile (tactile)<br />

–interactive | statice<br />

@media print { body { font-size: 12pt } }<br />

@media screen<br />

{ body { font-size: 10pt; background-color: #CCC } }<br />

Dr. Sabin Buraga http://www.infoiasi.ro/~busaco/<br />

<br />

<br />

18


<strong>Tehnologii</strong> <strong>Web</strong> 2007/2008<br />

instrumente<br />

• CSS Validator:<br />

http://jigsaw.w3.org/css-validator/<br />

• Extensia <strong>Web</strong> Developer pentru<br />

Dr. Sabin Buraga http://www.infoiasi.ro/~busaco/<br />

<br />

<br />

Firefox: http://addons.mozilla.org/addon/60<br />

• Extensia Firebug pentru Firefox:<br />

getfirebug.com<br />

19


<strong>Tehnologii</strong> <strong>Web</strong> 2007/2008<br />

resurse<br />

• CSS – level 1 (recomandare W3C):<br />

www.w3.org/TR/REC-CSS1<br />

Dr. Sabin Buraga http://www.infoiasi.ro/~busaco/<br />

<br />

<br />

• CSS – level 2, revision 1 (recomandare W3C):<br />

www.w3.org/TR/REC-CSS21<br />

• Learning CSS: www.w3.org/Style/CSS/learning<br />

• CSS Zen Garden: www.csszengarden.com/<br />

• CSS/Edge: www.meyerweb.com/eric/css/edge/<br />

• Quirks Mode: www.quirksmode.org/<br />

20


<strong>Tehnologii</strong> <strong>Web</strong> 2007/2008<br />

rezumat<br />

• Caracteristici generale<br />

• CSS – nivelul 1<br />

• CSS – nivelul 2<br />

• Resurse<br />

Dr. Sabin Buraga http://www.infoiasi.ro/~busaco/<br />

<br />

<br />

21


<strong>Tehnologii</strong> <strong>Web</strong> 2007/2008<br />

Intrebari…?<br />

Dr. Sabin Buraga http://www.infoiasi.ro/~busaco/<br />

<br />

<br />

22

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!