Currently, I have some div elements that display nicely on desktop and tablet devices. However, the issue arises when the view is switched to mobile, as the elements appear disorganized and do not adjust appropriately.
My goal is to have these elements automatically adjust their layout: showing 3 in a line on a tablet and 2 in a row on a mobile device, similar to the desired outcome shown here:
I believe using the col-xs-6
class in Bootstrap should achieve this responsive layout, but adding it doesn't seem to have the desired effect.
Below is the HTML code:
<div id="surveys" class="surveys col-xs-12"><div>
/* HTML code continues */
And the corresponding CSS:
#surveys h4 {
/* CSS code for h4 element */
}
/* Additional CSS styles */
Any suggestions on how to make these elements shift responsively would be greatly appreciated. Thank you!
EDIT - Including the updated HTML with row
and col-xs-6
classes, along with the resulting output:
<div id="surveys" class="surveys col-xs-12">
/* Updated HTML code */
View on Laptop (padding seems to be added outside the divs): Laptop View
View on Mobile (appears more scrunched up): Mobile View
EDIT - The issue may be in the CSS snippet below, as it seems to disrupt the functionality when re-added:
#surveys .survey-item {
/* Problematic CSS */
}