What is the best way to have a webpage displayed nicely on both PC and mobile? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is the best way to have a webpage displayed nicely on both PC and mobile?

Hey guys! Does anyone have some tricks and ideas that work well to have all elements of a website displayed nicely on both PC and cellphone/tablet? Could you please share your experiences? Thanks :)

6th Jun 2019, 11:02 AM
Bennywise
Bennywise - avatar
7 Answers
+ 8
Using vh and vw instead of others. Look at this : https://code.sololearn.com/W2Bo6PsVvZkw/?ref=app
6th Jun 2019, 11:10 AM
Ayan Fox
Ayan Fox - avatar
+ 7
Bootstrap library Or Media Queries Css
6th Jun 2019, 11:07 AM
Raj Chhatrala
Raj Chhatrala - avatar
+ 3
Learn flexbox, you could make better responsive site.
6th Jun 2019, 11:38 AM
Calviղ
Calviղ - avatar
+ 2
use em instead of px. px works on the actual physical pixels of the screen. more ppi would make the element small and less ppi would make it exceedingly big. if you have navigational bars or menus and want them to change entirely, you can use @media. here's a code i made which is completely workable on both phone and computer. you can see that you really dont have to use advanced css syntaxes to get the ball rolling. switching from px to em or other unit often helps. https://code.sololearn.com/WP7kgD8lQf71/?ref=app
6th Jun 2019, 11:35 AM
Farry
Farry - avatar
+ 2
Thanks for the tips guys!! I'll take a look at all of your suggestions!
6th Jun 2019, 11:43 AM
Bennywise
Bennywise - avatar
+ 2
include the following in your head section :<meta name="viewport" content="width=device-width, initial-scale=1"> Also when you give size measurements for your images and structural tags use % insteady of px.
6th Jun 2019, 11:46 AM
Walter Mukaro
Walter Mukaro - avatar
0
@media
7th Jun 2019, 6:22 AM
Ginfio
Ginfio - avatar