I am currently working on a small little personal project which is just a simple page which displays the total amount of COVID-19 cases. I am quite new to HTML and CSS and was just wondering what the best way is to put these items in a container and directly centre them both horizontally and vertically. I have looked around quite a bit and have been unable to find what I am looking for. This is the current code that I am using
<body>
<script src="https://code.jquery.com/jquery-3.5.0.min.js" integrity="sha256-xNzN2a4ltkB44Mc/Jz3pT4iU1cmeR0FkXs4pru/JxaQ=" crossorigin="anonymous"></script>
<div id="display"></div>
<script type="text/javascript">
$.ajax({
url: 'https://api.thevirustracker.com/free-api?global=stats',
dataType: 'json',
success: function(data) {
document.getElementById('display').textContent = data.results[0].total_cases.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")
}
});
</script>
I know that I am going to want to put the div container tags around the start and end of the script command. Any help would be greatly appreciated.