儿童div离开父母div [英] child div goes outside parent div

查看:65
本文介绍了儿童div离开父母div的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我正在使用CSS和HTML等设计网站.但是我在这里遇到了一个问题:当我向子级添加浮动对象时,我的子级div会超出父级div.该网站位于我的网站设计

Currently I am designing a website using CSS and HTML etc. But I have faced a problem there : my child div goes outside the parent div when I add floating to the child. The site resides here my web design

推荐答案

更具体.网站上的问题出在哪里?

Be more specific. Where is the problem on the website?

尝试将其添加到CSS中,以便父级会知道子级元素的大小:

Try to add this to css, so parent will know about the size of the child element:

#parent{
   overflow:hidden;
}

这篇关于儿童div离开父母div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