Foros del Web » Creando para Internet » CSS »

img de div no se ajusta al tamaño del navegador en iexplorer

Estas en el tema de img de div no se ajusta al tamaño del navegador en iexplorer en el foro de CSS en Foros del Web. hola buenas, tengo un html con css que no se como hacer para que se ajuste un div que contiene una imagenal tamaño que tenga ...
  #1 (permalink)  
Antiguo 14/03/2012, 03:04
 
Fecha de Ingreso: abril-2006
Mensajes: 147
Antigüedad: 18 años
Puntos: 1
img de div no se ajusta al tamaño del navegador en iexplorer

hola buenas, tengo un html con css que no se como hacer para que se ajuste un div que contiene una imagenal tamaño que tenga la pantalla.

les enseño el html:
Código HTML:
<html xmlns="http://www.w3.org/1999/xhtml">        
  <head>              
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />              
    <title>Voluntas Arag&oacute;n               
    </title>   
             
    <style type="text/css">            
    *{margin:0;padding:0;}                
    body {background:url(voluntas_patron_fondo_web.png) repeat; z-index:5; width:100%; height:100%;}               
    #a{border:0;border-color:no;}               
    
    /*ESTO SE EJECUTA SOLO SI ES INTERNET EXPLORER*/     
    #fondo1ie {position:absolute; z-index:10; width:100%; height:100%;}      
    #logoie{position:absolute; z-index:50; width:240px; margin-left:-120px; left:50%; padding-top:10px;}     
    #formie{position:absolute; z-index:50; width:535px; margin-left:-267px; left:50%;  text-align:center;}          
    
    /*ESTO SE EJECUTA SOLO SI --NO-- ES INTERNET EXPLORER*/         
    #fondo1{ position:fixed; z-index:10; width:100%; height:100%;}	 	   		          
    #logo{position:absolute; z-index:50; width:240px; margin-left:-120px; left:50%; padding-top:10px; }                    
    #form{position:absolute; z-index:50; width:535px; margin-left:-267px; left:50%;  text-align:center;}                     
    .campo{background: transparent; border: 1px Solid transparent; font-family: Verdana, Geneva, sans-serif; 	font-weight: bold; padding-left:2px;}   	        
    #logo #form #form table tr td { 	text-align: right; }          
    #logo #form #form table { 	text-align: right; 	font-family: Verdana, Geneva, sans-serif; 	font-weight: bold; }          
    #logo #form #form button { 	font-family: Verdana, Geneva, sans-serif; 	font-weight: bold; }          
    </style>    
                  
  </head>      
  <body leftmargin="0px" topmargin="0px" bottommargin="0px" rightmargin="0px">    
    <div id="prin">           
      <!--[if IE]><div id="fondo1ie"><![endif]-->    	     
      <!--[if !IE]> -->
      <div id="fondo1">
        <!-- <![endif]-->       	              
        <img src="deg.png" width="100%" height="100%"/>         
      </div>          
      <!--[if IE]><div id="logoie" align="center"><![endif]-->   	     
      <!--[if !IE]> -->     
      <div id="logo" align="center">      
        <!-- <![endif]-->                                         
        <img src="Voluntas_logo_V.png" width="240" height="325" align="center"/>           
        <br>      
        <br>                       
        <!--[if IE]><div id="formie"><![endif]-->    	       
        <!--[if !IE]> -->       
        <div id="form">        
          <!-- <![endif]-->                         
          <p>          
            <img src="voluntas_filete_superior.png" width="535" height="25">           
          </p>               
          <p>            
            <br>          
            <img src="Voluntas_texto_campos.png" width="535" height="72">        
          </p> <br />                             
          <form action="enviar.php" method="post" name="contacto" id="form" onSubmit="javascript:alert('Ya tenemos tus datos')">                       
            <center>            
              <table width="0" border="0"  cellspacing="5" cellpadding="5">                 
                <tr>                     
                  <td align="right">                       
                    <label for="nombre" class="campo">Tan solo dinos tu nombre                    
                    </label></td> <td>                       
                    <!--[if IE]><input id="nombre" name="nombre" type="text" value="___________________" onFocus="if (this.value=='___________________') this.value='';" placeholder="___________________" required class="campo"><![endif]-->                        
                    <!--[if !IE]> -->                   
                    <input id="nombre" name="nombre" type="text" placeholder="___________________" required class="campo">                  
                    <!-- <![endif]--> </td>                 
                </tr>                 
                <tr>                     
                  <td align="right">                       
                    <label for="apellido" class="campo">apellido
                    </label></td> <td>                       
                    <!--[if IE]><input id="apellido" name="apellido" type="text" value="___________________" onFocus="if (this.value=='___________________') this.value='';" placeholder="___________________" required class="campo"><![endif]-->                        
                    <!--[if !IE]> -->                   
                    <input id="apellido" name="apellido" type="text" placeholder="___________________" required class="campo">                  
                    <!-- <![endif]--> </td>                 
                </tr>                 
                <tr>    
                  <td align="right">                  
                    <label for="nombre" class="campo">y correo electr&oacute;nico                   
                    </label></td> <td>                       
                    <!--[if IE]><input type="email" id="email" name="email" value="___________________" onFocus="if (this.value=='___________________') this.value='';" placeholder="___________________" required class="campo"><![endif]-->                        
                    <!--[if !IE]> -->                   
                    <input type="email" id="email" name="email" placeholder="___________________" required class="campo">                  
                    <!-- <![endif]--> </td>                 
                </tr>                 
                <tr>                
                  <td colspan="2">                  
                    <center>                    
                      <button type="submit">Enviar                     
                      </button>                  
                    </center></td>              
                </tr>            
              </table>          
            </center>                               
            <img src="voluntas_filete_inferior.png" width="535" height="25">                         		           
            <p>            
              <a href="http://www.facebook.com/profile.php?id=100002236836566">              
                <img src="Voluntas_logo_facebook.png" width="36" height="36" border="0"></a>          
            </p>                                                              
          </form>             
        </div>        
      </div>   
    </div>                                    
  </body>
