Jump to content

How do I get the containers with the same width?


Il Domandatore

Recommended Posts

The email address is too wide and causes the box to stretch. You can use the overflow-wrap rule to fix it.

fieldset {
  overflow-wrap: break-word;
}

I can't use a more specific selector since I don't know what the HTML on the details page looks like.

Link to comment
Share on other sites

The problem in that screenshot is that you've set the width of those options to 300px, so it is not permitted to get any smaller.

Delete this from your stylesheet:

.charitable-donation-form .donation-amounts .donation-amount {
    height: 150px;
      width: 300px;
    color: #000000;;
    border: 0;
    background-color: #ababab;
    border-radius: 99px;
    padding: 2px;
    text-align: center;
      margin: 6px;
}

And also this:

ul.donation-amounts {
    width: 300px;
}

  • Like 1
Link to comment
Share on other sites

max-width would be the proper replacement. If you set min-width you will still have the problem that the element is not allowed to be smaller than 300px and then doesn't fit in the screen.

Link to comment
Share on other sites

First you need to get parent container to be responsive and adjust to full width of device whether portrait or landscape orientation. Then how many colums to have to accommodate the content, this is can be for example 4 for wide width device such as desktop, 2 column device tablet and finally single column for moble phone.

You use css media queries to identify device width and adjust width of 4 columns 25% desktop, 2 columns 50%, tablet, 100% width 1 column mobile OR any widths you want! If the content wont fit on one line you have no alternative  but to let it go to two. You could aways adust rows to allow 2 lines of content set min-height to allow this so 1 line of content is centred vertically. Again! You can set this to happen on smaller width devices using media queries for specific width of device, also change font size etc.

Link to comment
Share on other sites

  • 2 months later...
On 12/3/2021 at 5:27 PM, Il Domandatore said:

On the desktop, the containers are the same width.
https://postimg.cc/7GX72m2H

On the other hand, on the mobile phone the dimensions are different and I don't know how to do it.
https://postimg.cc/06jqvN0V

The page is https://oldfreegame.com/en/campaigns/extend-the-website-contract/donate/

If you want to adjust width based on device width, you can use media queries

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...