I am currently working on a unique design concept for a website we are developing. The header requires a parallelogram shape above it and a trapezium shape to the right of the container, as illustrated below.
Successfully implementing the parallelogram above the container was achievable, but I am encountering difficulties when trying to position the element to the right of the container. Here is what I have accomplished so far:
HTML
<div class="container">
<div class="row">
<div class="col">
Content Goes Here
</div>
</div>
</div>
CSS
.container {
width: 700px;
}
.container:before {
content:'';
width: 100%;
height: 30px;
transform: skew(45deg);
background: #254896;
background: linear-gradient(90deg, #254896, #2c2b5b 100%);
display: block;
}
.row {
background: #f8f9fa;
}
.row:before {
content:'';
width: 100%;
height: 0;
border-image-source: linear-gradient(90deg, #FF0000, #940202);
border-image-slice: 1;
border-top: 30px solid red;
border-left: 30px solid transparent;
position: absolute;
left: 800px;
top: 30px;
}
.col {
background-color: #ddd;
padding: 10px;
}
https://jsfiddle.net/scarrott/vgtpna14/
The challenges I am facing include:
- Ensuring the red shape aligns properly to the right of the container across various screen sizes.
- Applying a gradient fill to the trapezium shape without distorting its geometry. Using border-image-source causes the shape to appear as a rectangle.
Your assistance in resolving these issues would be highly appreciated.