Linked CSS Bullet Points

Typically, I focus on the backend of websites, but I am now attempting to add a new feature to my resume site. I want to connect bullet points with a vertical line that breaks at each point and does not overlap with the bullets themselves.

I have created a version of this feature, but there are a few issues that need to be addressed. The current implementation does not draw the line through the bullet points correctly, and adjusting the 'left' attribute only shifts the line around the bullets. Additionally, the line has a fixed size, whereas it should adjust dynamically based on the content.

If anyone knows how to fix these problems and create a more functional version of this feature in CSS, please share your knowledge. I have searched for existing solutions but haven't found one that meets all the requirements.

Answer №1

To create a stylish bullet point with a line, you can utilize the border property for drawing the line and absolute positioning to adjust the position of your bullet. For example, you can use border-left to create a vertical line and border-bottom for a short horizontal line.

In order to achieve this effect, I recommend setting the list-style-type to none, adding your custom bullet using li:before, and adjusting padding within your ul element.

// Creating a custom bullet
li:before {
    display: block;
    position: absolute;
    left: 0; /* Position your bullet */
    height: 24px;
    width: 8px;
    content: ""; /* Add your bullet icon here */ }

// Adding a decorative line
li:after {
    display: block;
    position: absolute;
    content: "";
    top: 4px; // Adjust position if needed
    left: 4px; // Adjust position if needed
    border-left: 2px solid #ff5800; // Line color }

// Applying padding to the unordered list
ul {
    padding-left: 16px; }

// Code snippet demonstrating an alternative case for creating lines:
https://codepen.io/irwanphan/pen/REpQPO 

This code is written in SASS format for better visualization. If converting to CSS, remember to add curly braces around elements and semicolons after each attribute declaration.

I hope this explanation helps you achieve the desired design. Thank you!

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

Conditionally assign a class to the body tag in your Jade template

Let's imagine I have a main template file called layout.jade and several files that extend this template - home, about, products, and more. Within the main template, I have structured it like this: body section.main-content b ...

Develop a straightforward static webpage and set it up by installing and launching it using NPM

I am attempting to craft a straightforward HTML page that incorporates CSS/JS and utilizes npm. The objective is to construct a basic page that can be accessed by simply using "npm install" and "npm start". As an example, I will design a page with HTML, ...

Transform a dropdown menu into an inverted footer

I stumbled upon a unique dropdown menu design that I want to tweak and reverse, making it an innovative "dropup" menu that opens from the bottom to the top. Currently, this is what I have: HTML <div class="get-started"> <a href="#" id="get-s ...

Attempting to include a navigation bar within the footer section of my layout page - the master page on my website

Is there a way to add a navigation bar in my footer on the layout page without having to add it to every individual page? I want the icon color for the active page to be red, but only apply this to the current page and not all pages. Currently, when I nav ...

What dimensions are optimal for images on a Responsive web design?

In the process of making our website responsive, I have a question regarding image sizes. If I want images to fill the entire screen, excluding the navigation header, what specific dimensions should these images be in order to display correctly on all type ...

What is the best way to select photos from a directory and showcase them on a webpage using HTML

I am currently working on developing an image slideshow feature for my website. I have created a basic code that displays a set of images in a slideshow format. However, whenever I add new images to the directory, I have to manually update the code to incl ...

I am attempting to build a party planning website but I am encountering an issue where the output is not generating properly. Whenever I click on the submit button, the information I input

I am struggling to create a party planner website and encountering issues with the output. Whenever I click on the submit button, the form just clears out without any feedback or result. Here is what the expected output should be: Validate event date 1: ...

What is the best way to set a specific image as the initial image when loading 'SpriteSpin'?

I'm currently working on creating a 360-degree view using the SpriteSpin API. Everything is functioning as expected, but I have an additional request. I need to specify a specific image to be the initial landing image when the page loads. The landing ...

Create a CSS animation that causes a div element to smoothly float out of the document

I want to add a CSS animation featuring clouds moving from left to right. In my design, I have a div with a 100% width containing cloud images styled with "position:absolute". My initial approach was simple: create an animation that gradually changes the " ...

How can I prevent the content from being pushed when the sidebar is opened in JavaScript and CSS? I want to make it independent

I'm struggling with making the sidebar independent of the main content when it's opened. I've included the CSS and JavaScript code below. Can someone provide assistance with this? function ExpandDrawer() { const drawerContent = docu ...

The text feature for the Google Places API is not displaying properly within the MUI TextField

For address auto-generation, I am currently utilizing the Google Places API. I have a regular input tag in my HTML where users can type their input and see Google Places suggestions in the dropdown - all working perfectly. However, when I switch to using m ...

What is the best way to incorporate multiple input boxes into a single alertbox for repeated use?

I attempted to use the same alertbox for 3 different input elements by converting it into a class and using getElementsByClassName, but unfortunately, it did not work as expected. Here is what I tried: <input type="text" class="form-control date notif" ...

Graphics distorting on android devices when implementing createjs and canvas technology

I have a question regarding the performance of my game that I'm developing to work on both desktop browsers and mobile devices. Using HTML5 and CreateJs, most of the game is being drawn on a canvas element. While everything runs smoothly on a standar ...

How to capture text outside of a HTML tag using Selenium with Python?

I need help extracting the specific text inside a div element that is not enclosed by a label. <div style="color:red;"> <label> Total Amount Due:</label> $0.00 </div> Only interested in retrieving the $0.00 amount from th ...

What is the best way to incorporate a button that can toggle the visibility of the sidebar on my post page?

Check out this post of mine I noticed a button on someone's page that could hide their sidebar and expand it again when clicked. How can I implement this feature? Is it a simple task? ...

What is the best way to transfer an object property to an event handler function for executing DOM manipulation tasks?

I am working on a React-rendered HTML page that displays a list of objects representing websites. I have successfully stored these objects in memory and can show them in a long list on the page without any issues. Recently, I added a button for each objec ...

Struggling to showcase array data in a visually appealing table format?

Hello, I am currently facing the following issue Here is a snapshot of my current website; https://i.sstatic.net/pNXNx.png I am trying to display content in a table from an array stored in a JSON file. Initially, I used a foreach loop which worked perfe ...

Trouble with displaying label in PDF post HTML conversion using iText html2pdf

Software Versions: html2pdf v2.0.1 iText 7.1.1 The HTML label that spans the width of the page is as follows: <label class="test">Patient</label> CSS Styling: .test { display: block; font-weight: bold; color: #009fd1; font ...

Making AJAX requests to retrieve data from a JSON database array, then utilizing the CSS visibility property to conceal HTML elements dynamically

As a enthusiastic beginner, I'm facing a challenge that seems to have no easy solution. Can someone please assist me with this: How can I assign all the ids from a JSON database to the variable dotContainer, in order to hide all corresponding HTML id ...

Implementing CSS and JS for targeted elements or functions in WordPress

I am currently managing a WordPress WooCommerce website My goal is to implement bootstrap CSS and js specifically for a function on my WooCommerce checkout page. The code I have written is as follows: if( current_user_can('administrator')) { fu ...