Reputation: 1022
I make a div and inside I make headings but when shown the headings are outside the div. How do I decrease the heading margins?
Here is my code:
<div id="left" style="width:300px; height:100px; float:left; margin:5px 40px 0;">
<h5 id="companyname">{{companyname}}</h5>
<h5 id="companyaddress">{{companyaddress}},{{companycity}},</h5>
<h5 id="companycountry">{{companycountry}}</h5>
</div>
And here is the css:
#companyname{
text-align:left;
font-size:13px;
}
#companyaddress{
text-align:left;
width:68%;
font-size:13px;
}
#companycountry{
text-align:left;
font-size:13px;
}
Upvotes: 6
Views: 46167
Reputation: 2587
You have two Option.
Increasing the Height of the div
give css for h5 like this because by default h5 element takes some margin
h5{ margin:0px}
Upvotes: 0
Reputation: 28387
Question:
how to decrease heading margins?
Answer:
h5 { margin: 0px; }
Upvotes: 0
Reputation: 9947
try adding
h5
{
line-height:10px;
}
i have used 10px you can use values accordingly to your need
Setting up the margins and padding accordingly is also a good option
h5 {
margin:0px;
padding:0px;
}
Upvotes: 1