A hero section is a full-screen section that consists of a background image, or video, or illustrations, or animations, with some text and a button which will redirect to the linked page. The hero section is a website design term that is used to describe an oversized banner image at the top of a website that usually extends full width.
A hero section should consist of a title, a short description, a high-quality image or video, and a link to direct the user to the other page. Hero images are used to catch the visitor's attention and draw them into reading the article on the page.
In this blog (Responsive Hero Section), there is a heading, a title, a short description, a button which is named Click Me and there is a high-quality background image. The CSS media query property is used to make the page responsive.
The source code of this Responsive Hero Section is given below, if you want the source code of this program, you can copy it. You can use this Responsive Hero Section with your creativity and can take this project to the next level.
Responsive Hero Section [Source Code]
To make this website, you would like to make two files: an HTML file & a CSS file. First, create an HTML file with the name of index.html and remember, you have to create a file with a .html extension.
<!DOCTYPE html>
lang="en"
charset="UTF-8"
name="viewport" content="width=device-width, initial-scale=1.0"
rel="stylesheet" href="style.css"
Hero section || Learning Robo
id="hero"
class="container"
class="info"
This is a title
Lorem ipsum dolor sit amet consectetur.
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Voluptatem vero ratione vitae dicta explicabo
perferendis amet quis provident molestiae magni!
class="click" href="https://www.learningrobo.com/"Click Me
class="credit"Made with style="color:tomato"❤ by href="https://www.learningrobo.com/"Learning Robo
@import url("https://fonts.googleapis.com/css2?family=Roboto+Mono&display=swap");
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
body {
font-family: "Roboto Mono";
font-size: 18px;
}
#hero {
height: 100vh;
width: 100%;
background: linear-gradient(rgba(0, 0, 0, 0.342), rgba(0, 0, 0, 0.342)),
url("https://cdn.pixabay.com/photo/2020/06/14/15/31/leaf-5298312__480.jpg")
no-repeat center bottom / cover;
color: whitesmoke;
}
.container {
width: 90%;
height: 100%;
max-width: 1200px;
margin: 0 auto;
display: flex;
align-items: center;
Thank you for reading our blog. If you face any problem in creating this Responsive Hero Section, then contact us or comment us. We’ll try to provide a solution to your problem as soon as possible.
Post a Comment
Thank you
Learning robo team