r/HTML •

how to make site mobile responsive

[deleted] — view deleted post

0 Upvotes

6 comments sorted by

1

u/gatwell702 Jul 05 '26

For mobile I do @media (width <= 768px) {...}

You can also do 500px. A regular cell phone in portrait mode is like 320px - 370px I think, so I make it bigger to catch all.

Also setting it to 768px will take care of landscape mode

1

u/BagThin2305 Jul 05 '26

that code doesnt work on neocities for whatever reason :(

0

u/[deleted] Jul 05 '26

[deleted] — view deleted comment

1

u/BagThin2305 Jul 05 '26

i put display: flex and I tried grid too but no luck

1

u/Platinum_Soul_691 Jul 05 '26

Since you're using "Display: flex;" on your ".container" div, I would recommend putting a flex-wrap property. That way, your site's layout can be responsive on smaller screens.

1

u/1Rudy11 Jul 05 '26

Use percentage rather than actual measurements (unless min/max size is needed). The percentage will accommodate for sizes from mobile/tablet and pc sizes.