HTML Widget Issue: Display Grid
-
Hi All,
I’m using the HTML widget to create a responsive grid, but for some reason when I try to add an “auto-fit” style to the grid, it creates an extra blank cell at the beginning of the grid. Why is this? I haven’t been able to get rid of it. The code runs perfectly when not in Elementor.
Many thanks!<style> *{ box-sizing: border-box; } body { background-color: #FFFFFF; padding: 20px; font-family: Arial; } /* Center website */ .main { max-width: 100%; margin: auto; } /*Create responsive columns*/ .row { margin: 10px -16px; /*display divs in a grid, and have the number of columns automatically change so the divs are always at least 300px wide */ display: grid; grid-template-columns: repeat(auto-fit,minmax(300px, 1fr)); } /* Add padding BETWEEN each column */ .row, .row > .column { padding: 8px; } /* Style columns */ .column { float:left; display: none; /* Hide all elements by default */ } /* Clear floats after rows */ .row:after { content: ""; display:table; clear: both; } /* Content */ .content { position: relative; background-color: #DCDCDC; padding: 10px; padding-right: 20px; } .text { color: white; font-size: 14px; position: absolute; top: 10%; left: 10%; right: 10%; /*old code top: 20%; left: 20%; transform: translate(-20%, -20%); -ms-transform: translate(-20%, -20%); */ text-align: justify; line-height: 1.5 } #clients { font-size: 22pt; font-family: Arial; } .overlay { position: absolute; bottom: 0; left: 0; right: 0; background-color: rgba(110,193,228,0.83); overflow: hidden; width: 100%; height: 0; transition: .5s ease; } .content:hover .overlay { height: 100%; } /* The "show" class is added to the filtered elements */ .show { display: block; }- This topic was modified 7 years, 9 months ago by .
- This topic was modified 7 years, 9 months ago by .
- This topic was modified 7 years, 9 months ago by .
- This topic was modified 7 years, 9 months ago by .
The page I need help with: [log in to see the link]
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘HTML Widget Issue: Display Grid’ is closed to new replies.