Question

Quick question. I have two rectangles and then text. I want to put the text inside the first rectangle and not the second. When I put e.g. top:2px; for the text it will base it off one of the rectangles, but not the one I want. So I want to do it so if you put 2px; then it will move it 2 pixels from the one I want. Anyone got idea why this is happening? I think it may have something to do with positioning.

Pas de solution correcte

Autres conseils

Can try this..

.rectangle-one{
position:relative;
}
.text{
position:absolute;
top:2px;
}
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top