Top Secret to Build Responsive Web Design in 30 minutes 👍!! Website Hacks🙄 (Hindi) Did you check video on youtube? You can easily make your responsive web design with media queries code. Hope you would like this website, lets understand step by step.
When we open any webpage in different devices like – mobile, tab, laptop and desktop, then the design opens correctly in all the screens, we call it responsive design. For this, first we have to add link inside the tag in the html which helps in making the website responsive.
To learn media query, first of all we should have knowledge of Html and CSS, after which we can learn media query for all devices, we use media query for 4 size.
Whatever mobile we use, everyone’s size is different, the smallest size of mobile is 320px and the maximum size is up to 551px. That’s why we can write media query for all the mobiles simultaneously in CSS. In which we use min-width 320px and max-width 551px like –
Use this code to make responsive website
@media only screen and (min-width: 320px) and (max-width: 551px)
@media means used for all mobiles, iphones and android. only screen means only for mobile size i.e. media query for alll mobile screen size device only.
Suppose we are making design in laptop or desktop and css is written in h1 tag and its font-size: 30px; Have given. If we open this webpage in mobile then its font-size will look very big, to reduce the font size in mobile we will write media query –
In this, apart from font, we can change the things like image size, box-size, color, background-color, border, margin, padding, position etc. for mobile size if you do not write any media query which is written in your CSS. size will be applicable.
Whatever table we use, everyone’s size is different, normally we write media query for 3 types of size ipad min, ipad and ipad pro size, whose size ranges from 768px to 1024px i.e. tablet this size In which we write CSS of the same size for all, which will reduce only for tabs.
Above we have used font-size: 30px; in CSS. and color: black; font-size: 22px; and color: grey; After which we will see different size and color in both. For more information, you can learn about media query by going to w3school.
Nowadays every office, home and every person has his own personal laptop and every laptop belongs to different company whose size is big and small like – Dell, Lenovo, Mackbook, Hp etc. Laptops of size from 1280px to 1440px. Here too we write a media query for laptops of all sizes.
After writing media query for all sizes, we write media query for desktop and for bigger size, whatever the size of desktop can be, it can be at least 1024px or any size but keep bigger size according to screen. Like if someone has a desktop of 1600px, then we will keep the max-width 1600px like –
But if we do not know the size of the desktop, we will keep only its min-width, after which no matter how big the size is, the same thing will work as you have written your media query, in this way we can write media query of any size. Like if we have to correct the design between 500px to 700px, then we can write by giving min and max width like –
Now you must have come to know completely what is CSS media query, how to write media query for mobile, tab, laptop and desktop, what is min-width and max-width, how can we set mobile view and other size on our computer. You can see, I hope you have liked this post, if you have any question related to responsive, you can ask in the comment box below.