Demo | user profile with timeline photos using HTML CSS

Demo | user profile with timeline photos using HTML CSS

HTML and the accompanying style.css. This code assumes you're building a profile page with a timeline, stats section, and a grid layout, with some background and image styling.

HTML Code (profile.html)

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>User Profile</title> <link rel="stylesheet" href="assets/css/style.css"> </head> <body> <div class="profile"> <!-- Profile Header --> <div class="grid grid-header"> <img src="assets/image/logo.png" alt="Profile Image"> <h3>User Name</h3> <p><a href="#">Edit Profile</a></p> </div> <!-- Profile Body --> <div class="grid grid-body"> <div class="row"> <div class="col"> <h4>About Me</h4> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla ac dolor a arcu tincidunt fermentum.</p> </div> </div> </div> <!-- Timeline Section --> <div class="timeline-centered"> <div class="timeline-entry left-aligned"> <div class="timeline-entry-inner"> <div class="timeline-time"> <span>April 2025</span> </div> <div class="timeline-icon bg-primary"> <i class="fa fa-check"></i> </div> <div class="timeline-label"> <h2>Timeline Event Title</h2> <p>Details about this event, milestones, or achievements.</p> </div> </div> </div> </div> <!-- Stats Section --> <div class="profile stats"> <h1>Profile Stats</h1> <span>Posts: 150</span> <span>Followers: 2000</span> <span>Following: 500</span> <button class="btn btn-primary">Edit Stats</button> </div> </div> </body> </html>

CSS Code (style.css)

body { margin-top: 20px; background: #eee; } .profile .grid-header { background: url("https://bootdey.com/img/Content/bg1.jpg") no-repeat center center; background-size: cover; color: #f5f5f5; text-align: center; padding: 20px; } .profile img { max-width: 100%; border-radius: 50%; width: 150px; height: 150px; margin: 0 auto; display: block; } .profile .grid-header img { margin: 2em 1em; } .profile .grid-header h3 { color: #f5f5f5 !important; font-weight: 400; margin: 30px 0 20px 0; } .profile .grid-header p { margin-bottom: 5px; } .profile .grid-header p a { color: #f5f5f5; } .profile .grid-body { font-size: 1em; } .profile .stats { margin-top: 20px; padding: 0px 0px 20px; background: #eee; text-align: center; border-top: 1px solid #ccc; } .profile .stats h1 { font-weight: 400; margin-bottom: 0px; } .profile .stats span { margin: 5px 0 10px 0; display: block; } .profile .stats .btn { padding-right: 4em; padding-left: 4em; } .timeline-centered { position: relative; margin-bottom: 30px; } .timeline-centered .timeline-entry { position: relative; width: 50%; float: right; margin-bottom: 70px; clear: both; } .timeline-centered .timeline-entry.left-aligned { float: left; } .timeline-centered .timeline-entry .timeline-entry-inner { position: relative; margin-left: -22px; } .timeline-centered .timeline-entry .timeline-entry-inner .timeline-time { position: absolute; margin-top: -12px; left: -100px; text-align: right; padding: 10px; } .timeline-centered .timeline-entry .timeline-entry-inner .timeline-icon { background: #fff; color: #737881; display: block; width: 40px; height: 40px; line-height: 40px; font-size: 1.3em; text-align: center; float: left; border-radius: 20px; box-shadow: 0 0 0 4px #fff; } .timeline-centered .timeline-entry .timeline-entry-inner .timeline-label { position: relative; background: #fff; padding: 1.7em; margin-left: 70px; border-radius: 3px; border: 1px solid #ddd; } .timeline-centered .timeline-entry .timeline-entry-inner .timeline-label h2, .timeline-centered .timeline-entry .timeline-entry-inner .timeline-label p { color: #666666; font-size: 0.9em; line-height: 1.9em; margin: 0; } .timeline-centered .timeline-entry .timeline-entry-inner .timeline-label h2 { font-size: 1.2em; margin-bottom: 10px; } .timeline-centered .timeline-entry .timeline-entry-inner .timeline-icon.bg-primary { background-color: #428bca; color: #fff; }

Explanation:

  • Profile Layout: The profile has a header with a background image, an image of the user (logo), and a name with an "Edit Profile" link.

  • Grid Layout: The body of the profile contains a grid with information about the user (e.g., "About Me").

  • Timeline: The timeline section uses the .timeline-centered class, showing events or milestones with icons and labels.

  • Stats Section: The stats section includes stats like posts, followers, and following, with a "Edit Stats" button at the bottom.

Notes:

  • The style.css contains basic styling for the profile, stats section, and timeline.

  • As needed, you can adjust the paths to your image files and other assets.

Soeng Souy

Soeng Souy

Website that learns and reads, PHP, Framework Laravel, How to and download Admin template sample source code free.

Post a Comment

CAN FEEDBACK
close