Reputation: 1
I want to type words side by side.When I type words, they come one after the other.
Here's my problem:
I want to write this words side by side.Thanks for your help.
Upvotes: 0
Views: 41
Reputation: 105
There are two methods to achieve this.
First:
Use inline-block
on children
<div>
<p class="card" >privacy</p>
<p class="card" >policy</p>
</div>
<style>
.card {display: inline-block;}
</style>
Second:
Use flex
on parent element
<div class="container">
<p>privacy</p>
<p>policy</p>
</div>
<style>
.container {
display: flex;
}
</style>
Upvotes: 2
Reputation: 1581
By default the HTML elements are in display: block
, they appear one after another, this applies to all the elements
you can change this by changing the display property of the parent like
.dflex{
display:flex
}
<div class="dflex">
<div>A</div>
<div>B</div>
</div>
here all those children inside the parent will appear one after another
Upvotes: 0