Styling with Radial Gradients in CSS

Struggling to create a banner with a radial gradient background? I'm almost there, but my code isn't matching the design. Any assistance would be greatly appreciated as I can't seem to get the right colors and only part of the first circle is displaying.

This is the design I'm trying to achieve: View image here

Below is the link to my CodePen:

https://codepen.io/aneelk/pen/JjaeNqO

<template>
  <div id="app">
     <div class= "header3">
       <div class = "header-circles"></div>
         <p class="welcome-to-your-dash2">Welcome to your dashboard</p>
         <p class="left-text2">SCHOOL SMART GOALS : <span class='color-green'> 183 </span> SET  <span class='color-green'> 96</span> ARCHIVED</p> 
  </div>    
  </div>
</template>

<script>
export default {
  data() {  
  },
  methods: {
    
  }
};
</script>

<!-- Use preprocessors via the lang attribute! e.g. <style lang="scss"> -->
<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}

  .color-green{
  height: 24px;
  width: 61px;
  color: #37B729;
  font-family: ".SF NS Display";
  font-size: 21px;
  letter-spacing: 0;
  line-height: 24px;
  }
  
     .header3 {
    height : 200px;
    width: 100%;
    background-color:  #032D36;
    overflow:hidden;
             position: relative;

  }
     .welcome-to-your-dash2 {
  color: #FFFFFF;
  font-family: "Open Sans";
  font-size: 24px;
  letter-spacing: 0;
    margin-top: 10%;
    margin-left: 10%;       
       z-index: 5;
    position: absolute;

  }
  .left-text2 {
   color: #FFFFFF;
   font-family: ".SF NS Display";
   font-size: 12px;
   color: #FFFFFF;
   margin-top: 10%;
   margin-right: 10%; 
   position: absolute;
   z-index: 5;
   right: 0;
  }  
  .header-circles {
   width:100%;
   height: 100%;
  background-image: radial-gradient(circle at -25% 50%,#fff 0%, #0D414D 0%, #0C5D70 0.1%, transparent),radial-gradient(circle at 60% 10%, #0C5D70 20%, #0D414D 5%, transparent), radial-gradient(circle at 10% 10%, #0C5D70 9%, #0D414D 1%, transparent) ;
     opacity:50%;
      position: absolute;
z-index: 0;

  }
</style>

As someone new to CSS gradients and still learning, any guidance on how to improve my design would be invaluable. I've outlined my issues and current progress in the description above. View image here

Answer №1

After reading your latest comment, I decided to create a simplified version of your UI by featuring a single circle with a vibrant glowing center. This will enhance readability and comprehension. Essentially, the code dictates "draw a circle positioned at x=10%, y=10%. The center color should be #4C9DB0. At 9% of the circle's width, it transitions to #0C5D70, followed by transparency for the rest of the circle". You can find more formatting details and use cases in the radial gradients documentation.

The smooth shift from #4C9DB0 to #0C5D70 at the circle's center creates the desired "glow" effect. It's worth noting that #4C9DB0 is simply an adjusted version of your provided color towards white; you have the flexibility to tweak this as needed.

.header-circles {
   width:100%;
   height: 100%;
   background-image: radial-gradient(circle at 10% 10%, #4C9DB0, #0C5D70 9%, transparent 9%) ;
   opacity:50%;
   position: absolute;
   z-index: 0;
  }
  
  .header3 {
    height : 200px;
    width: 100%;
    background-color:  #032D36;
    overflow:hidden;
    position: relative;
  }
<div class="header3">

  <div class="header-circles">
</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

Centralizing the Accordion header and expansion icon in React with Material-UI

I'm currently incorporating the Accordion feature from Material-UI library into my React project: My goal is to ensure that the accordion summary (header with "Accordion 1", "Accordion 2") is centered, and the expand icon (arrow) is also centered rig ...

The CSS3 Transform feature kicks in only after the window is resized in Mozilla Firefox

I have created a pure CSS3 parallax webpage by following the method outlined by Keith Clark and using a sample made by Carl Henderson (I can't provide a direct link to his codepen due to my lack of reputation). You can find the code in the main page, ...

What is the most conventional method for documenting the types within a Vuex state declaration?

Within one of our components, we are dealing with a substantial state that looks like this in the code: export default { someObject: {}, someOtherObject: {}, evenMore: [] <etc...> } It's difficult to understand what's happening wi ...

Adjusting text alignment to span the entire width with consistent automatic spacing

Imagine if I have a collection of N words. To illustrate, consider the following: Dog Peanut Oranges Lemon Disciplinary All these words vary in length. Let's assume there is a container with a variable width X (the container may adjust its size ac ...

Stop the replication of HTML/CSS styles during the extraction of content from a div

Is there a way to prevent the copying of CSS properties, such as font styles and sizes, when content is copied from a div? I want only the plain text to be copied to the clipboard, without any formatting applied. ...

Delete the final comma in a JSON file using JavaScript so that it can be utilized by a Vue application

Using Axios in my Vue app, I am consuming a JSON file. The field "country" contains trailing commas which are creating issues. Here is the structure of the JSON: "country": "spain,france," .... "country": " ...

Is the CSS Transition Solely Active for the Introductory Animation?

I'm currently looking to enhance the smoothness of div expansion and contraction on hover using CSS transitions. However, I have noticed that the Transition property only seems to affect the entry animation (i.e., when the mouse hovers and the div exp ...

Guide on showcasing jQuery variable values in PHP on a single page

I have some JavaScript and PHP code that I need help with. I want to assign a jQuery variable value to a PHP variable called $nicks, and then echo the value of $nicks on the same page. <script type="text/javascript"> var axel = 131.5678466; < ...

What is the reason for the Pinia Persistedstate Plugin breaking when the statement "useUserStore(store)" is called in a Quasar boot file?

Currently, I am attempting to integrate the Pinia Persisted State Plugin with Pinia in my Quasar application (Vue 3 / TypeScript). Initially, everything functions correctly right out of the box. However, the persisted state ceases to operate when incorpo ...

Tips on utilizing CSS modules in React without changing class names

After starting to use css modules in my react project, I quickly realized the struggle of changing classnames to fit the requirements of css modules. For example, if we have a component using regular css: import React from 'react' import ". ...

Showing a Bootstrap.vue b-table containing nested arrays within arrays

I am facing an issue while trying to display data in a b-table. Normally, it works well with most data sets. However, when I encounter another array nested within the referenced array, the rendering is not done properly. While working on this problem, I ...

Using jQuery to alter the background position of multiple backgrounds in CSS

I'm using jQuery to dynamically adjust the background image position of an element based on screen resolution. Here's the code: var pwwidth = $(window).width(); var pwheight = $(window).height(); var bg1posx = pwwidth - $('h1.portofolio&ap ...

Using CSS syntax to target a class within an element distinguished by its unique id

Consider the following code snippet: <div id="dogs" class="content">hello</div> <div id="frogs" class="content">hello</div> <div id="hogs" class="content">hello</div> <div id="logs" class="content">hello</div&g ...

Expanding the padding of the selected item to create more breathing room

Upon examining the following: https://jsfiddle.net/h8kmove5/27/ Let's say you select 9 at the bottom. The display shows 8 9 10. My intention is to create some additional space on either side of 9, or any other active item for that matter. This way, ...

Utilizing environment variables in Vue.js and Azure DevOps for seamless integration

Currently, I am working on a project and utilizing Vue.js for the frontend. While testing locally, everything is functioning as expected with different environment variables set in .env.development and .env.production files. However, I have encountered an ...

Using the Croppie plugin to crop an image before uploading via jQuery Ajax in PHP

I've successfully implemented a code snippet that allows image cropping using PHP, jQuery, and Ajax with the Croppie plugin. Currently, I'm facing an issue while trying to include additional input values along with the image upload process. I ...

How can we display an absolutely positioned div when hovering over a card with the help of Tailwind CSS?

I am currently working on a Next.js application with Tailwind CSS. I would like to implement a feature where additional information is displayed when hovering over a product card, similar to the functionality seen on wildberries.ru. I have tried using &apo ...

Which HTML element does each script correspond to?

Are there any methods to identify the script used in certain HTML elements? For instance, if I wish to determine the script responsible for creating a drop-down menu, I can locate the HTML and CSS for the menu but not the JavaScript (or other scripts). I ...

Showing formatted JSON in the view using ASP.NET MVC

Is there a method to modify JSON for presentation in the interface? I am looking for a way to automatically update my API documentation when adding new properties. It would be great if I could also apply CSS styling to certain elements. This feature is som ...

Tips on how to prevent a video from playing in the background of a popup even after it has been closed

After creating a video popup that plays upon clicking a button using jQuery, I encountered an issue where the video continues to play in the background even after closing the popup by clicking the close(X) button. Below is my code, can someone assist me in ...