Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to decrease space between headings?

Tags:

html

css

i make a div and inside i make headings but when i show then headings are outside div how to decrease 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 css:

#companyname{
text-align:left;
font-size:13px;
}
#companyaddress{
text-align:left;
width:68%;
font-size:13px;
}
#companycountry{
text-align:left;
font-size:13px;
}
like image 505
Arsal Ali Avatar asked Dec 19 '22 23:12

Arsal Ali


2 Answers

Like this

demo

css

h5{
    margin:0;
    padding:0;
}
like image 181
Falguni Panchal Avatar answered Jan 06 '23 05:01

Falguni Panchal


try adding

h5
{
line-height:10px;
}

i have used 10px you can use values accordingly to your need

Fiddle Demo

Setting up the margins and padding accordingly is also a good option

h5 {
    margin:0px;
    padding:0px;
}
like image 20
Vinay Pratap Singh Bhadauria Avatar answered Jan 06 '23 05:01

Vinay Pratap Singh Bhadauria