The timeline aesthetic can be achieved solely through the use of HTML, CSS, and potentially some Bootstrap functionalities

https://i.sstatic.net/EsDAE.png

Up to this point, I've only been able to make it this far. I'm using a sample code from w3school

https://i.sstatic.net/G1FcQ.png

I've been attempting to get the year in the same position as in the image, but haven't had any luck. I also tried inserting a background image for the circle, but I could only manage to fill it with color.

/* The actual timeline (the vertical ruler) */

.timeline {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
}


/* The actual timeline (the vertical ruler) */

.timeline::after {
  content: ' ';
  position: absolute;
  width: 6px;
  background-color: #ffc200;
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -5px;
}


/* Container around content */

.contaiment {
  padding: 10px 40px;
  position: relative;
  background-color: inherit;
  width: 50%;
}


/* The circles on the timeline */

.contaiment::after {
  content: '';
  position: absolute;
  width: 25px;
  height: 25px;
  right: -11px;
  background-color: #ffc200;
  border: 4px solid #ffc200;
  top: 15px;
  border-radius: 50%;
  z-index: 1;
}


/* Place the container to the left */

.left {
  left: 0;
}


/* Place the container to the right */

.right {
  left: 50%;
}


/* Add arrows to the left container (pointing right) */


/* .left::before {
  content: " ";
  height: 0;
  position: absolute;
  top: 22px;
  width: 0;
  z-index: 1;
  right: 30px;
  border: medium solid white;
  border-width: 10px 0 10px 10px;
  border-color: transparent transparent transparent white;
} */


/* Add arrows to the right container (pointing left) */

.right::before {
  content: " ";
  height: 0;
  position: absolute;
  top: 22px;
  width: 0;
  z-index: 1;
  left: 30px;
  border: medium solid white;
  border-width: 10px 10px 10px 0;
  border-color: transparent white transparent transparent;
}


/* Fix the circle for containers on the right side */

.right::after {
  left: -16px;
}


/* The actual content */

.content {
  padding: 20px 30px;
  background-color: white;
  position: relative;
  border-radius: 6px;
}
<div class="timeline">
  <div class="contaiment left">
    <div class="content">
      <p>2017
        <p>
          <p>Lorem ipsum..</p>
    </div>
  </div>
  <div class="contaiment right">
    <div class="content">
      <p class="">2017
        <p>
          <p>Lorem ipsum..</p>
    </div>
  </div>
  <div class="contaiment left">
    <div class="content">
      <p class="">2017
        <p>
          <p>Lorem ipsum..</p>
    </div>
  </div>
</div>

Answer №1

Even if your focus is primarily on HTML and CSS, delving into the user-friendly JQuery library can truly revolutionize your workflow. Check out the JQuery Connections Library here

All you need to do is specify the two elements you want to connect.

$("#div1, #div2").connections();
$("#div2, #div3").connections();
$("#div3, #div4").connections();

