Foros del Web » Creando para Internet » CSS »

[SOLUCIONADO] Color de fondo div

Estas en el tema de Color de fondo div en el foro de CSS en Foros del Web. No entiendo ni consigo saber porque no se pone el color blanco en todo mi div... @import url("http://static.forosdelweb.com/clientscript/vbulletin_css/geshi.css"); Código CSS: Ver original .cm_web {   ...
  #1 (permalink)  
Antiguo 16/02/2014, 12:02
 
Fecha de Ingreso: febrero-2014
Ubicación: Murcia
Mensajes: 119
Antigüedad: 10 años, 2 meses
Puntos: 0
Color de fondo div

No entiendo ni consigo saber porque no se pone el color blanco en todo mi div...

Código CSS:
Ver original
  1. .cm_web {
  2.     width: 995px;
  3.     height: auto;
  4.     margin: 0 auto;
  5.     clear: both;
  6. }
  7. .organiza {
  8.     background: #FFF;
  9.     height: 100px;
  10.     text-align: center;
  11.     width: 995px;
  12. }
  13.  
  14. #organiza{
  15. margin-bottom: 20px;
  16. }
  17.  
  18. #organiza h2{
  19. margin: 0 10px 30px 10px;
  20. }
  21.  
  22. #organiza .event {
  23.    float: left;
  24.    width: 450px;
  25.    padding: 0 5px 5px 5px;
  26.    margin: 0 5px 5px 5px;
  27. }
  28.  
  29. #organiza .event img {
  30.    float: left;
  31.    margin-right: 10px;
  32. }

Y el div

Código HTML:
Ver original
  1. <div id="organiza" class="cm_web">
  2. <h2>Info detallada fiestas de hoy</h2>
  3.  
  4. <div class="event">
  5. <a href="#"><img src="img/evento.jpg" width="120" height="120" class="logo fromdb rounded-3 photo" /></a>
  6.     <h2><a style="text-decoration:none;" href="#">Organiza tu evento</a></h2>
  7.     <p style="text-align: justify;"><span>textotextotextotextotextotextotextotexto texto texto texto texto texto texto texto texto texto texto textotextotextotexto textotexto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto&hellip;<span class="seemorelnk" data-href="#"> [Ver más]</span></span></div>
  8.    
  9. <div class="event">
  10. <a href="#"><img src="img/evento.jpg" width="120" height="120" class="logo fromdb rounded-3 photo" /></a>
  11.     <h2><a style="text-decoration:none;" href="#">Organiza tu evento</a></h2><p style="text-align: justify;">textotextotextotextotextotextotextotexto texto texto texto texto texto texto texto texto texto texto textotextotextotexto textotexto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto&hellip;<span class="seemorelnk" data-href="#"> [Ver más]</span></div>
  12.    
  13.     <div class="event"><a href="#"><img src="img/evento.jpg" width="120" height="120" class="logo fromdb rounded-3 photo" /></a>
  14.     <h2><a style="text-decoration:none;" href="#">Organiza tu evento</a></h2><p style="text-align: justify;">textotextotextotextotextotextotextotexto texto texto texto texto texto texto texto texto texto texto textotextotextotexto textotexto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto&hellip;<span class="seemorelnk" data-href="#"> [Ver más]</span></div>  
  15.      
  16. <div class="event">
  17. <a href="#"><img src="img/evento.jpg" width="120" height="120" class="logo fromdb rounded-3 photo" /></a>
  18.     <h2><a style="text-decoration:none;" href="#">Organiza tu evento</a></h2><p style="text-align: justify;">textotextotextotextotextotextotextotexto texto texto texto texto texto texto texto texto texto texto textotextotextotexto textotexto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto&hellip;<span class="seemorelnk" data-href="#"> [Ver más]</span></div>    
  19.     </div>
  #2 (permalink)  
Antiguo 16/02/2014, 12:13
Avatar de vick90  
Fecha de Ingreso: abril-2010
Mensajes: 144
Antigüedad: 14 años
Puntos: 14
Respuesta: Color de fondo div

Este es el error:
Código CSS:
Ver original
  1. .organiza {
  2.     background: #FFF;
  3.     height: 100px;
  4.     text-align: center;
  5.     width: 995px;
  6. }

Cambialo por
Código CSS:
Ver original
  1. #organiza {
  2.     background: #FFF;
  3.     height: 100px;
  4.     text-align: center;
  5.     width: 995px;
  6. }
  #3 (permalink)  
Antiguo 17/02/2014, 02:46
 
Fecha de Ingreso: febrero-2014
Ubicación: Murcia
Mensajes: 119
Antigüedad: 10 años, 2 meses
Puntos: 0
Respuesta: Color de fondo div

No lo cubre por completo.. cubre los 100px de height pero si pongo auto tampoco cubre todo..tendría que poner 500 px

Aqui creo que puedes ver el resultado

[URL="http://jsbin.com/qugad/10/edit"]http://jsbin.com/qugad/10/edit[/URL]
[URL="http://jsbin.com/qugad/10"]http://jsbin.com/qugad/10[/URL]

Última edición por RaulCDT; 17/02/2014 a las 02:56 Razón: añadir problema
  #4 (permalink)  
Antiguo 17/02/2014, 05:22
Avatar de Crazylegs  
Fecha de Ingreso: septiembre-2013
Ubicación: Barcelona
Mensajes: 74
Antigüedad: 10 años, 7 meses
Puntos: 14
Respuesta: Color de fondo div

Si flotas elementos dentro del div para que no se salgan de este debes poner overflow:hidden:

Código CSS:
Ver original
  1. #organiza{
  2.     background:#fff;
  3.     overflow:hidden;
  4. }
__________________
¡Mira mis tutoriales web!

Última edición por pzin; 17/02/2014 a las 05:37

Etiquetas: background, color
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 04:48.