ncesar
ncesar

Reputation: 1792

Not being able to center this div in Wordpress

i'm having some problem to center this div in wp. img

This booking.com widget is inside the div class, the container i assume.

.et_pb_widget_area .et_pb_widget_area_left .clearfix et_pb_module 
.et_pb_bg_layout_light  .et_pb_sidebar_0 .et_pb_sidebar_no_border

That is from Divi Theme Builder. His dimensions are 1036 x 341.188;

Tried to put margin: 0 auto in the booking.com class that is(dimensions 362.594 x 284.219):

.et_pb_widget bos_searchbox_widget_class

But no success. I also tried setting max width: 100% to the container and margin: 0 auto; to the search box but also no success.

If needed, its the plugin Booking.com Official Search Box.

Also, this is the website i'm trying to center this: http://198.199.66.183/

Can someone please help me?

Upvotes: 0

Views: 87

Answers (1)

CaliCo
CaliCo

Reputation: 388

Give this a shot in your CSS, tested and it seems to work:

.et_pb_sidebar_0.et_pb_widget_area .et_pb_widget{
    width: 35%;
    margin: 0 auto;
    text-align: center;
    display: block;
    float: none;
}

Expected outcome: enter image description here

Code was edited with the live inspector in chrome, here's the code inside the inspector and which element I selected to get this to work:

enter image description here

Hope this helps! Good luck!

Upvotes: 1

Related Questions