<!doctype html>
<html lang="en>
    <head>
        <meta charset="utf-8"
        <meta name="viewport" content="width=device-width, initial-scale=1"

        <script src="https://code.jquery.com/jquery-3.6.3.min.js" integrity="sha256-pvPw+upLPUjgMXY0G+8O0xUf+/Im1MZjXxxgOcBQBXU=" crossorigin="anonymous"></script>
        <title>Hello, world!</title>
    </head>

    <body>
        <p style="width: 50px;height: 50px;border: 1px solid black;" id="div1">TEST</p>
        <p style="width: 50px;height: 50px;margin-left: 50px;border: 1px solid black;" id="div2">TEST</p>
        <p style="width: 50px;height: 50px;margin-left: 200px;border: 1px solid black;" id="div3">TEST</p>
        <p style="width: 50px;height: 50px;margin-left: 300px;border: 1px solid black;" id="div4">TEST</p>

    <script>
      (function($) {
        $.fn.connections = function(options) {
          if (options === "update") {
            return processConnections(update, this);
          } else if (options === "remove") {
            return processConnections(destroy, this);
          } else {
            options = $.extend(
              true,
              {
                borderClasses: {},
    

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Using HTML nested lists in Wordpress sites

Working on nested, ordered lists using ol types and encountering an issue where the code appears correctly in Wordpress preview but displays incorrectly in Firefox and IE. The lists are showing as numbered instead of the specified types in the code provide ...

How can I assign a default value for a multiple select dropdown list in AngularJS?

I am currently facing an issue with my multiselect dropdown. The code for the dropdown is as follows: <select id="year" multiple ng-model="type" ng-disabled="!type1" > <option value="all" selected>all</option>; <option value= ...

The z-index property fails to function properly when used with a relative parent and after/before pseudo-elements

Here is the code snippet (prototype) that I am working with: .headerz { position: relative; padding: 5rem 0 0 5rem; margin: 3rem 0 0 0; color: #000; font-size: 3.8rem; text-transform: uppercase; z-index: 24; } .headerz::before { content ...

Achieving consistent height for Grid items in Material-UI

I'm looking to achieve equal heights for these grid items without distorting them. Here's the current layout: https://i.sstatic.net/6dPed.jpg This is how I would like it to look: https://i.sstatic.net/BJZuf.jpg My challenge is that adjusting ...

The field 'post_id' cannot be identified. Available options include: comment, id, name, post_list

An error occurred while trying to process the request for post number 1. This error is related to a field resolution issue with the keyword 'post_id'. Available fields include: comment, id, name, post_list. The method used was GET and the URL req ...

Passing an undefined value to the database via AJAX upon clicking a button

Hi there, I'm currently working on a table where I'm trying to perform an inline edit and update the value in the database by clicking on a button (an image). I've attempted to use an onclick function, but it seems to show "value=undefined&a ...

What is the proper way to add process.env.PORT to the script declarations string within my package.json file?

I am facing an issue while trying to upload my file on Heroku that requires including the PORT specification. Unlike my previous projects, this project consists of only html, js, and css files instead of an index.js file. To run it, I am using "live-server ...

What is the best way to retrieve a user's country name using C#?

Currently, my code utilizes geolocation to retrieve the user's country name. Take a look at the code snippet below: navigator.geolocation.getCurrentPosition(function (pos) { var latlng = pos.coords.latitude + "," + pos.coords.longitude; var a ...

The Main page is being graced by a floating Twitter Bootstrap video

When trying to display a video next to a paragraph, I encountered an issue where the paragraph was taking up 100% of the screen and the video was floating over it, obstructing part of the text. Despite setting the row and cols, the layout wasn't behav ...

Creating a seamless and interactive online platform

I am in the process of designing a website that has a sleek and dynamic layout, rather than just a static homepage. Let me explain further: Here is my current setup so you can understand what I am trying to achieve. By dynamic, I mean that when the page ...

Setting an error state on the parent div of a checkbox

I am facing an issue with styling a standard HTML checkbox when it is in an error state. Since it's not possible to style the checkbox directly, I am attempting to apply the styling to its parent div instead. Consider this example: <div class="fo ...

Instructions on creating a countdown timer that reveals a hidden div once it reaches zero, remains visible for a set period, and then resets

I created a countdown timer that displays a div when the timer reaches zero. However, I am struggling with getting the timer to reset and start counting down again after displaying the div. For instance, if I set the timer for 7 days and it reaches the de ...

Using jQuery to target adjacent elements excluding those that are separated by other text

I have been attempting to locate and combine adjacent em tags within paragraphs, but it has proven to be a more challenging task than I initially anticipated. Let's explore some examples to illustrate this issue: <p><em>Hello</em>&l ...

Having difficulty extracting images from a collection - web scraping struggle

I have a basic understanding of web scraping but I am facing an issue. I am using PHP Simple HTML DOM and struggling to extract images from within each 'li' tag. <ul class="slides"> <li> <img src="www.webpage.com/oH7oCOEhQAB ...

scrolling through horizontal bootstrap thumbnails

Hey there, I'm currently working on making the bootstrap thumbnails fit into a Div that has a horizontal scroll. However, I've run into an issue where they are collapsing beneath it instead of being offset properly as shown in the image. Does any ...

Leveraging the p-steps module from PrimeNG for smaller screen sizes

I am facing an issue with resizing the p-steps component from PrimeNG to avoid overflow in smaller screen resolutions. The current code I am using is as follows: <div class="d-flex card mb-4"> <p-steps [model]="items" ...

Guide on incorporating a Python script into a website using DJango

I am new to Django and looking for guidance. My goal is to have users input text in an HTML textbox, then process that text using Python and display it on the website. Despite going through documentation and tutorials, I have not been successful in gettin ...

When it comes to HTML and Javascript drawing, getting the positioning just right can be a challenge

I'm currently developing a control website for a drawing robot as part of a school project. However, I've been facing some challenges with the functionality of the drawing feature. Though I admit that the site lacks attention to detail, my main ...

Encountering overlap issues when applying labels to my flexbox using the Spectre framework in CSS

I need help creating a "hat" with two textarea columns using the spectre.css framework. My goal is to have these columns resize based on the screen size, stacking on top of each other when the screen size is below 600px. I can achieve this without any issu ...

Empty HTML elements

Is there a way to create empty HTML tags, meaning tags that have no predefined styling or effect on the enclosed content or its environment? For example, <p> creates a paragraph, <b> makes text bold, and <div> forms a container. I am in ...