Found 1566 Articles for CSS

How to create a 4-column layout grid with CSS?

AmitDiwan
Updated on 12-May-2020 12:55:49

2K+ Views

To create a 4-column layout grid with CSS, the code is as follows −Example Live Demo    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    * {       box-sizing: border-box;    }    .first, .second, .third, .fourth {       float: left;       width: 25%;       color: white;       padding: 10px;       height: 500px;       text-align: center;    }    .first {       background-color: tomato;    }    .second {       background-color: teal;    }    .third {       background-color: rgb(166, 71, 255);    }    .fourth {       background-color: rgb(255, 71, 194);    }    .container:after {       clear: both;    } Four Column grid example Some text on the first div Some text on the second div Some text on the third div Some text on the fourth div OutputThe above code will produce the following output −

How to create a 3-column layout grid with CSS?

AmitDiwan
Updated on 12-May-2020 12:52:25

3K+ Views

To create a 3-column layout grid with CSS, the code is as follows −Example Live Demo    body {       padding: 1%;       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    * {       box-sizing: border-box;    }    .left, .right, .center {       float: left;       width: 33%;       color: white;       padding: 10px;       height: 500px;       text-align: center;    }    .left {       background-color: tomato;    }    .right {       background-color: teal;    }    .center {       background-color: rgb(166, 71, 255);    }    .container:after {       clear: both;    } Three Column grid example Some text on the left Some text in center Some text on the right OutputThe above code will produce the following output −

How to create a 2-column layout grid with CSS?

AmitDiwan
Updated on 17-Nov-2023 11:30:34

2K+ Views

To create a 2-column layout grid on a web page, we will create and position two divs, one on the left and the next on the right. Create the First div To begin with, we will create a div, beginning with the left div − Some random text on the left Create the Second div Create the 2nd div i.e., the right div − Some random text on the right Position the divs on the Left and Right The two divs are positioned on the left and right using the left and right property − .left { left: 0; ... Read More

How to style a header with CSS?

AmitDiwan
Updated on 21-Dec-2023 14:27:54

7K+ Views

The padding property plays a major role while styling headings. Also, use the text-align property to center the text on a header. Remember to place the header in a separate div container. Let us see how to style a header with HTML and CSS. Set the header div Create a div for the header so that we can style it later with CSS − My website ⇅ Style the header div The header is styled like this − .header { padding: 30px; text-align: center; ... Read More

How to create an about / about us page for website with CSS?

AmitDiwan
Updated on 14-Dec-2023 14:59:06

642 Views

The about page of a website has the team details including the name, designation, contact details, contact button, etc. First, a container is set for the about page. Withing that, set the child containers for the column, card, person profile, etc. The profile includes the name, designation and a button to contact. Let us see how to create an about us page for website with HTML and CSS. Create a div container The container is set for the team details of the about page. The team card in the container includes other child containerd − ... Read More

How to create a responsive contact section for web pages?

AmitDiwan
Updated on 08-Dec-2023 16:37:34

157 Views

On a contact us page, you must have seen input fields to add your name, email-id, phone number, message, etc. A button is also placed for the user to submit the contact form. With that, some websites also add an image that aligns properly when the web browser is resized i.e., the responsiveness. Let us see how to create a responsive contact section for web pages on a website with CSS. Set the contact image Begin with the heading and set an image representing a contact us page − Position the image ... Read More

How to center your website horizontally with CSS?

AmitDiwan
Updated on 16-Nov-2023 14:09:43

146 Views

To center your website horizontally with CSS, set a div where all the content of the website will be set. Align it in a way to center it horizontally. For that, we will use the margin and max-width property. Set the Website’s Main div Set a div and within that some elements to make it somewhat look like a sample website − Center website horizontally example Lorem ipsum dolor sit amet consectetur adipisicing elit. Ad nemo, nisi fugiat dolores quidem ipsam, quisquam sit, quos amet provident accusantium. Ab cumque est ut officia libero, ... Read More

How to create a responsive website that will work on all devices, PC, laptop, tablet, and phone?

AmitDiwan
Updated on 14-Dec-2023 11:34:52

823 Views

A responsive website works on every device whether it’s a desktop, tablet or a mobile. To set the responsiveness, we use Media Queries. Create the header container Create a div for the headerL Website ↶ Style the header Align the header text in the center using the text-align property − .header { padding: 80px; text-align: center; background: #7b1abc; color: white; } Create the navigation menu The is used to create the navigation menu − ... Read More

How to use media queries for common device breakpoints with CSS?

AmitDiwan
Updated on 21-Dec-2023 15:12:18

87 Views

Media Queries are used on a web page to set the responsiveness. It allows a user to set different styles based on different screen sizes. These screen sizes are mainly desktop, tablet, and mobile devices. Let us first set the different screen sizes i.e., where we will set the common device breakpoints. Different screen sizes The common device breakpoints are the different devices with its screen size i.e. Phones − Screens less than 768px wide Tablets − Screens equal to or greater than 768px wide Small laptops − Screens equal to or greater than 992px wide Laptops and Desktops ... Read More

How to create a quotes slideshow with CSS and JavaScript?

AmitDiwan
Updated on 08-Dec-2023 16:20:44

816 Views

On any thoughts and quotes website, you must have seen the quote slideshow that includes the quote, the celeb name who gave the same quote and the slider. This slider allows moving to the left or right slideshow by clicking separate buttons like arrow keys. Let us see how to create a quotes slideshow with CSS and JavaScript. Set the parent div The div includes the container for the slideshow, the quotes, and the previous and next buttons as well. The quotes are set using the elements. The celeb name who gave the same quote is set as a ... Read More

Advertisements