Problema de diseño de la página web

I am having a problem with the layout of my webpage. I have 2 tables and those 2 tables both inside 2 divs. The problem I'm having is that when my web browser is resized the content in the second div moves below the first div.

Can anyone please tell me how this can be fixed?

preguntado el 03 de mayo de 12 a las 13:05

Please post your CSS and HTML part which contains your problem -

Are you floating these divs to make them next to each other? -

Añadiendo un min-width para usted body tag that is at LEAST the width of both divs is a possible solution, however without your code, it's hard to understand your situation completely. -

using center tag it may be help to you -

2 Respuestas

One way to fix this is to put a table outside of the divs. If the tables are inside of a structure div, resizing the browser will not force one div to move down.

contestado el 03 de mayo de 12 a las 13:05

Podrías probar algo como esto:

CSS
#leftcolumn { width: 300px; border: 1px solid red; float: left}
#rightcolumn { width: 300px; border: 1px solid red; float: right}

HTML
<div id="leftcolumn"><p>text goes here</p></div>
<div id="rightcolumn"><p>text goes here</p></div>

Also if you use float it affectivly removes that element from any surrounding div. To get around this problem try and add a div class which has 'clear' set to 'both' to your html. This make all the divs sit nicely in there container

Me gusta:

CSS
.clear { clear: both;}

HTML
<div id"container">
  <div id="leftcolumn"><p>text goes here</p></div>
  <div id="rightcolumn"><p>text goes here</p></div>
  <div class"clear"></div>
</div>

contestado el 03 de mayo de 12 a las 14:05

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.