Foros del Web » Creando para Internet » HTML »

Editar sobre una imagen

Estas en el tema de Editar sobre una imagen en el foro de HTML en Foros del Web. veran hice una pagina: <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Media</title> <style type="text/css"> #apDiv1 { position:absolute; width:1128px; height:548px; z-index:2; left: -1px; top: 0px; ...
  #1 (permalink)  
Antiguo 29/07/2011, 00:37
 
Fecha de Ingreso: julio-2011
Mensajes: 5
Antigüedad: 12 años, 7 meses
Puntos: 0
Editar sobre una imagen

veran hice una pagina:

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Media</title>
<style type="text/css">
#apDiv1 {
position:absolute;
width:1128px;
height:548px;
z-index:2;
left: -1px;
top: 0px;
}
</style>
</head>
<style type="text/css">
* {
margin: 0;
padding: 0;
position: relative;
overflow: visible;
visibility: inherit;
}

html,body {
width: 100%;
height: 100%;
overflow: hidden;
}

.img_bg {
width: 100%;
height: 100%;
position: absolute;
z-index: 1;
}

.all {
overflow: auto;
left: 0;
opacity: 0.7;
top: 0;
z-index: 2;
background-color: #FFFFFF;
}

.cont {
background: #FFF;
-moz-opacity: 0.7;
filter: alpha(opacity = 70);
width: 80%;
margin: 0 auto;
}
</style>
<script>
function cargarImagen(){
ahora=new Date();
hora=ahora.getHours();
if(hora>=0 && hora<4){
imagen="/imagenes/medianoche.jpg";
}

if(hora>=4 && hora<9){
imagen="/imagenes/amanece.jpg";
}
if(hora>=9 && hora<12){
imagen="/imagenes/alba.jpg";
}
if(hora>=12 && hora<19){
imagen="/imagenes/tarde.jpg";
}
if(hora>=19 && hora<21){
imagen="/imagenes/crepusculo.jpg";
}
if(hora>=21 && hora<24){
imagen="/imagenes/noche.jpg";
}
document.images["reloj"].src=imagen;
}
</script>

<title>Untitled</title>
</head>

<body onload="cargarImagen()">
<img src="imagenes/amanece.jpg" name="reloj" class="img_bg" alt="Fondo de web"/>
</body>
</html>
(http://cgrupo.com.nu/fondo_plantilla.html)

Mi objetivo es que el fondo cambie dependiendo la hora y q se ajuste dependiendo la resolucion del navegador.
Pero aqui me hace todo como imagen no como background.
Queria saber si podrian desirme como hacer la pagina sobre la imagen.
Gracias :D de antemano
  #2 (permalink)  
Antiguo 29/07/2011, 07:43
Avatar de maycolalvarez
Colaborador
 
Fecha de Ingreso: julio-2008
Ubicación: Caracas
Mensajes: 12.120
Antigüedad: 15 años, 7 meses
Puntos: 1532
Respuesta: Editar sobre una imagen

1- la imagen tiene CSS position:absolute;, no te afectaría en nada al flujo norma de la página, el único detalle es colocarle un orden Z inferiror (z-index)

2- usa var en javascript para declarar variables

3- usa la herramienta highlight del foro para postear código
__________________
¡Por favor!: usa el highlight para mostrar código
El que busca, encuentra...

Etiquetas: Ninguno
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 21:29.