MAC1 Posted April 25 Share Posted April 25 Hi, I have a issue with my custom buttons. The button becomes too small on different widths: Large monitor looks fine, button is full size On a smaller monitor the image scales down too much, I want to keep it at 100% the whole time (like how buttons in squarespace behave): Is it how i've set it up? can i add css that keeps the button at a suitable size? Web: https://ellipse-teal-dl5w.squarespace.com/ Pass: 04 Here is the button code at the moment, the hover works and the animated scaling also: /* GET IN TOUCH BUTTON*/ div#block-yui_3_17_2_1_1701485718961_2891 { overflow: hidden; position: relative; } div#block-yui_3_17_2_1_1701485718961_2891 img { transition: transform 0.5s ease, opacity 1s ease; display: block; width: 100%; height: auto; } div#block-yui_3_17_2_1_1701485718961_2891:hover img { transform: scale(1.05); opacity: 1; content: url(https://images.squarespace-cdn.com/content/64d0a4ef828d1802cb65112a/94faff05-9d93-477d-952d-4ac5f8579fa3/BUT_getintouch_ON.png); } Appreciate any support on this Cheers, Mac Link to comment
Solution MAC1 Posted May 4 Author Solution Share Posted May 4 (edited) I got this code to work, hope it helps someone. Keeps the button image (no rescaling) at 250px at every screen width and also pumps it up to 280px at a window size bigger than 1200px :) div#block-yui_3_17_2_1_1701485718961_2891 { width: 250px; height: 250px; overflow: hidden; margin: auto; position: relative; top: 50%; transform: translateY(-50%); } /* Media query for window width of 1200px */ @media (min-width: 1200px) { div#block-yui_3_17_2_1_1701485718961_2891 { width: 280px; } } Edited May 4 by MAC1 tuanphan and zoga_sufefi3 2 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment