responsive website design

Many people want to make their own website after learning how to code. This is even better if the website is responsive. We will show you the code of a simple website layout which is Mobile Responsive. Side navigation will open when you click a button on this website. If you click the cross button on the side navigation it will remove the navbar from the right. Before you collect the code, watch the video below and follow the steps. You will be able to understand the code very quickly. There are a lot of videos on the topic of front-end development basics on our YouTube channel. If you are new to front-end development, then you can subscribe to our channel.




If you watched the video from beginning to end, you'll understand how the snippets were created. This is a basic layout that was created with the help of HTML and CSS. The normal rules of making a navigation bar for the website were not applied in this project. Instead, we have placed a button called menu so that when clicked, our navigation bar will open in the form of a side nav. Each nav item is linked to a related section. When we click on a nav item, we go to the related section of that nav item. The scroll behavior property has been used to make the animation smooth.

First, we have a div called "leftMenu" in which we put together the nav items of our main navigation bar. We will make six sections so the sections are linked with the nav items. Also on this div, a cross button has been taken with a onclick event called closeBtn (). Below the left menu, we have taken a span tag and another on-click event so that when you click, the side nav will open. Then I took the Home, About, Services, Blog, and Contact sections. We have used the display grid property for each section in CSS. Then we take the place-items center and 100vh height so that the content of each section is all over the viewport and its contents are in the middle of the viewport. You can see how the rest of the elements have been styled by watching the video. The span tag is set to the top right with the fixed position. CSS media queries have been used in this project so that the website layout can be viewed beautifully on small devices. You can modify the style of the element according to your needs.

You May Also like:

How to create a responsive website [ Source Code ]:

To create this snippet, first, create an HTML file. Then create a CSS file and attach it to HTML. Since we used JQuery to create a side nav, we need to add the latest JQuery file to our project. Then copy the code from the code box below and paste it into your files. Open the project in the browser and see if it works properly. If not, download the code from the download button below.

ADD HTML:




ADD CSS:




If your code is working, that's good. Front-end related source code is shared on our website frequently. You can visit our website frequently if you feel like it. Share the articles of this website with everyone because we all know sharing is caring. We would like to thank you for visiting our site.

Post a Comment

Please Do not Enter any spam link in the comment box