Jump to content
newcoder1010

How to center a block including list items

Recommended Posts

Hello,

 

I have this html:

<div class = "heroh">

<h4>Let us make a fair offer.
</h4>
<ul>
  <li>No commissions or fees </li>
  <li>You don’t pay for any repairs</li>
  <li>No listing</li>
</ul>
</div>
<h4>Just Complete This Quick Form</h4>
</div>

 

CSS;

.heroh {text-align:center}
.heroh ul {
    text-align: left;
}

Now it centers all except the list.

How to center heroh class including bullet points plus align left all the list items?

Thanks.

 

Share this post


Link to post
Share on other sites

I should add classname .heroh to that, or you will find every ul will start to have this styling applied to it.

Also you are missing an opening div tag, or you added one to many closing div tags.

Edited by dsonesuk

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×