How can i prevent content to not exceed the length of container?
I am showing a list of clients on a page and on the right side i have a calendar showing to schedule a new date for appoinment. When testing the output i found that if there are lot of clients coming on that day, the list excee开发者_如何学JAVAds the length of the container. What to do about this..
some code:
container:
#container {
background-color: #FFFFFF;
margin:0 auto;
min-height: 600px;
width: 900px;
border:0px solid #999999;
margin-top:30px;
font-size:15px;
color: #000000;
margin-bottom:60px;
position:absolute;
}
#calendar {
margin-left:400px;
}
Do you want #container to expand at all?
If not, change min-height to height, and add overflow:hidden;
An even better solution would be to modify whatever is supplying the data so that you only receive a pre-determined number of clients at any given time.
Use min-height. Example:
min-height: 300px;
If you specify this style, the element will be 300px high, or tall enough to contain its contents - whichever is higher.
(Note that not all web browsers work with min-height.)
Is overflow: auto;
what you're looking for? If the content exceeds the size of the container, it adds scroll bars.
精彩评论