Tips for creating a responsive curved header using SVG or alternative design methods

I'm currently working on creating a stylish curved header, and I could really use some guidance or suggestions on the best approach to achieve the design shown in this image. As someone who's not well-versed in development, I'm finding it quite challenging.

Here's the image of the theme with the curved header

Below is the code I've been using. How can I modify it to replicate the exact header from the image above?

*{
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}
:root{
    --red-color:#FF5F6D;
    --white-color:#FFFFFF;
    --yellow-color:#fff9c4;
}
body{
    padding: 0;
    margin: 0;
}
.wrapper{
    display: grid;
    grid-template-columns: 1fr;
    text-align: center;
    align-items: center;
    justify-content: center;    
      
}
.wrapper >*{
    font-size: 1.5rem;
    font-weight: 800;
}
.t-orange-nav{
    background-color: var(--red-color);
    color: var(--yellow-color);
    position: relative;
}

.t-orange-nav > div {
  border-bottom: 3px solid white;
  max-width: 800px;
  margin: 0 auto;
  padding: 20px 0;
}

.t-orange-nav p {
  font-size: 10px;
}

.t-orange-header{
  padding: 20px 0;
    background-color: var(--red-color);
    height: 200px;
    color: var(--yellow-color);
    width: 100%;
    margin: 0 auto;
    background: linear-gradient(#FF5F6D , #FFC371 );    
}


.t-orange-section{
  background-color: var(--white-color);
   color: #FF5F6D;
   height: 300px;
   width: 95%;
   margin: 0 auto;
   
}

.t-orange-section > div {
  border-bottom: 3px solid black;
  max-width: 1000px;
  margin: 0 auto;
  padding: 100px 0;
}

.t-orange-article{
   background-color: var(--white-color);
   color: #FF5F6D;
   height: 300px;
   width: 95%;
   margin: 0 auto;      
}

.t-orange-article > div {
  border-bottom: 3px solid black;
  max-width: 1000px;
  margin: 0 auto;
  padding: 100px 0;
}
.t-orange-aside{
    background-color: var(--white-color);
    color: var(--red-color);
    height: 200px;
        
}
.t-orange-footer{
    background-color: var(--red-color);
    color: var(--yellow-color);
    height: 50px;
}
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge"><link rel="stylesheet" href="style.css">
    <title></title>
</head>
<body>
    <div class="wrapper">
        <nav class="t-orange-nav">
          <div>
            nav
            
          </div>
        </nav>
        <header class="t-orange-header">
          <div>
            HEADER
         </div>

        </header>
        <section class="t-orange-section">
          <div>
            section
          </div>
        </section>
        <article class="t-orange-article">
          <div>  
          article
          </div>
        </article>
        <aside class="t-orange-aside">
            aside
        </aside>
        <footer class="t-orange-footer">
            footer
        </footer>
    </div>
</body>
</html>

Answer №1

If you want to incorporate a SVG image, you can do so by either copying the code provided below into your HTML document or saving it with a .svg extension and using it like any regular image.

<?xml version="1.0" encoding="utf-8"?>
<svg id="svg" version="1.1" style="display: block;" viewBox="0.148 0.121 399.909 187.745" xmlns="http://www.w3.org/2000/svg">
  <defs>
    <pattern id="pattern-0" x="0" y="0" width="25" height="25" patternUnits="userSpaceOnUse" viewBox="0 0 100 100">
      <rect x="0" y="0" width="50" height="100" style="fill: black;"/>
    </pattern>
    <linearGradient id="gradient-3" gradientUnits="userSpaceOnUse" x1="221.781" y1="-17.569" x2="221.781" y2="162.313" gradientTransform="matrix(-0.999997, 0.002512, -0.002478, -0.986265, 326.399578, 161.652725)" spreadMethod="pad">
      <stop offset="0" style="stop-color: rgb(254, 199, 131);"/>
      <stop offset="1" style="stop-color: rgb(253, 122, 126);"/>
    </linearGradient>
  </defs>
  <g id="svgg">
    <path id="path1" d="M 0.317 160.263 C 0.491 160.322 54.672 181.321 96.41 186.555 C 138.827 191.875 170.592 177.656 200.188 146.3 C 235.21 109.196 258.892 111.366 299.457 117.682 C 336.776 123.493 399.859 155.012 399.781 157.423 C 399.76 158.082 400 0 400 0 L 0 0" stroke="none" fill-rule="evenodd" style="fill: url(#gradient-3);"/>
  </g>
</svg>

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

Keep Variable-Height Element Corners Rounded to Perfection

I am facing a challenge with creating buttons that have perfectly rounded corners. The button is 50px high and the border radius is set to 25px, resulting in a perfect half-circle on each side of the button: It's pretty straightforward to achieve thi ...

What is preventing me from merging font sub properties?

When working with CSS, you have the option to combine sub-properties. For example, instead of defining a border like this: border-style: solid; border-width: 1px; border-color: #555; You can use a single declaration for the border property as a shorthand ...

"Setting an index to a button's ID using Jquery: A step-by-step guide

My goal is to assign incrementing index values to button IDs in a loop. For example, if the first button has an ID of 'unique', the second button should have an ID of 'unique0', and the third button should have an ID of 'unique1&ap ...

Exploring jQuery's class attribute: Uncovering the key-value pair trick

I am encountering difficulties in obtaining the class of my div elements, which are intended to function as tabs on a simple asp.net website. I aim to achieve this using jQuery for better control over dynamic functions in the future. However, every time I ...

CSS refusing to recognize the display initializr

I am facing a challenge in making the second paragraph visible in this sample code. So far, my attempts have been on Firefox. <!DOCTYPE html> <html> <head> <style> body { display: none; } .show { display: initial; } </ ...

Issues with the alignment of spans

What is the reason behind the *asdf being aligned to the bottom of its parent div in the following HTML code? <html> <style> .tag_editor { float: none; width: 400px; height: 33px; border-style: solid; border-color: #B2B2B2; border-width: thin; ...

The anchor tag seems to be malfunctioning within the div container

<style type="text/css> .xyz { position: absolute; top: 120px; left: 160px; z-index: -1; } #container { position: relative; overflow: visible; opacity: .3; } </style> <body> <div> <video i ...

How to align elements both in the center and off-centered within a Bootstrap 4 container

Using Bootstrap 4, I have a container-fluid where I placed a logo in the center. <div class="container-fluid d-flex justify-content-center align-items-center"> <img src="logo.png"> <div> Now, I want to add an additional element acting ...

CSS: Positioning footer at the bottom of ASP webpages (not fixed to the bottom of the screen)

After researching various methods for positioning footers in webpages using CSS, I have come across several solutions, including some on Stack Overflow. However, it seems that most of these approaches do not work with ASP pages. Therefore, my question is: ...

Target the first element within a tree structure using CSS

Trying to target the initial blockquote in an email body with varying formats, such as: <div class="myclass"> <br><p></p> <div><div> <!--sometimes with less or more div--> <blockquote&g ...

Vertical Centering Not Functioning Properly on IE and Firefox

I am currently working on setting up a temporary placeholder page for my website, but I've encountered some challenges with cross-browser compatibility. The page looks fine on Chrome and my iOS devices, such as my phone and iPad, but it doesn't d ...

Attempting to reach <p> from numerous web pages

Currently, I am working on a project where I need to extract text data from various websites. I have successfully managed to retrieve the text data using <p> tags. I would really appreciate any assistance with this task. Thank you! ...

How can you determine the status of the display element affected by .slideToggle()?

I have attempted to use is(':visible'), is(':hidden'), and css('display') but I am unable to retrieve the display status of an element after applying .slideToggle() What could I be overlooking? Here is the jsfiddle: http://j ...

Change button to an ajax spinner when it is clicked using jQuery

$(".post-btn").html("<img src='../images/loader.gif' />"); Why isn't this code working? I know I have the correct selector because when I tried $(".post-btn").text('test'), it worked. I want the text of the button to change ...

clipping of fixed navigation drop down menu

Looking for some help with creating a fixed responsive navigation menu? I've managed to make the top level menu responsive and fixed at the top, but as soon as I try to add dropdown sub-menus, it all falls apart. The issue arises when the sub-menus ar ...

Are CSS generated elements limited to text content only?

Can CSS generated content be used for more than just text? Take for example the code snippet below, where the span is displayed as text rather than creating a new span element. .addbefore:before { content: "<span>dfsd</span>"; } ...

Design a dynamic pagination button for my project that allows users to navigate between pages effortlessly

Can anyone assist me in creating next and previous buttons? I've been struggling with my JavaScript skills. I noticed that many people use jQuery or pure JavaScript for this. Since I'm still learning JavaScript, there are a lot of concepts I&apos ...

JavaScript: Update Div Background Automatically

My website has an advertisement section that works fine for most users. However, if a user has an ad-blocker enabled, the advertisement doesn't display and instead, an empty area appears on the site. To address this issue, I plan to add a background ...

Modify the color or background color of a disabled Material UI checkbox

The disabled unchecked checkbox appears too subtle to me, and I would like to enhance it by giving it a grey background and changing the cursor style to not-allowed. I've been trying to implement these styles on the checkbox using the makeStyles, but ...

Creating a dynamic background image with automatic cropping techniques: How to do it?

I'm currently working on a custom wordpress theme and I've encountered an issue that I need help with. I want to have a wide background image on my homepage with text centered on it, but I also want the height to remain the same as the browser w ...