html - How to use padding/margin to move a div? -
Easy questions for CSS Masters
I created two squares using div squares. The first one is black and has a red one in it. Every time I want to take the red square into the black square, the black square goes down with it. How can I stop it?
& lt; Div class = "black" & gt; & Lt; Div class = "red" & gt; & Lt; / Div & gt; & Lt; Div & gt; .black {width: 500px; Height: 500px; Background: black; } I do not want the black square to go down. How do I stop this? .red {width: 100px; Height: 100 pixels; Background: Red; Margin-top: 50px; Margin-left: 60px; } Thanks in advance!
.black status complete . .black {width: 500px; Height: 500px; Background: black; Status: Completed; } property value: absolute element has been positioned according to its position (not stable) Ancestor element
Comments
Post a Comment