Adjust the height of the card in Divi

I was hoping to increase the height of the google map module in Divi, but my CSS code does not work and does not understand why. I insert the following code in Advanced> Custom CSS> The main element of the map module

.et_pb_map {
     height: 440px;
}

Any suggestions would be very helpful!

+5
source share
11 answers

Absolute Map for Divi Theme

  • Add the following CSS in the line settings / custom CSS / column "1" The main element (the column number is where you put the map):
    position:relative;
  1. Add a class module to the map. In this example, the CSS class is absolute_map Add the following CSS to the Custom CSS field:
.absolute_map .et_pb_map {
    position: absolute;
    overflow:visible;
    height: 100%; 
}
  1. Be happy!
+1
source

padding height.

#map ,#map .et_pb_map {padding-bottom: 56.25%}

, . #map .

, . .

, , , - iframe - , .

JSFiddle

0

(Advanced > Custom CSS > Main Element) Divi Builder, CSS.

 height: 440px;
0

css > css. 440px.

0

! css

.et_pb_map {
     height: 440px !important;
}
0

! css

.et_pb_map {
     height: 440px !important;
}
0

.

, API Google js.

/ , #div_gmap.

      #div_gmap {
        height: 440px;
      }
<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap"
    async defer></script>
<div id="div_gmap"></div>
    <script>
      var map;
      function initMap() {
        map = new google.maps.Map(document.getElementById('div_gmap'), {
          center: {lat: 22.3039, lng: 70.8022},
          zoom: 12
        });
      }
    </script>
    
Hide result

, , css , .

0

, CSS , - chrome dev.

Shift+ Ctrl + I ( cmd + alt + I, ) -. , . , DOM, <div class="et_pb_map">...</div>, ctrl + f et_pb_map.

, .

, , padding/margin , . , , . embed, <div class="et_pb_map" style="...">...</div>, .

Chrome Chrome

0

→ → CSS

.et_pb_map iframe {height: 400px !important; }

jsfiddle

0

, . , .. .map-height, :

.map-height .et_pb_map {
    overflow:visible;
    height: 500px!important;
}
0

:

  1. Divi Theme Options
  2. Custom CSS
  3. .et_pb_map {height:500px;}
  4. Save Changes ( 500px)
0

Source: https://habr.com/ru/post/1681003/


All Articles