Home > front end >  A small problem about CSS
A small problem about CSS

Time:09-16

I'm in a div nested a div div adjust the vertical position to the second (margin 10 px auto) div outside as inside div moved together???????
Why then add a number to the first div, also added a second div elements, and assigned position is only the second div mobile

CodePudding user response:

CSS in the margin of the first child node - top will effect to the parent element

Added 1 div (1 belong to the text nodes), it is not the first child node

CodePudding user response:

1/f, reference wind 灬 cloud response:
CSS in the margin of the first child node - top will be applied to the parent element

Added 1 div (1 belong to the text nodes), it is not the first child node
if I just want to let the child elements around mobile, how should change

CodePudding user response:

The parent element to add overflow

CodePudding user response:

reference 4 floor aiweiya520 response:
parent element to add overflow
thank god
  • Related