How to create Responsive Profile Card using HTML and CSS ?
In this article, we are going to create a profile card from where a user can check out the basic details of other users and connect with them through different handles as well as can message the user.
- Firstly, we create a HTML file in which we do following things:
- Create a container which contains all the information.
- Add profile picture of the user.
- Add links of different social media handles.
- Add a button for messaging.
- Then, we create a CSS file in which we apply different types of styling property for our HTML tags.
- Finally, we link our CSS file to the HTML file using the link tag in the head section of the HTML.
- First, we create an HTML file(index.html).
- After creating the HTML file, we are going to give title to our webpage using <title> tag. It should be
placed between the <head> tag.
- Then we link the css file that provide all the animations effect to our html. This is also placed in between <head> tag.
- Now we add a link from Google Fonts to use different type of font family in our project.
- Coming to the body section of our HTML code.
- Create a div in which we can store all of the images, links, buttons, headings and paragraphs.
- Then we create a div in which we add the image of the user.
- Another div is created, in this div we have to add the following tags:
- Heading tag is added to store the name of the user.
- A paragraph tag is added to store the username of the user.
- Then we added some social media links so that one can connect with this specified user.
- At last we have created a link for connecting the other using messaging service.
CSS Code: CSS is used to give different types of animations and effect to our HTML page so that it looks interactive to all users.
In CSS, we have to remind the following points-
- Restore all the browser effects.
- Use classes and ids to give effects to HTML elements.
- Use of nth-child selector feature of CSS to call different links.
Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML course.