Foros del Web » Creando para Internet » CSS »

box se pasa del margen

Estas en el tema de box se pasa del margen en el foro de CSS en Foros del Web. hola! necesito ayuda, hice un box para meter contenido pero cuando hay un texto muy largo, el box se pasa del margen: intente ponerle un ...
  #1 (permalink)  
Antiguo 06/05/2012, 19:55
 
Fecha de Ingreso: agosto-2011
Ubicación: Argentina
Mensajes: 46
Antigüedad: 12 años, 8 meses
Puntos: 0
box se pasa del margen

hola!
necesito ayuda, hice un box para meter contenido pero cuando hay un texto muy largo, el box se pasa del margen:



intente ponerle un height pero sigue igual, les paso el codigo css:

Código PHP:
.abouttablehead {
    
background-imageurl("../images/tpbk5289.jpg");
    
background-positionleft top;
    
background-repeatno-repeat;
    
border-left1px solid #D4D4D4;
    
border-right1px solid #D4D4D4;
    
border-top1px solid #D4D4D4;
    
color#DA7146;
    
fontbold 16px Arial,Helvetica,sans-serif;
    
height55px;
    
padding5px 0 0 5px;
    
vertical-aligntop;
}
.
abouttabletext {
    
border-bottom1px solid #D4D4D4;
    
border-left1px solid #D4D4D4;
    
border-right1px solid #D4D4D4;
    
font-familyVerdana,Arial,Georgia,serif;
    
font-size13px;
    
padding0 10px 20px;
}
.
imagen{
border1px solid #ccc;
padding2px 2px 2px 2px;
floatleft;
}
.
imagen:hover{
border1px solid #000;
padding2px 2px 2px 2px;
floatleft;
}
.
megustajaja {
    -
moz-border-bottom-colorsnone;
    -
moz-border-imagenone;
    -
moz-border-left-colorsnone;
    -
moz-border-right-colorsnone;
    -
moz-border-top-colorsnone;
    
backgroundurl("../images/bfs.gif"repeat-x scroll left bottom #FAFAFA;
    
border-bottom1px solid #CCCCCC;
    
border-left1px solid #CCCCCC;
    
border-radius0 0 5px 5px;
    
border-right1px solid #CCCCCC;
    
border-top1px solid #E9E9E9 !important;
    
box-shadow0 2px 3px #EEEEEE;
    
floatleft;
    
height32px;
    
margin-left78px !important;
    
positionrelative;
    
width614px;
    
word-wrap: break-word;
}
.
megustajaja .date {
    
floatleft;
    
font-weightnormal;
    
margin!important;
    
padding-top4px;
}
.
megustajaja a:hover {
    
text-decorationnone;
}
.
butonsitomarcosxd {
    
color#666666;
    
displayblock;
    
floatleft;
    
font-size12px;
    
font-weightbold;
    
height25px;
    
padding7px 10px 0 14px;
}
.
clickear {
    
border-radius0 3px 3px 0;
    
color#666666;
    
floatleft;
    
font-size12px;
    
font-weightbold;
    
height20px;
    
line-height21px;
    
padding0 4px;
    
positionrelative;
}
.
clickear {
    
backgroundurl("../images/clickear.png"no-repeat scroll left bottom transparent;
    
floatleft;
    
height27px;
    
margin0;
    
padding5px 5px 0 0;
}
.
botonsitodemegusta {
    
color#7F7F7F;
    
floatright;
}
.
botonsitodemegusta a {
    
color#B2B2B2;

y html:

Código PHP:
<table width="55%" cellspacing="0" cellpadding="0">
<
tbody><tr><td class="abouttablehead">
<
div><b>Escrito por '.$usuariomuro['nombre'].' '.$usuariomuro['apellido'].' el '.$muro['fecha'].'</b></div></td></tr>
<
tr><td class="abouttabletext">
<
a href="'.$url.'/profile.php?id='.$usuariomuro['id'].'" style="text-decoration: none;"><img src="'.$usuariomuro['image'].'" width="60" class="imagen"></a><div style="margin-left: 80px;">
'.$muro['mensaje'].'
<br></div>
</
span></div></td></tr>
</
tbody></table>
<
div class="clearfix megustajaja">
        <
div class="date-icon">

        </
div><a href="/posts/tv-peliculas-series/13885351.ultima/The-Finder-Temporada-1-_Post-Actualizable_-HDTV-y-720p.html" style="float: right; text-decoration: none; font-family: Klavika Regular; font-size: 14px; padding-left: 15px; padding-right: 15px;" class="botonsitodemegusta butonsitomarcosxd clickear">Comentar</a><a onclick="window.open(this.href, this.target, \'width=400px,height=400px\'); return false;" href="http://190.97.43.76/acciones/compartirpub.php?id=101" style="float: right; text-decoration: none; font-family: Klavika Regular; font-size: 14px; padding-left: 15px; padding-right: 15px;" class="botonsitodemegusta butonsitomarcosxd clickear">Compartir</a><a href="http://190.97.43.76/acciones/nomegustapub.php?id=101" style="float: right; text-decoration: none; font-family: Klavika Regular; font-size: 14px; padding-left: 15px; padding-right: 15px;" class="botonsitodemegusta butonsitomarcosxd clickear">Ya no me gusta</a></div
gracias
  #2 (permalink)  
Antiguo 06/05/2012, 21:12
Avatar de Naahuel  
Fecha de Ingreso: marzo-2011
Ubicación: localhost
Mensajes: 796
Antigüedad: 13 años, 1 mes
Puntos: 192
Respuesta: box se pasa del margen

El problema es con las palabras demasiado largas aparentemente. Si usás espacios seguramente eso no pasa. Es poco probable que pase, pero si te querés resguardar, podés usar este código que "rompe" las palabras si se pasan del ancho:

Código CSS:
Ver original
  1. .contenedor{
  2.   width: 300px; /* Cambialo por el ancho que necesites */
  3.   overflow: auto;
  4.   white-space: -moz-pre-wrap; /* Mozilla */
  5.   white-space: -hp-pre-wrap; /* HP printers */
  6.   white-space: -o-pre-wrap; /* Opera 7 */
  7.   white-space: -pre-wrap; /* Opera 4-6 */
  8.   white-space: pre-wrap; /* CSS 2.1 */
  9.   white-space: pre-line; /* CSS 3 (and 2.1 as well, actually) */
  10.   word-wrap: break-word; /* IE */
  11. }
__________________
nahueljose.com.ar

Etiquetas: html
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 05:54.