I’m making a personal website for fun and practice and i would like to have some blocks of text be next to each other so they align with the sides of the page horizontally but they’re on the same level vertically. Each block has its own header so it’s able to be distinguished from the other ones. I’m open to using HTML and/or CSS for this.
>Solution :
There are numerous ways of doing this with HTML and CSS, but for a beginner I would recommend looking at adding the display: inline-block
css property to wrapper elements around the content. For example,
section {
display: inline-block;
}
<body>
<section>
<h3>Hello</h3>
<p>World</p>
</section>
<section>
<h3>Hello</h3>
<p>Pluto</p>
</section>
</body>
You can also look into Flexbox and CSS Grid in the future, but they are more complicated to get your head around when starting out. Good luck!