I have the basis on HTML/CSS on how to strucure a webpage (flex display, inline-block, relative/absolute position & float). Also the block / inline concept.
I would like to center a h1 block with a border which is adjusted with the content inside. Is it possible to do that without using div ? Just using h1 block & CSS (see picture below).
Here the code is the following :
HTML :
<div id="divJoyeux"><h1 id="unJoyeux">Test</h1></div>
CSS :
#divJoyeux
{
margin: center;
text-align: center;
}
#unJoyeux
{
color: orange;
border: solid;
display: inline-block;
text-align: center;
margin: center;
border-color: black;
}
I don't see how it's possible to do only with h1 block. Thanks !