Creating custom shaped backgrounds with linear gradients

Is there a way to create a side beveled background using linear gradient? https://i.sstatic.net/3V9aq.png

Here is the HTML code:

<div class="signpost">
        <div class="column">
           
        </div>
        <div class="column bg-gray">
           
        </div>
        <div class="column">
        
        </div>
</div>

And here is the CSS code:

.signpost {display: table; width: 100%; height: 100vh; }
.signpost .column {display: table-cell; width: 33.33%; height: 100%; text-align: center;}
.bg-gray {background-image: linear-gradient(to left bottom, #ededed 0%, #ededed 100%, white 0%, white 0%);}

Check out this example for reference.

We appreciate your assistance in this matter!

Answer №1

Give this a shot

.marker {
  width: 100wh;
  height: 100vh;
  background: linear-gradient(to bottom right, blue 30%, transparent 50%) 0 0/40px 90% no-repeat,
              linear-gradient(to top left, blue 35%, transparent 55%) 100% 100%/60px 180% no-repeat, 
              #f0f0f0;
}
<div class="marker">
</div>

Answer №2

Using a variety of gradients:

linear-gradient(to bottom right, red 49%, transparent 51%) x-position y-position/x-size y-size

.container {
  width: 300px;
  height: 300px;
  background: linear-gradient(to bottom right, red 49%, transparent 51%) 0 0/30px 100% no-repeat,
              linear-gradient(to top left, red 49%, transparent 51%) 100% 100%/50px 200% no-repeat, 
              #ededed;
}
<div class="container">
</div>

Answer №3

An innovative concept featuring a single gradient:

.roadmap {
  display: table;
  width: 100%;
  height: 100vh;
}

.roadmap .section {
  display: table-cell;
  width: 33.33%;
  height: 100%;
}

.bg-gradient {
  background: linear-gradient(to bottom right,red 44%, #ededed 44.1%  55%, red 55.1%) center/100vw 1000vw;
}

body {
 margin:0;
}
<div class="roadmap">
  <div class="section">

  </div>
  <div class="section bg-gradient">

  </div>
  <div class="section">

  </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

Tips for displaying images dynamically in HTML using AngularJS

src={{logo}} var logo = 'localhost:3000/modules/images/default.png' I'm trying to display the image path dynamically, but it's not showing up in the HTML. Do I need to use quotes for src? Can someone please assist me with this issue? ...

The cards are not occupying the row as planned

The layout includes a navbar, side panel, and main panel for displaying data. I have nested rows and am trying to display 3 cards in the last nesting that fill the entire remaining width, but they are currently stuck to the left side: ...

How to perfectly align a modal box in the center

Hey everyone, I could really use some help. I'm struggling to find the right formula to center this modal (http://www.queness.com/post/77/simple-jquery-modal-window-tutorial) on my browser, which has a size of 1263X582. I've been trying to use th ...

Steps to include a CSS file in Laravel 5.6 using npm

Here are the steps I've taken: Installed bootstrap-select using npm Edited resource/assets/bootstrap.js to add "require('bootstrap-select'); Executed npm run prod My Questions: Does the bootstrap-select library include sass or css files, ...

Having trouble retrieving the accurate height value for the UIWebView

Currently, I am attempting to retrieve the value of a UIWebView using the following approach: var webview = self.articleContent println(webview.frame.size.height) // This outputs 300 // Now rendering the w ...

Why is the hamburger and cart icon positioned below the hamburger menu when opened?

During my journey of learning responsive design, I encountered an issue where the hamburger and cart icon appeared below my hamburger menu instead of the top-right corner. I am unable to pinpoint the problem within my code. To provide better clarity, I ha ...

Adjusting the width of titles in a CSS menu upon hover

I am currently creating a basic CSS menu. However, I am facing an issue where selecting a menu title in the menu bar causes the width of the title to extend to match the width of the associated menu, which is not my desired outcome (the title's width ...

The issue of JQuery UI Dialog remaining open even after triggering it through an Input focus event

I am facing an issue with JQuery and JQuery UI. I thought upgrading to the latest stable version would solve it, but unfortunately, that was not the case. I am currently using Chrome. When I initiate the dialog by clicking on a specific element, everythin ...

Issue encountered with Tailwind Color Classes not functioning correctly when triggered by a button click within NextJS and React Vite framework

Recently, I've developed a component showcasing the "Text Gradient" effect in Tailwind + React. The component comprises of 4 select dropdowns and a "randomize" button. Upon clicking the button or selecting an option from the dropdowns, the changes are ...

Adjusting the header background color and inserting a logo once a specific threshold is reached

Currently, I am designing a website where I need the background color to transition from transparent to black and display a logo once the user scrolls down to a certain point. I am a beginner in javascript and I am facing some difficulties with this task. ...

The scroller's height is displayed at 100%

I'm experiencing an issue with the scrolling of a division. I've set the overflow to "scroll" for the division, but it's displaying at 100% height. Please refer to the screenshot provided. Can you advise me on which properties I should adjus ...

Exploring the process of integrating absolute paths within a global SCSS file in a VueJS project

The webpack configuration in my vue.config.js file looks like this: const path = require("path"); module.exports = { pluginOptions: { 'style-resources-loader': { preProcessor: 'scss', patterns: [ "./src/style ...

Tips for altering the color of the email text as it is being typed into the input field

Is it possible to customize the text color while typing email in an input field? <form action=""> <input type="email" name="mail" id="" placeholder="Your Email"& ...

Steps for preventing form submission when the username is unavailable

After checking the availability of the user name, I encountered an issue where the form still gets submitted even if the username is not available. Updated Code: <SCRIPT type="text/javascript"> $(document).ready(function(){ $("#emailch").change(fu ...

Creating dynamic HTML elements using ngFor within AngularJS allows for increased flexibility and customization on the

I'm a newcomer to Angular 5 and I'm looking to retrieve HTML elements from a .ts file and dynamically add them to an HTML file using ngFor. I attempted to use [innerHtml] for this purpose, but it was not successful and returned [object HTMLSelect ...

Having difficulty removing whitespace from JavaScript code

Struggling to align a div using Javascript on my professor's website to match the spacing of the rest of the site. Despite attempts at adjusting margins and following suggestions from other Stackoverflow.com threads (e.g. CSS: Center block but left al ...

Encountering a Javascript Error when trying to begin

As a beginner in Javascript, I am venturing into designing a simple website that incorporates Javascript. Currently, my focus is on building a calculator. However, upon loading my website, nothing seems to initiate and there are no error messages displayed ...

What methods can I utilize to transmit Global variable data from a view to a controller?

In my Angular view file, I have the following code snippet. <!DOCTYPE html> <video id="myVideo" class="video-js vjs-default-skin"></video> <script> var dataUri; var videoData; var player = videojs("myVideo", { controls ...

Creating responsive Twitter Bootstrap layouts that include nested containers with beautiful background images

I am currently working on nesting containers using Twitter Bootstrap in order to achieve the layout shown in this screenshot. The height of the bubble image in the PSD is 404px, and I need it to be responsive across all devices while scaling appropriately ...

What is the best way to display an arrow specifically for the selected item in JQuery?

Check out this example I've been working on: https://jsfiddle.net/6yg8ckno/ HTML Preview: <div class="patrat1 inline"> <p class="menu1"><img class="sageata" src="http://paul.dac-proiect.ro/wp-content/themes/wpbootstrap/images/log ...