Home >Web Front-end >HTML Tutorial >How to solve the impact on the parent element after setting margin-top on the child element

How to solve the impact on the parent element after setting margin-top on the child element

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-09-23 03:30:131062browse

Solution:

1. Add: overflow:hidden.

to the parent element

2. Add a border to the parent element;

3. Add padding to the outer container.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn