Hi, I’ll just post my code . I did exactly the same as I read online that should work.
<!DOCTYPE html>
<html>
<head>
<title>Page title </title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="style.css"/>
</head>
<body>
<p class="center"> text to center on screen </p>
</body>
</html>
*{
margin:0;
border:0;
padding:0;
}
body {
position: absolute;
display: block;
}
.center {
position: relative;
width: calc(100% - 2em);
float: none;
margin: auto;
}
I read that you need position relative or static, display block , a width, float none , and then margin:auto should work.
I have a rather old laptop , maybe that has something to do with it? I’m using firefox.
and windows 7.
Thanks