The CSS linear gradients rainbow wheel is missing a few sections, only displaying part of its 12

I've almost got everything working, but I'm facing a challenge in displaying all 12 sections of the rainbow wheel. I know it's probably something very simple (Occam's razor). I've been following this amazing tutorial on CSS linear gradients: Delve deep into the world of CSS linear gradients but I seem to stumble at the final hurdle.

Check out my Codepen here for a working example: https://codepen.io/snarf1974/pen/aywZZJ

body { background: white; } 
.colorWheel {
  position: relative;
  margin: 1em auto;
/*   border: solid 2em white; */
  width: 16em; height: 16em;
  border-radius: 50%;
  -ms-transform: rotate(45deg);
  transform: rotate(45deg);
  background: 
    linear-gradient(30deg, #9bcb61 36.78%, transparent 36.78%),
    linear-gradient(60deg, #f6e04e 68.41%, transparent 68.41%);
  /* More linear gradient styles... */

  background-repeat: no-repeat;
  background-size: 50% 50%;
}
.colorWheel:after {
  position: absolute;
  top: 50%; left: 50%;
  margin: -7em;
  width: 14em; height: 14em;
  border-radius: 50%;
  background: white;
  content: '';
}

.center {
  text-align: center;
        position: absolute;
        top: 22%;
        transform: translateY(-50%);
        padding: 1.5em;
        font-size: 1.4em;
      font-color: black;
      z-index: 1;
      -ms-transform: rotate(315deg);
        transform: rotate(315deg);
}

If anyone can shine some light on this issue, it would be greatly appreciated!

Answer №1

It appears that there are only 11 colors mentioned in your query: pink, yellow, cyan, orange, green, lawngreen, red, fuchsia, black, hotpink, purple.

I made a modification by inserting this code snippet before the lawngreen section:

linear-gradient(30deg, transparent 63.61%, blue 31.59%) 100% 100%,

body { background: white; }

.colorWheel {
  position: relative;
  margin: 1em auto;
  /* border: solid 2em white; */
  width: 16em; height: 16em;
  border-radius: 50%;
  -ms-transform: rotate(45deg);
  transform: rotate(45deg);
  background: 
    linear-gradient(30deg, #9bcb61 36.78%, transparent 36.78%) 0 0,
    linear-gradient(60deg, #f6e04e 63.22%, transparent 63.22%) 0 0,
    linear-gradient(90deg, #f4c64d 100%, transparent 100%) 0 0,
    linear-gradient(-30deg, #f0463e 36.78%, transparent 36.78%) 100% 0,
    linear-gradient(-60deg, #f57d42 63.22%, transparent 63.22%) 100% 0,
    
    linear-gradient(30deg, transparent 63.22%, #c14273 63.22%) 100% 100%,
    linear-gradient(60deg, transparent 36.78%, #86489b 36.78%) 100% 100%,
    linear-gradient(90deg, transparent 0%, #008fca 0%) 100% 100%,
    linear-gradient(-30deg, transparent 63.22%, #82ba75 63.22%) 0 100%,
    linear-gradient(-60deg, transparent 36.78%, #00b8a9 36.78%) 0 100%,
    
    #f9a260 linear-gradient(#00bced, #00bced) 50% 100%;
  background-repeat: no-repeat;
  background-size: 50% 50%;
}

.colorWheel:after {
  position: absolute;
  top: 50%; left: 50%;
  margin: -7em;
  width: 14em; height: 14em;
  border-radius: 50%;
  background: white;
  content: '';
}

.center {
  text-align: center;
  position: absolute;
  top: 22%;
  transform: translateY(-50%);
  padding: 1.5em;
  font-size: 1.4em;
  font-color: black;
  z-index: 1;
  -ms-transform: rotate(315deg);
  transform: rotate(315deg);
}
<div class='colorWheel'>
  <div class='center'>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</div>
</div>

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

Learn how to dynamically highlight a table row when any changes are made to it using jQuery

Is there a way to automatically highlight the current table row when any input text or image is changed within that specific row using jQuery? In the given code snippet below, with two rows provided, how can one of the rows be highlighted upon modifying ...

Inject HTML entities, escaped for CSS, dynamically using JavaScript

My goal is to dynamically generate a list of HTMLElements with unique data-* attributes that correspond to various HTML Entities. These attributes will then be utilized by CSS to display content in pseudo elements like this: li:after { content: attr(dat ...

Simple 3-column grid design in HTML and CSS

My task is to design a 3-grid layout that resembles the following structure: ------------------------------------- | Image | The name of logo | > | ------------------------------------- I attempted this using the code below: <div class=" ...

Issue in Firefox: Footer is wrapping around the main content

Hey, I've been dealing with a pesky bug that just won't go away. We're currently working on a redesign for www.petpoint.com - The footer looks perfectly fine in every browser except for Firefox. It gets all jumbled up for some reason. I&a ...

Tips for customizing the appearance of a label when a MUI Radio Button is selected

Hello everyone, I am attempting to customize the label text color of a radio button to turn blue when selected. https://i.stack.imgur.com/btSc2.jpg HERE IS THE CODE FOR MY MUI BUTTON SO FAR import * as React from "react"; import Radio from &quo ...

Steps to Show an Image When Hovering and Clicking on the Relevant Div

CSS: .imgECheck { position: absolute; top: 0; right: 5px; width: 15px; height: 15px; display: none; } .imgFCheck { position: absolute; top: 0; right: 5px; width: 15px; height: 15px; display: none; } Is ther ...

Navigating between two intervals in JavaScript requires following a few simple steps

I have created a digital clock with a button that switches the format between AM/PM system and 24-hour system. However, I am facing an issue where both formats are running simultaneously, causing the clocks to change every second. Despite trying various s ...

Steps for filling an HTML table within a dynamically loaded DIV

I have a container in my HTML page where I dynamically load other pages using the jQuery.load() function. One of the pages requires me to populate a table from the database just after/before it loads. How can I trigger a JavaScript function to execute righ ...

Error: PHP syntax error occurred due to unexpected double-quote mark

As a beginner in php, I've been encountering an error in my code echo "<a href=\"PHadmin_deletePatient.php?id=<?php echo $row["PatientID"]; ?>\" class='delete' title='Delete' data-toggle= ...

JQuery class for swapping elements upon scrolling

I am currently working on a navigation bar that changes classes to create a fading effect for the background. The approach I have taken involves targeting the window itself and monitoring the scroll position of the user. If the user scrolls down more than ...

What is the reason for nth-of-type selectors not functioning on the third element?

I have a question regarding CSS nth-of-type. In the following code snippet, nth-of-type(2) and nth-of-type(3) are functioning properly, however, nth-of-type(4) and nth-of-type(5) are not working as expected. Could there be an issue with my code? <div i ...

What is the best way to update or reload an embedded application/pdf?

I have implemented an embed code using application/pdf in order to display a pdf document on the website. To dynamically change the src attribute of the embed when a link is clicked, I utilized javascript. I confirmed this action by displaying alerts to e ...

Automatically populating form fields with Selenium (less-than-stellar HTML present)

My current task involves: Entering my email Clicking submit If the message "check again later" is displayed, repeat until the message changes to "you are in!" Here's the code snippet I have written so far: PATH = "D:\Program Files (x86)&bs ...

Creating a dynamic website with user-friendly editing capabilities

Having a good understanding of html5 and css3, I am currently exploring ways to create a website that enables visitors to edit content in real time for all other users to see. While aware of the contenteditable attribute, I have found that it does not reta ...

center text above images in flexbox when page is resized

When resizing the page, I'm facing an issue where the links overlap with the images in a flexbox layout. It seems like the padding and margin between the images and links are not working due to them not being "related" or connected. I believe I need t ...

Tips for aligning text and image in the center of a div with a specific width:

I'm having a hard time figuring this out for some reason. I need to center both text and an image on the same line within a div that has a 100% width. Check out this jsfiddle link for reference: http://jsfiddle.net/JnbeJ/ ...

Expanding the navigation bar causes it to reach the second row after being translated

I am currently working on a website that will be dynamically displayed in both English and Spanish. One issue I have encountered is that the longer words in Spanish are causing the navigation bar to spill onto a second row. For more details, please visit: ...

Recurrence of solely the middle segment of the separator's background picture

I have a unique divider image with fading top and bottom parts. I'm wondering if it's possible to use a sprite and 3 divs to only repeat the middle section, considering that my height is variable. Do I need separate images for the top, middle, an ...

The drop-down menu keeps flickering instead of remaining open when clicked

I am facing an issue with a dropdown menu in my webpage. The menu is initially hidden, but should become visible when the list element containing it is clicked. I have written JavaScript code to add a class that changes the visibility property to visible u ...

Using force-directed layout to access and retrieve specific data from external or internal data sources

Just starting out with d3js and currently working on modifying the Force directed layout found at http://bl.ocks.org/mbostock/1153292 I have managed to make it so that when I hover over the node circles, the corresponding source value filenames should app ...