I am trying to show div one by one horizontally. I have tried using display: grid, but not working properly. Getting some space between div. I do not know why that space is coming between the div. How to resolve this issue using CSS.
Getting like this: image
Expecting like this image
.box {
position: relative;
padding: 13px;
background-color: #ccc;
border-radius: 9px;
height: 100%;
min-height: 25px;
}
.title-message {
font-size: 16px;
}
.grid-container-element {
display: grid;
grid-template-columns: 1fr 1fr;
grid-gap: 0px;
border: 1px solid black;
min-width: 97.5px;
height: 32px;
margin-left: 12px;
float: left;
}
.grid-child-element-1 {
margin: 3px 1px 1px 1px;
border: 1px solid red;
height: 24px;
font-size: 7px;
width: 23.4px;
float: left;
}
.grid-child-element-2 {
margin: 3px 1px 1px 1px;
border: 1px solid red;
height: 24px;
font-size: 7px;
min-width: 64.35px;
float: left;
}
.text {
font-size: 7px;
margin: 0px;
word-wrap: break-word;
min-width: 23.4px;
}
.num {
font-size: 7px;
margin-top: 7px;
}
<div class="box">
<p class="title-message">Content</p>
<div class="grid-container-element">
<div class="grid-child-element-1">Grid</div>
<div class="grid-child-element-2">
<div class="text">Text 1 Text 1Text 1Text 1Text 1Text 1Text 1Text 1Text 1Text 1Text 1Text 1Text 1Text 1</div>
<div class="num">1234</div>
</div>
</div>
</div>