.service-info p {
padding: 100px 0;
font-weight: 500;
color: red;
width: 50%;
}
.service-info {
text-align: center;
place-content: center;
position: relative;
width: min(95%, 70rem);
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div class="service-info">
<h1>servces</h1>
<p>lorem ipsum randomaora ni salisum pumm.lorem ipsum randomaora ni salisum pumm.lorem ipsum randomaora ni salisum pumm.lorem ipsum randomaora ni salisum pumm.lorem ipsum randomaora ni salisum pumm.lorem ipsum randomaora ni salisum pumm.</p>
</div>
</body>
</html>
So... as you can see here, i've specified the width of the parent element,But i want the paragraph to be in the middle of the webpage while it's width is specified. I've tried it but didn't work, once i text align the paragraph specify it's width, it shifts to the left. I want to centerly align the paragraph text while it has a specific width. Do i use flex or is there something i'm missing?