CSS3 transition
poate fi utilizat pentru a anima proprietatile CSS, adaugand un efect de animatie cand se modifica proprietatile CSS ale unui element HTML, schimband gradual de la un stil la altut.
CSS3 transition are 4 componente:
transition-property
).transition-duration
).<style> #iddv { width:80px; height:80px; background:#b8b9fe; font-size:17px; transition-property: width; transition-duration: 1.4s; } #iddv:hover { width:200px; } </style> <div id="iddv">Pozitionati mouse-ul pe acest patrat.</div>
transition: property duration timing-function delay;
<style> .clse { width:200px; font-size:13px; transition: font-size 0.4s ease-out; } .clse:hover { font-size: 16px; } </style> <ul> <li class="clse"><a href="//marplo.net/css" title="Curs CSS gratuit">Curs CSS gratuit</a></li> <li class="clse"><a href="//marplo.net/html" title="Curs HTML">Curs HTML</a></li> <li class="clse"><a href="//coursesweb.net/" title="Cursuri Programare Web">Cursuri Programare Web</a></li> </ul>
<style> .dv1 { width:115px; height:100px; position:relative; font-size:17px; text-align:center; padding-top:18px; } .clsdv { width:120px; height:100px; position:absolute; top:0; left:0; background:#b8b9fe; transition: background 1.3s, opacity 1.8s, transform 1.4s; } .clsdv:hover { background: #00da01; opacity:0.5; transform:rotate(180deg); } </style> Puneti mouse-ul deasupra acestui dreptunghi. <div class="dv1"> <div class="clsdv"></div> Text oarecare, ascuns </div><style> .dv1 { width:115px; height:100px; position:relative; font-size:17px; text-align:center; padding-top:18px; } .clsdv { width:120px; height:100px; position:absolute; top:0; left:0; background:#b8b9fe; transition: background 1.3s, opacity 1.8s, transform 1.4s; } .clsdv:hover { background: #00da01; opacity:0.5; transform:rotate(180deg); } </style> Puneti mouse-ul deasupra acestui dreptunghi. <div class="dv1"> <div class="clsdv"></div> Text oarecare, ascuns </div>
• O alta metoda de a anima proprietatile unui element HTML cu CSS este utilizand proprietatile "animation". Vedeti tutorialul: Animatie elemente HTML cu CSS.
<ul> <li>http://coursesweb.net/html/</li> <li>http://www.marplo.net/html/</li> </ul>
.some_class { display: list-item; }
var obj = { "courses": ["php", "javascript", "ajax"] }; var jsonstr = JSON.stringify(obj); alert(jsonstr); // {"courses":["php","javascript","ajax"]}
$strhtml = '<body><div id="dv1">CoursesWeb.net</div></body>'; $dochtml = new DOMDocument(); $dochtml->loadHTML($strhtml); $elm = $dochtml->getElementById("dv1"); echo $elm->nodeValue; // CoursesWeb.net
I`m living here. - Traiesc /Locuiesc aici.
Estoy viviendo aquí. - Traiesc /Locuiesc aici.