Asked • 03/27/19

How do you easily horizontally center a <div> using CSS?

I'm trying to horizontally center a `
` block element on a page and have it set to a minimum width. What is the simplest way to do this? I want the `
` element to be inline with rest of my page. I'll try to draw an example: page text page text page text page text page text page text page text page text ------- | div | ------- page text page text page text page text page text page text page text page text

1 Expert Answer

By:

Ian M. answered • 03/27/19

Tutor
5.0 (2,509)

Professional Web Designer, Developer, UI/UX

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.