0

I'm trying to center the div using css.

No problem assigning the padding size in pixels, but can't get it work with "auto".

<div id="main" class="clearfix">
 <div class="inner-wrap clearfix">
  <div id="primary">
   <div id="content" class="clearfix">

This it the page I need help with: https://armadaled.org/luminarias_bombillas_reflectores_rd/

Using this CSS added via WP Additional CSS it partially solves the problem, but it loses responsiveness in sense of smaller desktop screens, meantime mobile looks good.

It only works when applied to #main div.

.page-id-6711 #main {
    padding-top: 20px !important;
    padding-right: auto !important; 
    padding-left: 150px !important;
    width: 100% !important;
    height: 100% !important;
}

When logically I need to play with "primary" div's margins. What doesn't work.

I just need this "primary" div to be centered horizontally for all resolutions... But padding-left (right): auto combinations have no effect at all.

Is this related to clearfix? Just don't know where else to look for.

I tried all possible combinations assigning the width in pixels.

empiric
  • 7,825
  • 7
  • 37
  • 48
  • For your page you can try this piece of css- `.page-id-6711 #primary { float: left; width: 100% !important; }` – Hakik Zaman Sep 29 '20 at 13:23
  • When I try to use this code, all content is centered, yes, but it's stretched. When I put .page-id-6711 #primary { float: left; width: 800px !important; } it's on the left again... – nffox007 Sep 29 '20 at 19:39
  • Please try this- `.page-id-6711 #primary {float: none !important; margin: 0 auto; }` – Hakik Zaman Sep 30 '20 at 06:53
  • God bless you!!!!! Thanks, it worked!!!! – nffox007 Sep 30 '20 at 10:36
  • If it worked please upvote my comment. In that case, others can be benefited from here. If you don't know how to upvote here is the [Link](https://rb.gy/ioqjru) – Hakik Zaman Oct 03 '20 at 06:22

0 Answers0