<div class="square"></div>
.square{
width: 100px;
height: 100px;
background-color: blue;
top:50px;
position:relative;
}
$(".square").animate({
width: "500px",
top: "50px"
}, 1000, "easeInOutQuint");
/*
Se debe agregar jquery UI
swing
easeInOutQuint
easeOutElastic
easeOutBounce
*/
Mostrando entradas con la etiqueta CSS3. Mostrar todas las entradas
Mostrando entradas con la etiqueta CSS3. Mostrar todas las entradas
viernes, 6 de mayo de 2016
Animación en un Botón
<button class="btn">Eses mi boton</button>
.btn{
background-color: #600;
color:white;
bordwer:none;
width: 200px;
height; 40px;
font-weight: bold;
border-radius: 4px;
font-size: 14px;
transition: all 1s; /*backgorind-color 1s*/
}
.btn:hover{
background-color: #a30;
font-size: 20px;
}
.btn{
background-color: #600;
color:white;
bordwer:none;
width: 200px;
height; 40px;
font-weight: bold;
border-radius: 4px;
font-size: 14px;
transition: all 1s; /*backgorind-color 1s*/
}
.btn:hover{
background-color: #a30;
font-size: 20px;
}
viernes, 17 de abril de 2015
Propiedades de color
http://www.w3.org/wiki/CSS3/Color/Extended_color_keywords
- numeral
color:#000000
- Por su color en ingles
green, yellow, blue etc
- RGBA red, green, blue y alfa transparencia
div{
width: 900px;
height: 600px;
background: rgba(255,255.255,0); // o trasparente y 1 solido
border: 5px solid red;
}
- HSL
puede usar alfa
background: hsla(360,100%,20%,.5); /* luz*/
- CMYK
Selectores Estructurales
:root
:empty
p:empty
:first-child
:last-child
li:first-child //primer elemnto de esta lista
li:last-child //ultimo elemento de esta lista
h1:first-of-type{
}//primer elemento de un elemento superior
h1:last-of-type{
}//ultimo elemento de un elemento superior
:only-child
:only-of-type
Descendientes por id
ul li{
width:200px;
height:200px;
text-aling:center;
line-height:200px;
font-size:40px;
font-weight:bold;
background:grey;
margin-right:20px;
float:left;
margin-bottom:20px;
list-style:none;
color:white;
}
//busca la pocision 8 y le cambia el color
li:nth-child(8){
backgorund:blue
}
li:nth-child(1n){ //saltos para afectar una regla
backgorund:blue
}
li:nth-child(2n){ //cada dos elementos
backgorund:blue
}
li:nth-child(3n){ //cada tres elementos
backgorund:blue
}
tima
Tambien pueden ser negativas
li:nth-child(-1n+3){ //cada tres elementos hacia atras
backgorund:blue
}
Cuenta elemtos hacia aarriba
li:nth-last-child(){ //empezando del final 3 elemntos
backgorund:blue
}
li:nth-last-child(1n){ //empezando del final 3 elemntos
backgorund:blue
}
Seleccionar la penultima fila y la primera
li:nth-child(-1n+7){ //la fila ultima
backgorund:blue
}
li:nth-last-child(1n+7){ //la fila empezando
backgorund:blue
}
forma mas simple con comas
li:nth-last-child(1n+7),li:nth-last-child(1n+7){ //empezando del final 3 elemntos
backgorund:blue
}
:empty
p:empty
:first-child
:last-child
li:first-child //primer elemnto de esta lista
li:last-child //ultimo elemento de esta lista
h1:first-of-type{
}//primer elemento de un elemento superior
h1:last-of-type{
}//ultimo elemento de un elemento superior
:only-child
:only-of-type
Descendientes por id
ul li{
width:200px;
height:200px;
text-aling:center;
line-height:200px;
font-size:40px;
font-weight:bold;
background:grey;
margin-right:20px;
float:left;
margin-bottom:20px;
list-style:none;
color:white;
}
//busca la pocision 8 y le cambia el color
li:nth-child(8){
backgorund:blue
}
li:nth-child(1n){ //saltos para afectar una regla
backgorund:blue
}
li:nth-child(2n){ //cada dos elementos
backgorund:blue
}
li:nth-child(3n){ //cada tres elementos
backgorund:blue
}
tima
Tambien pueden ser negativas
li:nth-child(-1n+3){ //cada tres elementos hacia atras
backgorund:blue
}
Cuenta elemtos hacia aarriba
li:nth-last-child(){ //empezando del final 3 elemntos
backgorund:blue
}
li:nth-last-child(1n){ //empezando del final 3 elemntos
backgorund:blue
}
Seleccionar la penultima fila y la primera
li:nth-child(-1n+7){ //la fila ultima
backgorund:blue
}
li:nth-last-child(1n+7){ //la fila empezando
backgorund:blue
}
forma mas simple con comas
li:nth-last-child(1n+7),li:nth-last-child(1n+7){ //empezando del final 3 elemntos
backgorund:blue
}
viernes, 10 de abril de 2015
Estilos a atributos
a[href]{
font-size=25px;
}
a[href="home.html"]{
color: red;
}
la tilde nos trae si tiene compras en cualquier lugar
a[title~=compras]{
text-decoration:none;
margin-left:60px;
}
a[title="compras"]{
text-decoration:none;
margin-left:60px;
}
Busca compras en cualquier parte del atributo
a[href^="compras"]{
text-decoration:none;
margin-left:60px;
}
Buscar en extensiones pdf con el signo "$"
a[href$=".pdf"]:before{
content:"PDF";
background:red;
color:white;
padding:2px;
font-size:9px;
border:1px solid black;
margin-right:6px;
}
<div>
</div>
font-size=25px;
}
a[href="home.html"]{
color: red;
}
la tilde nos trae si tiene compras en cualquier lugar
a[title~=compras]{
text-decoration:none;
margin-left:60px;
}
a[title="compras"]{
text-decoration:none;
margin-left:60px;
}
Busca compras en cualquier parte del atributo
a[href^="compras"]{
text-decoration:none;
margin-left:60px;
}
Buscar en extensiones pdf con el signo "$"
a[href$=".pdf"]:before{
content:"PDF";
background:red;
color:white;
padding:2px;
font-size:9px;
border:1px solid black;
margin-right:6px;
}
<div>
</div>
Un parrafo al mismo nivel si que sea necesario ser adyacente
<div> ~ p {
color:red;
font-weight:bold;
}
<div>
</div>
<h1>Este s un titulo</h1>
<p>Este apparafo sigue la regla</p>
color:red;
font-weight:bold;
}
<div>
</div>
<h1>Este s un titulo</h1>
<p>Este apparafo sigue la regla</p>
- Representadado por ~
Estilos adyacentes mismo nivel de jeraquia
<div> + h1 {
color:red;
font-weight:bold;
}
<div>
<h1>Este apparafo sigue la regla</h1>
</div>
Es através del sigono + y estan al mismo novel
color:red;
font-weight:bold;
}
<div>
<h1>Este apparafo sigue la regla</h1>
</div>
Es através del sigono + y estan al mismo novel
estilo a descendientes directos
<div> > p {
color:red;
font-weight:bold;
}
<div>
<p>Este apparafo sigue la regla</p>
</div>
Esto aplica para todos los decendientes de div que sean parrafos.
color:red;
font-weight:bold;
}
<div>
<p>Este apparafo sigue la regla</p>
</div>
Esto aplica para todos los decendientes de div que sean parrafos.
Vendor prefixes
Mozila Firefoz: -moz-
Google Crhome -webkit-
Apple Zafari: -webkit-
Opera -o-
Microsoft -ms-, -mso-
Suscribirse a:
Entradas (Atom)