-
AuthorPosts
-
October 20, 2023 at 5:01 pm #1423153
Hi
At some websites, the cookie message and the buttons are not at the same line.
Can we add some CSS code for that all is on the same line?
See examples in the private content section.
Best regards
MikeOctober 21, 2023 at 10:41 pm #1423269Hey Michael,
Thank you for the link to your sites, as I understand your request you would like the two cookie consent buttons to always be side-by-side (inline) and the cookie consent text to be inline next to the buttons, but at smaller screens the text should become multiple lines and still inline with the buttons.
Try this CSS in your Enfold Theme Options ▸ General Styling ▸ Quick CSS field for each site:.avia-cookie-consent .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; } .avia-cookie-consent .avia_cookie_text { flex: 1; white-space: normal; margin: 0; } .avia-cookie-consent .avia-button { display: inline-block; }
This is the expected result that I see when I test:
Best regards,
MikeNovember 1, 2023 at 10:38 am #1424301Hi Mike
Thanks for your CSS code.
Now it’s a little bit better.
What I like to have is, that on desktop the whole width can be used for the text, so that my text is on one line before the buttons. And on mobile the text should be before and both buttons should be at the end.
See screenshots in the private content section.
But if this is not easy to realize, it is not tragic ;-)
Best regards
MikeNovember 1, 2023 at 4:32 pm #1424337Hi,
If you want the text on the first line and the buttons on the second line, please remove the css I posted above, for this is the normal state of the cookie bar, please see your site below that you did not add the above css to.Best regards,
MikeNovember 1, 2023 at 5:56 pm #1424342Hi Mike
Yes, I want it like that, but only on mobile.
On desktop I like to have the text and the buttons on the same line using the whole with of the screen.
Best regards
MikeNovember 1, 2023 at 10:12 pm #1424349Hi,
Then try adding a media query so the css above will only work on desktop, like this:@media only screen and (min-width: 1920px) { .avia-cookie-consent .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; } .avia-cookie-consent .avia_cookie_text { flex: 1; white-space: normal; margin: 0; } .avia-cookie-consent .avia-button { display: inline-block; } }
adjust the screen width to suit (min-width: 1920px)
Best regards,
MikeNovember 2, 2023 at 7:13 pm #1424435Hi Mike
I tryed out your CSS code.Without your code, the text and the first button are on the first line, the second button is on the second line.
With your code, all is on the same line but the text uses two lines.
See screenshots in the private content section.
But perhaps it is not possible to use the whole width of the screen for the text?
Best regards
MikeNovember 3, 2023 at 10:47 am #1424530Hi,
On your site you have this css:.avia-cookie-consent .container { float: none !important; padding: 0 !important; }
Please remove the padding: 0 !important;
Best regards,
MikeNovember 7, 2023 at 7:50 am #1424879Hi Mike
Yes, on gruetter-innenausbau.ch I didn’t add your CSS code yet.
So when I add your code, I have the same problem, on desktop the buttons are right of the text but the text uses two lines because it does not use the whole width for the text.
But it seems that this can not be solved?
Best regards
MikeNovember 7, 2023 at 12:04 pm #1424907Hi,
When I check gruetter-innenausbau.ch the mobile looks as you wish right now:
So if you only want the text and buttons to be side-by-side on desktop, like this:
then you would use this css:@media only screen and (min-width: 1920px) { .avia-cookie-consent .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; } .avia-cookie-consent .avia_cookie_text { flex: 1; white-space: normal; margin: 0; } .avia-cookie-consent .avia-button { display: inline-block; } }
Please note that the css only begins at min-width: 1920px, if you want it to begin earlier then please adjust. I tested this on gruetter-innenausbau.ch, see the above screenshots, if you are still having problems perhaps you have an error in your other css like a missing bracket, try adding this css to the WordPress ▸ Customize ▸ Additional CSS, assuming you have no other css there, otherwise please examine and test your other css for errors.
Best regards,
MikeNovember 7, 2023 at 3:41 pm #1424929Hi Mike
Yes, when we implement this code on our website (see private content section) the buttons are side-by-side.
But what we want is to have the whole text on the same line…
Is this not possible?
Thanks very much.
Best regards
MikeNovember 7, 2023 at 5:54 pm #1424945Hi,
Perhaps, what you are trying to ask for is that on desktop you want the text and the buttons to be in one line, and you want the text to also be in a single line, like this:
If this is what you are asking, then please add this css:@media only screen and (min-width: 1520px) { .responsive .avia-cookie-consent.avia-cookiemessage-bottom .container { max-width: 1520px; } }
Please note that with the amount of text you have this can only occur for desktops above 1520px, otherwise there is not enough room for the text to be in a single line and next to the buttons.
Best regards,
MikeNovember 8, 2023 at 10:08 am #1424973Hi Mike
Yes, that’s exactly that!
Thanks very much. It works.
You can close this issue.
Best regards
Mike -
AuthorPosts
- The topic ‘Cookie message and buttons at the same line’ is closed to new replies.