</html> 
si abren http://www.revistavoluntas.com/pruebas/ con internet explorer y con firefox para hacer la prueba.

En firefox funciona como quiero: si reducen la pantalla a un tamaño muy pequeño y hacen scroll la imagen del div fondo1 que es deg.png se ajusta a todo el contenido

En explorer hacen lo mismo y al hacer scroll hacia abajo el fondo que es un degradado se corta en altura.

No se como solucionarlo, si me pueden echar una mano se lo agradezco de antemano ya.
  #2 (permalink)  
Antiguo 14/03/2012, 05:53
 
Fecha de Ingreso: abril-2006
Mensajes: 147
Antigüedad: 18 años
Puntos: 1
Respuesta: img de div no se ajusta al tamaño del navegador en iexplorer

esto me pasa para que lo veais mas claro:

  #3 (permalink)  
Antiguo 14/03/2012, 09:37
 
Fecha de Ingreso: marzo-2012
Mensajes: 30
Antigüedad: 12 años, 1 mes
Puntos: 2
Respuesta: img de div no se ajusta al tamaño del navegador en iexplorer

He abierto el enlace y veo q ya lo has solucionado,no?

Yo crearía una imagen para el fondo y metería el logo y el form aparte, estableciendo valores de ancho y alto.

Cómo lo has hecho tú?

Un saludo.
  #4 (permalink)  
Antiguo 14/03/2012, 12:04
 
Fecha de Ingreso: abril-2006
Mensajes: 147
Antigüedad: 18 años
Puntos: 1
Respuesta: img de div no se ajusta al tamaño del navegador en iexplorer

pues aun no lo he solucionado. El problema lo tengo con internet explorer.
  #5 (permalink)  
Antiguo 14/03/2012, 17:31
Colaborador
 
Fecha de Ingreso: junio-2007
Mensajes: 5.798
Antigüedad: 16 años, 10 meses
Puntos: 539
Respuesta: img de div no se ajusta al tamaño del navegador en iexplorer

Para la imagen al 100%:
cree un div hijo directo de body con las propiedades:
Código CSS:
Ver original
  1. #fondo-imag {
  2.     height: 200%;
  3.     left: -50%;
  4.     position: fixed;
  5.     top: -50%;
  6.     width: 200%;
  7. }
coloque dentro de él la imagen que quiere que se extienda al 100% y le declara:
Código CSS:
Ver original
  1. #fondo-imag img {
  2.     bottom: 0;
  3.     left: 0;
  4.     margin: auto;
  5.     min-height: 50%;
  6.     min-width: 50%;
  7.     position: absolute;
  8.     right: 0;
  9.     top: 0;
  10. }
Por supuesto, no se olvide de incluir:
Código CSS:
Ver original
  1. html, body {
  2.     height: auto !important;
  3.     min-height: 100%;
  4.     width: 100%;
  5. }
¿Se fijó que la parte izquierda del texto queda inaccesible al reducir la ventana?
Sugerencia:
Cambios a realizar en su css:
Código CSS:
Ver original
  1. #logo {
  2.     margin: 0 auto;
  3.     position: relative;
  4.     width: 535px;
  5.     z-index: 50;
  6. }
  7.  
  8. #form {
  9.     margin: 0 auto;
  10.     position: relative;
  11.     width: 535px;
  12.     z-index: 50;
  13. }
  14.  
  15. img.logo {
  16.     display: block;
  17.     margin: 15px auto;
  18. }
img.logo es su imagen del águila.
__________________
Por una web con mucho estilo
+++ CUENTA ABANDONADA. ¿la quieres? +++

Etiquetas: contenido, explorer, firefox, html, iexplorer, img, navegador, tamaño, fondo
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 10:44.