To change the alignment of the content, we use the text-align
property.
<head>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1 class="center">Welcome!</h1>
</body>
.center {
text-align: center;
border-radius: 100px;
background-color: lightBlue;
}
To center-align content, we set the text-align
property to center
.
<head>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1 class="center">Welcome!</h1>
</body>
.center {
text-align: center;
border-radius: 100px;
background-color: lightBlue;
}