How do I achieve that the Div does not overflow? [closed]

$(document).ready(function() {

//Botones de la comida
var bon = document.getElementById('boton1');
bon.addEventListener("click", agregar1);

var bona = document.getElementById('boton2');
bona.addEventListener("click", agregar2)

  //Funciones para agregar la comida al recuadro en blanco

function agregar1() {
$('<p>Hamburguesa - 50 pesos </p>').appendTo('#preciosC');

function agregar2() {
$('<p>pizza - 100 pesos</p>').appendTo('#preciosC');

asked by Ricardo A 15.06.2016 в 04:12

1 answer


The container has a fixed height, the child elements of this container exceed this size, therefore they overflow.

This is the default behavior, but you can alter it with the overflow css property.

For example, if you want this container to have scroll functionality, you can use overflow: scroll

Another way, is to modify the behavior of the container, for example by giving it the high automatic property and not limited to one size.

answered by 15.06.2016 / 06:23