How to center <h3>
in the following code?
h1 {
color: #666;
margin: 20px 10px 0px;
padding: 0px 30px 0px 30px;
text-align: center;
}
h3 {
color: #ccc;
background-color: black;
margin: 0px;
padding: 10px 10px 10px 10px;
text-align: center;
display: inline-block;
}
<div>
<h1>title 1</h1>
<h3>title 3</h3>
</div>
FIDDLE
Just apply this css property to the div i.e text-align:center;
like this
<div style="text-align:center;">
<h1>title 1</h1>
<h3>title 3</h3>
</div>
Here is the example: https://jsfiddle.net/egv269x0/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With