organic_emma Posted February 12, 2021 Share Posted February 12, 2021 Site URL: https://striker-fabrications.squarespace.com/ If this code is to view on computer: @media only screen and (max-width:640px){ And this code is to view on mobile: @media only screen and (max-width:640px){ What would the code be that applies to both? I'm working on rotating images from this tutorial: Link to comment
creedon Posted February 13, 2021 Share Posted February 13, 2021 I think you mean something like desktop: @media only screen and (min-width:641px) And this code is to view on mobile: @media only screen and (max-width:640px) In other words for desktop 641px and above get one set of rules and for mobile 640px and less another set of rules. Now when you don't care how a rule-set works on desktop or mobile then you don't use @media at all, in general. But some times you need to make alterations between the two platforms and so you need to tweak one or the other, or both. Not sure if that helps you. Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects. Link to comment
organic_emma Posted February 13, 2021 Author Share Posted February 13, 2021 Thanks for your time that's great. It seems that this code: @media only screen and (max-width:640px){ works to apply a rotating image on mobile. And this code: @media only screen and (min-width:640px){ works to apply a rotating image on desktop. But I how can I get the rotating image code to apply to both mobile and desktop at the same time? Link to comment
tuanphan Posted February 14, 2021 Share Posted February 14, 2021 On 2/13/2021 at 12:47 PM, organic_emma said: Thanks for your time that's great. It seems that this code: @media only screen and (max-width:640px){ works to apply a rotating image on mobile. And this code: @media only screen and (min-width:640px){ works to apply a rotating image on desktop. But I how can I get the rotating image code to apply to both mobile and desktop at the same time? change min-width:640px to min-width: 1px Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
organic_emma Posted February 14, 2021 Author Share Posted February 14, 2021 52 minutes ago, tuanphan said: change min-width:640px to min-width: 1px Perfect it worked!! Thanks :D Link to comment
organic_emma Posted February 15, 2021 Author Share Posted February 15, 2021 Actually sorry just realised I need some code so that the text stays within the container. It looks great on mobile and great on wide screen but on a smaller screen size the text is escaping outside of the box. @tuanphan any help you can offer with some code to keep text within the box? Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.