I have 2 div components, Is there a way to make it inline. Right now it is coming in 2 lines
<div style = "padding-left:10px"><h4 class ="line" >Sev: </h4></div>
<div style = "padding-left:10px"><span class="center"> Weekly : 122</span></div>
I have 2 div components, Is there a way to make it inline. Right now it is coming in 2 lines
<div style = "padding-left:10px"><h4 class ="line" >Sev: </h4></div>
<div style = "padding-left:10px"><span class="center"> Weekly : 122</span></div>
By default the div
container has a block
rendering behaviour.
If you want to have a default inline behaviour you may use span
tag instead, or if you prefer you can use CSS to change the rendering type by adding display: inline;
or display: inline-block;
if you want to have control over the width/height properties.
Your code may look like this :
<div style="display: inline-block; padding-left:10px"><h4 class="line" >Sev: </h4></div>
<div style="display: inline-block; padding-left:10px"><span class="center">Weekly : 122</span></div>
There is lots of way to doing that ,one way is that:
<div style = "display: inline-flex; padding-left:10px"><h4 class ="line" >Sev: </h4></div>
<div style = "display: inline-flex; padding-left:10px"><span class="center"> Weekly : 122</span></div>
second way:
<div style = "display: inline-grid; padding-left:10px"><h4 class ="line" >Sev: </h4></div>
<div style = "display: inline-grid; padding-left:10px"><span class="center"> Weekly : 122</span></div>