So, I have this code
<div id="timer"> </div>
How can I centrate this in HTML5? I tried but as far I as know, it's obsolete for HTML5 and I must use CSS Any help?
So, I have this code
<div id="timer"> </div>
How can I centrate this in HTML5? I tried but as far I as know, it's obsolete for HTML5 and I must use CSS Any help?
You can't (or, more specifically, shouldn't) do any kind of styling in HTML, that's what the CSS exists for.
The text-align
property could be a beginning.
Here is a great source of information : https://www.w3schools.com/css/
You can achieve this by using Flexbox. Try below code snippet it'll help you out. Thanks
#parent {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
<div id="parent">
<div id="timer">Timer</div>
</div>