Designing the Web Template using CSS

We will use CSS to give proper design effects to the HTML web structure that we have created in HTML code. We will give styling to the classes and ids that we have used in the above code. We will be using the flex property so that It is easy to position child elements and the main container. The margin doesn’t collapse with the content margins. The order of any element can be easily changed without editing the HTML section.

CSS code:

style.css
/* Write CSS Here */
* {
    margin: 0px;
    padding: 0px;
    box-sizing: border-box;
}

body {
    background-color: #e3e3e3;
}

.container {
    width: 1000px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 10px;
}

nav {
    background-color: #089de3;
}

nav>a {
    color: #fff;
    font-size: 30px;
    text-decoration: none;
    /* top right bottom left*/
    padding: 10px 10px 10px 30px;
    float: left;
}

.navbar>ul {
    list-style: none;
    float: right;
}

.navbar>ul>li {
    display: inline-block;
    line-height: 60px;
    /*top-bottom right-left*/
    padding: 0px 20px;
}

.navbar>ul:last-child {
    padding-right: 100px;
}

.navbar>ul>li>a {
    text-decoration: none;
    font-size: 18px;
    color: #fff;
}

.navbar>ul>li:hover {
    background-color: #111111;
}

nav::after {
    content: " ";
    display: block;
    clear: both;
    *zoom: 1;
}

/* Navbar End */

/* Banner Start */
.main-banner {
    height: 400px;
}

.main-banner>img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

/* Banner End */

/* Service Start */
.service {
    background-color: #fff;
}

.service>h1 {
    font-size: 30px;
    text-align: center;
    padding: 30px;
}

.col {
    width: 300px;
    text-align: center;
    margin-left: 20px;
    border-right: solid #bebebe 1px;
    padding-bottom: 30px;
    float: left;
}

.col:last-child {
    border-right: none;
}

.col>h3 {
    /* top-bottom right-left */
    padding: 10px 0px;
    color: grey;
}

.col>p {
    padding-bottom: 20px;
}

.col>a {
    background-color: #089de3;
    color: #fff;
    font-size: 17px;
    text-decoration: none;
    border: solid white 2px;
    padding: 5px 10px;
    border-radius: 20px;
}

.col>a:hover {
    background-color: #111111;
    border: solid #111111 2px;
}

.service::after {
    content: " ";
    display: block;
    clear: both;
    *zoom: 1;
}

/* Service End */

/* about Start */
.about {
    background-color: #089de3;
    min-height: 300px;
    text-align: center;
    padding: 20px;
    color: #fff;
}

.about>h1 {
    font-size: 30px;
    padding-bottom: 20px;
}

.about>img {
    border: solid 2px;
    width: 100px;
    height: 100px;
    border-radius: 50px;
    object-fit: cover;
}

.about>p {
    font-size: 18px;
    margin: 10px 200px;
    padding-bottom: 10px;
    line-height: 25px;
}

.about>a {
    color: #fff;
    font-size: 17px;
    text-decoration: none;
    border: solid white 1px;
    padding: 5px 20px;
}

.about>a:hover {
    background-color: #111111;
    border: solid #111111 1px;
}

/* about End */

#contact {
    padding: 30px 0px;
}

.contact-row {
    display: flex;
    justify-content: center;
    align-items: center;
}

.contact-left-col {
    flex-basis: 50%;
    padding-top: 50px;
}

.contact-right-col {
    flex-basis: 50%;
    max-width: 450px;
    margin: auto;
}

.contact-right-col i {
    font-size: 20px;
    padding: 10px;
    background: #089de3;
    color: white;
}

.contact-right-col p {
    margin-top: 10px;
    margin-bottom: 20px;
}

.form {

    width: 70%;
    margin: auto;
    text-align: center;
}

.form input[type="text"] {
    width: 70%;
    padding: 10px;
    margin-bottom: 10px;
}

textarea {
    width: 70%;
    padding: 10px;
    margin-bottom: 10px;
}


.c_btn {
    background: black;
    color: white;
    padding: 10px;
    width: 50%;
    border: none;
}

/* Footer Start */
footer {
    background-color: #089de3;
    text-align: center;
    padding: 10px;
}

footer>small {
    color: #fff;
}

footer>small>a {
    color: #fff;
    text-decoration: none;
}

/* Footer End */

Output: Open with the live server in Visual Studio Code or if you are using any other code editor just open the index.html file in the browser.




Bootcamp Website Template using HTML and CSS

We will explore how to design a simple BootCamp website template using HTML and CSS. Creating an attractive template can be challenging for those who are not proficient in CSS. Without CSS, enhancing the visual appeal of a web page is difficult. Therefore, to create a compelling web page, knowledge of both HTML and CSS is essential. In this article, we will use HTML and CSS to build the website template. To start, we will first create the HTML structure of the web page.

Similar Reads

Step 1: Creating Web Page Structure using HTML

In this section, we will create a simple structure of the web page by using

Step 2: Designing the Web Template using CSS

We will use CSS to give proper design effects to the HTML web structure that we have created in HTML code. We will give styling to the classes and ids that we have used in the above code. We will be using the flex property so that It is easy to position child elements and the main container. The margin doesn’t collapse with the content margins. The order of any element can be easily changed without editing the HTML section....