u can do it by targeting the specific class for ex:
style.css
.sample{
margin: 10px ( it takes each sides from top, left, right, bottom );
padding: 10px ( it takes also each sides from top, left, right, bottom but it compressed the content inside of a div so kapag may content ka sa loob ng targeted div mo, malalagyan sya ng margin sa loob );
}
and there's position property where it based naman sa specific attributes for ex:
.sample{
position: absolute; ( what this do is u're removing the element inside of it's parent elements so u can move it freely by using properties. positions also comes with variety of attributes such as relative, sticky, block, static, and fixed )
left: 10px; ( u're positioning 10px from left and it can also be done in different properties left, right, top, and bottom )
}
hope this helps.