When I add a width attribute to my #information h1 id, it seems to override the text-align: center; property and aligns the text/background to the left instead of center.
Basically, I need assistance in centering the headers with the appropriate background width so that there is no extra background on the sides.
I am completely new to this - this is my first time playing around with html and css - I just started my course a day or two ago.
CSS
#information h1{
text-align: center;
font-family: Tahoma;
color: lightcoral;
background-color: whitesmoke;
width: 130px;
margin: 2px;
border-radius: 25px;
box-shadow: 2px 2px 2px grey;
font-size: 25px;
}
HTML
<section id="information">
<h1>Information</h1>
<p>Currently starting my course on becoming a full stack engineer while working on a BS in Computer Science. Open to pretty much anything!<br>
Looking for part-time or full-time work while I attend school and courses also open to any development projects!
</p>
<h1>Hobbies + More</h1>
WITH WIDTH ATTRIBUTE
Headers how I want them but not centered
WITHOUT WIDTH ATTRIBUTE Headers without width