Make an inner circle within a larger circle and customize the background

After finding an image online displaying a timeline with text above and below each bullet point, I decided to create my own version. You can view the result in this demo

Here is the HTML code:

<ul class="timeline" id="timeline">
    <li class="li complete">
      <div class="timestamp">
        <span>Expire:</span>
        <span>Hours: </span>
      </div>
      <div class="bullet">
        <h5>Awarded Time</h5>
      </div>
    </li>
    <li class="li complete">
      <div class="timestamp">
        <span>Expire:</span>
        <span>Hours:  </span>
      </div>
      <div class="bullet">
        <h5>Advance Time</h5>
      </div>
    </li>
    <li class="li complete">
      <div class="timestamp">
        <span>Available Time: </span>
        <span>&nbsp;</span>
      </div>
      <div class="bullet">
        <h5>Total</h5>
      </div>
    </li>
</ul>  

Inspired by a specific image featuring an additional bullet within each bullet point, I would like to achieve a similar effect. Here's an example of what I'm aiming for:

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

What steps should I take to implement this nested bullet structure?

Answer №1

Inspect the code carefully to identify the section responsible for styling the bullet point's background.

An effective method is to use your browser's developer tools to inspect and manipulate different background colors, helping you locate the relevant CSS properties.

In this instance, I discovered that the before pseudo element of the bullet was controlling the background, so I made modifications to give it a border and a new background color:

.li.complete .bullet::before {
  background-color: #eeeeee;
  border: solid blue 2px;
  transition: all 200ms ease-in;
}

Note: Pseudo elements are now denoted with a double colon to differentiate them from pseudo-classes, although browsers generally still support :before for compatibility reasons.

Answer №2

In each div labeled as bullet, a new div should be inserted with identical dimensions and positioning as the circular shapes (.bullet:before). Furthermore, include properties such as display:flex, align-items:center, and justify-content:center within this div. Inside this newly added div, create another one with dimensions of 70% for both height and width, a border-radius of 50%, and a unique background-color.

HTML:

<div class="bullet">
    <div class="inside">
      <div class="circle"></div>
    </div>
    <h5>Awarded Time</h5>
</div>

CSS:

.inside {
  width: 25px;
  height: 25px;
  position: absolute;
  top: -15px;
  left: 42%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.circle {
  height: 70%;
  width: 70%;
  border-radius: 50%;
  background-color: #fff;
}

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

A technique for adding a border to a Mat Card that mimics the outline of a Mat Form Field within a custom

I am faced with a unique design challenge where I am utilizing the MatCardComponent and each card contains a table. I would like to incorporate a floating label within the border gap similar to what is seen in MatFormField. https://i.stack.imgur.com/51LBj ...

Customizing Javascript for Mouse Exiting Browser Window

I have implemented a JavaScript function on my website to display a lightbox when the visitor's mouse goes beyond the browser window. You can check it out here: [http://mudchallenger.com/index-test2.html][1] However, there seems to be an issue where ...

Position an element in the middle of the range between the tallest and shortest characters

Is there a way to vertically center an element between the tallest and shortest characters of another element (preferably using just CSS, but JavaScript is also acceptable)? I want it to be aligned with the actual text content rather than the line height, ...

Achieving a responsive card layout in Reactjs with Bootstrap by displaying four cards in a single row

const DisplayCategory = () => { const history = useHistory(); useEffect(() => { axios.get('http://localhost:8080/products', { headers: { Authorization: "Bearer " + localStorage.getItem("token&q ...

Angular - issue with getting window.screen.height in template

One issue I'm facing is when attempting to optimize a section of my template for mobile devices in landscape mode. TS: window = window; Template: <div [ngStyle]="{'height': window.innerHeight < window.innerWidth ? window.screen ...

The input field does not accept any values even after setting it to be editable

Hey there! I have a specific requirement where I need to edit certain fields by clicking on an edit link. Initially, these fields will be disabled and in a readonly state. Once I click on the edit link, the field should become blank and editable. The issu ...

Ways to stop a background image from repeating?

<div style="background-image: url('https://i.ibb.co/v1B855w/bg15.png'); color: #000000; background-color: #000000; background-attachment: fixed; text-align: center;"><img src="https://i.ibb.co/L6zQY0S/name6.png" /> ...

Exploring HTML5 video playback in AngularJS

When I use this code: <video id="video" class="video-js vjs-default-skin" controls width="640" height="264"> <source src="http://localhost:3000/files/public/photos/Let-her-go.mp4" type='video/mp4' /> <p class="v ...

Ensuring Quick Response Times When Incorporating Personalized Text Styles into Twitter Bootstrap

Currently, I am experimenting with incorporating my custom class titled "article-title" which is significantly larger than the default H1 font size in Twitter Bootstrap. Can someone provide guidance on the necessary steps to ensure responsiveness? My goal ...

Creating stylish grid-based tables in Bootstrap 4

I'm currently updating the front-end of an application by utilizing bootstrap 4. I've encountered tables in certain sections of the application that I want to replace, so I'm converting them into a .row/.col grid system. While bootstrap prov ...

Calculating values within dynamically generated elements requires utilizing JavaScript to target and extract the

I am working on creating input fields inside an HTML table using Vue.js. On click of a button, I want to perform some calculations based on the input values. However, it seems that the calculations are not happening as desired. What I have attempted so fa ...

Automatically Populate Text Field with the URL of the Current Page

I am hoping to automatically fill a hidden text field with the URL of the current page so that I can keep track of where form submissions are coming from. This simple solution will help me streamline my inquiry responses and save time. To clarify, upon lo ...

Is the absence of http(s) in <link ...> causing any issues?

I recently noticed a peculiar link on the Font Awesome homepage that seems to work without including http or https. <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet"> This made me wonder, what does // a ...

Switch between display modes using a button and CSS media query

I'm trying to find the most effective method for toggling display states on a webpage using a button while also being able to adjust based on screen size. For larger screens, I want to default to a horizontal layout with the option to switch to vertic ...

Elements missing from the Bootstrap 5 framework

I've been attempting to link my bootstrap card deck to a mongo database with ejs. The website renders without any errors, but for some reason, the cards are not displaying. Does anyone have any insight into what could be causing this issue? Below is ...

The "hidden" class in Bootstrap 4 is not functioning as expected

I have Bootstrap v4 set up with its default CSS and JS. I'm attempting to use the classes hidden, hidden-XX-down, and hidden-XX-up on different divs, buttons, etc. However, it doesn't seem to be having any effect. All other classes are working fi ...

designing alternating rows within a table

Can I apply styles to alternating rows in an HTML table using only element hierarchy selectors and avoiding style names? I am tasked with styling the HTML output generated by a server component, which does not include styles for alternate rows. While I co ...

Prevent automatic image blurring within an SVGZ file

Utilizing SVGZ images on my HTML pages for their ability to be resized. These SVGZ images consist of enlarged PNGs that have been altered in specific ways that I desire to maintain, pixelation and all. Firefox is rendering them correctly (as designed in In ...

Tips for creating a high-quality file upload button in Laravel 5 using Bootstrap 4

I need a file upload input similar to the one showcased in this example <input type="file" id="dp_file_input" name="demo" /> The current file input design is not visually appealing, so I am looking for a solution like the one demonstrated in the ...

maintaining the consistent stylesheet and displaying data on the same page dilemma

https://i.sstatic.net/zgRz5.jpg Code for index.html <html xmlns="http://www.w3.org/1999/xhtml"> <head> <?php include ('recherchecommande.php') ; ?> <title>Pâtisserie Baya</title> ... Code for search.php <?p ...