Limit html div

-2

I'm printing content from an array into a div. The problem is that when the array has multiple data it passes to div.

$titles = ""; 
foreach($array_resultados as $key =>$value){
    $titles .= "<div>".$value['title']."</div>"; 
}

And my div

echo" 
    <td class='cal_today'>

        <div class =divtoday>
            ".$titles."</div>
    </td>";

I wanted to print all the data without any passing the div.

    
asked by anonymous 04.11.2014 / 15:30

1 answer

2

If I understood your question correctly, consider the following divs:

<div class="um">
    <div class="dois">
        asdf<br />
        asdf<br />
        asdf<br />
        ...
    </div>
</div>

With the following css properties:

.um {
    max-height: 300px;
    display: block;
}

.um .dois {
    border: 1px solid #f00;
    overflow: scroll;
    max-height: inherit;
}

Explaining: You have to define in your css the parent div and the child div (one and two, respectively). To do the div child I used the inherit property, which makes the child div always inherit the max-height value of the parent.

See the demo here .

    
04.11.2014 / 18:11