Guide to making a split background color design using only CSS

Looking for some help in designing a footer for a website with a split color design featuring two overlapping triangles. Any creative ideas are welcome!

Thank you!

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

I tried to achieve this effect using the following code:

    background: linear-gradient(120deg, #ba5459 48%, #97444c 48%);

Answer №1

Forget about overlapping triangles, what you're seeing is actually a unique CSS property known as clip-path that allows you to cut out shapes from rectangular divs. Start by creating a div element and then apply the following clip-path property in your CSS code. Experiment with different values to see how it changes the shape.

clip-path: polygon(0 24%, 100% 0%, 100% 99%, 0% 100%);

If you want to dive deeper into clip path, check out this resource here.

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

If checkboxes are found within the table's rows and cells, add the parent row class if none of the

I am attempting to implement a small script within my table under the following conditions: The table contains a checkbox within each tr td, and I want my jQuery script to be applied only if the selector identifies a tr where all td checkboxes are unchecke ...

Failed to set audio source to the source tag after receiving the ajax request

When making an ajax request to the database, I receive an audio link in response. The link is accurate in the variable but is not binding in the source tag. Below is the HTML code I am using to play the audio: function play(){ } < ...

I seem to be having trouble getting innerHTML to function properly

Whenever I attempt to showcase HTML code from a DIV element, the innerHTML function fails to retrieve its contents: <div id="container"> <tr> <td style="background-color: #ffffff;">TEST</td> </tr> </div> ...

Check the validity of the data by logging into another website

I've run into a bit of a problem while working on my website. Here's a brief explanation (using fake addresses), I have a website, www.website1.com, with lots of well-coded elements. You can log in to this website using www.website2.com. So whe ...

Is there a way to customize the design of an HTML scrollbar to resemble the one often seen on Google search engine result pages

While casually browsing online, I stumbled upon something truly unique. The image below shows a Google search result in Firefox that I have never encountered before or since. This screenshot captured a search result that was scrollable within itself. Isn& ...

Retrieve data from an external website containing an HTML table without a table ID using Java Script and transform it into JSON

I have developed a script that can convert HTML table data into a JSON Object. To accomplish this task, I utilized the jquery plugin created by lightswitch05. With this code, I am able to extract data from an HTML table on the same web page using: var t ...

Ways to include text underneath icons using HTML and CSS

Seeking guidance on how to display text below icons on my website. Can someone please provide instructions? <div class="bottom-bar div-only-mobile" style="position: fixed; bottom: 0; width:100%"> <a href="Dashboard"> <ion-icon name= ...

Using the class for jQuery validation as opposed to the name attribute

I am looking to implement form validation using the jquery validate plugin, but I am facing an issue with using the 'name' attribute in the html since it is also used by the server application. Specifically, I want to restrict the number of check ...

Customizing Your WordPress Menu with HTML5 Features

Can someone assist me in creating a customized WordPress menu? I am facing issues with unnecessary classes added by WordPress and the lack of certain attributes on dropdowns. Below is the HTML code: <nav class="navbar navbar-default navbar-static- ...

Tips for organizing components in jQuery Mobile

Displaying a survey creation form: <!-- HTML structure --> <div data-role="page" data-theme="b"> <div data-role="header"> <h1> Create Survey </h1> </div> <div id="main" data ...

Sticky Sidebar Attached to Parent Container with Smooth Sliding Effect

Is it possible to have my sidebar push the content across when opened, while keeping the fixed navigation relative to its parent element instead of the viewport? The sidebar works fine in Firefox but breaks out of the parent in Chrome. Link to JSFiddle & ...

CSS Peculiar Black Frame

I've designed a box with a fading background effect. However, I am encountering an odd black border on the right side that I cannot seem to resolve. (The intentional absence of the left border may be causing this issue.) #fadebox { width: 300px; ...

Utilizing several carets in a single or multiple text areas and input boxes

Just a quick question... Can a textbox have two carets simultaneously, or can we have two separate textboxes both focused at the same time? I am aware of simulating this using keydown listeners but I'm specifically looking for visible carets in both ...

Confirmation message for deletion using jQuery on dynamic elements

My div is populated with dynamically added records. Whenever I click on the 'Remove' link, a confirmation box pops up multiple times corresponding to the number of records present in the div. I want the confirmation box to appear only for the spe ...

Revert button design to default after second click

Looking for some assistance here. I have a button that toggles between displaying and hiding information. When the information is displayed, it should have one style, and when it's hidden, it should have another. Currently, I'm able to change the ...

Display or conceal specific fields depending on the selection from a dropdown menu

I'm currently experimenting with using JavaScript and/or jQuery to dynamically hide specific HTML elements based on the selection in a drop down menu. Here is what my page setup looks like: [Drop down menu] [text field 1] [text field 2] [text field ...

What is the best way to create this using html and css?

Struggling to recreate a design I was given: https://i.sstatic.net/G4jFA.jpg I currently have this setup: https://i.sstatic.net/8GSRK.png How can I insert vertical lines spanning the full height between the options? <ul id="navigation"> < ...

Is Chrome Facing an Autofill Glitch?

Can someone explain this strange behavior? When using Chrome, clicking on an input field triggers autocomplete for "country." However, if you change "country" to "city," the autocomplete shifts to that field instead. This issue seems to be isolated to thi ...

Adding padding to navigation items in Bootstrap 5 when the collapsible navbar is expanded

How can I modify the CSS rules for nav items in a Bootstrap 5 collapsible navbar to have proper padding and margins only when they are expanded and the buttons are on the right side? <!DOCTYPE html> <html lang="en"> <head> <meta ...

What is the best way to establish a minimum width in pixels and a maximum width determined by the variable width of the browser window?

In this scenario: http://jsbin.com/anoyik/edit#preview http://jsbin.com/anoyik/edit#source Is there a way to make the red box's width a minimum of 200px and allow it to expand as the browser window's width increases horizontally? ...