Reputation: 295
I need to set a 4px
space between all html internal components (in any direction top bottom left right). I am using an external css file for this. I tried this:
body {
padding: 2px;
border: 0px;
margin: 0px;
}
But this sets a space of 4px
for all body not between it's components.
Also,
{
display: inline-block;
padding: 4px;
}
is not working either.
Can you please help. I am not allowed to change the html page.
Upvotes: 1
Views: 1311
Reputation: 351
Looks like you need to set for the elements used on HTML , if you are using Css preprocessor , then you can declare the values at the top and later it will be used by all the elements like shown below :-
$standard-padding :2px;
$standard-border:0px;
$standard-margin:0px;
body,p,h1,h2,div,span{
padding: $standard-padding;
border: $standard-border;
margin: $standard-margin;
}
Upvotes: 0
Reputation: 701
You can use
body * {
margin: 2px;
}
Which will set that margin to every element inside of the body tag.
Upvotes: 3