I am looking to create a header design that is fully responsive and resembles the example shown in the image. How can I achieve

Currently, I am working on creating a responsive header for a website. The image provided is a rough draft of the header design that I am aiming to achieve. I attempted to form the shape using an SVG path but encountered difficulties in making it fully responsive. Thus, I am seeking advice on alternative methods.

Here's what I have experimented with: *check out the images below to see the outcome

body {
  background-color: rgb(255, 255, 255);
  overflow-x: hidden;
}

#topLine {
  position: absolute;
  left: 50%;
  transform: translate(-50%);
  height: 2vh;
  width: 110vw;
  background: linear-gradient(178.8deg, rgb(255, 95, 30) 0%, rgb(255, 95, 30) 60%, rgb(185, 15, 0) 100%);
}

#topLineLogo {
  position: absolute;
  left: 0%;
  height: 8vh;
  width: 40vw;
  background: linear-gradient(179.6deg, rgb(255, 95, 30) 0%, rgb(255, 95, 30) 40%, rgb(185, 15, 0) 100%);
  border-bottom-right-radius: 50%;
  z-index: -1;
}

#topLineLogoFill {
  position: absolute;
  left: 0%;
  transform: translate(10%, 0%) rotate(-3deg);
  width: 50vw;
  height: 5vh;
  background: rgb(255, 95, 30);
  z-index: -2;
}

svg polyline,
svg line,
svg path {
  fill: rgb(255, 255, 255);
  stroke: rgb(225, 95, 10);
}
<div id="topLine"></div>
<div id="topLineLogo"></div>
<div id="topLineLogoFill"></div>
<svg height="15vh" width="90vw" viewBox="0 0 1000 100">
     <path d="M363,44.2 Q363,3.6 700,8.6" />
</svg>
A rough mockup of the desired result

The result of my attempts

Outcome after resizing the header

Answer №1

If you want to achieve a similar effect, you have the option of customizing the curve by adjusting the values in the .background__white class, specifically the properties of border-radius and/or height.

.container {
  width: 100%;
  height: 50px;
}
.background__orange {
    width: 100%;
    height: 50px;
    background-color: orange;
}
.background__white {
  background-color: white;
  border-radius: 2000px;
  height: 100px;
  width: 100%;
  position: absolute;
  left: 40%;
  top: 25px;
}
<div class="container">
  <div class="background__orange">
  </div>
  <div class="background__white">
  </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

Steps for selecting a checkbox via a link or button

Looking to revamp my quote builder by replacing small checkboxes with stylish 'SELECT' buttons that can automatically check the corresponding checkbox. I also want to apply a specific class to the parent div when the checkbox is checked, allowin ...

Swapping out a Django template variable for a variable generated using JavaScript

I'm new to Django and Javascript (less than 3 weeks!) and I have a query that may seem naive, so any assistance would be appreciated. In my current code, I have an HTML table rendered with the following snippet: <table border="1" class="dataframe ...

Ways to ensure your page stays confidential

Concept: Exploring the idea of making specific pages on a website private. For example, having 4 navigation links where one link leads to a private page that requires a username and password for access. Currently, my practice website has 7 links directing ...

In PHP, the counter will reset to zero after reaching 4 items and start a new div for the

I need assistance with my code. What I am trying to achieve is to insert a div after every 4th, 5th, or 6th item, regardless of the number of items. However, when I tried using a break statement to stop the counter and start a new one, it did not work. The ...

Function call fails when parameters are passed

I've been grappling with this conundrum for a few weeks now, on and off. Perhaps someone else will spot the glaringly obvious thing that I seem to be overlooking. At the present moment, my primary goal is to simply confirm that the function is operat ...

Tips for capitalizing the first letter of a directory

I want to automatically convert all directories in the URI to lowercase if the user types them in uppercase. For example, https://example.com/hOmE should be converted to https://example.com/home. ...

Using jQuery, extract the input value and verify its accuracy. If correct, display the number of accurately predicted results

I am attempting to extract the value from an input field and validate if the answer is accurate. Rather than simply indicating correctness, I aim to analyze and display the number of correct responses alongside incorrect ones. Encountering difficulties wit ...

"Utilize Django to store and edit the values inputted in

Using MySQL as my database, I have implemented a rich text editor with Bootstrap. I am looking for a solution to store the content and uploaded images from the text editor, but so far I haven't found one. Here is a snippet of my template: {% extends ...

Different sized image grid display

Could you please take a look at this screenshot: I am facing an issue with the grid layout. The first image in the grid is too short, which results in a big gap between the upper left and lower left pictures. Here is what it looks like currently: Is ther ...

Struggling to perfectly align a Wufoo form within an iframe using CSS

I have integrated a web form from Wufoo into my webpage using an iframe. Custom CSS can be used to style the form and I am trying to center it within the iframe. Below is the HTML code of the form displayed in the iframe: <div id="container" class="lt ...

Trouble with jQuery: Background color fade in/fade out effects not functioning

Issue with changing background color during FadeIn and FadeOut effect. Whenever I click on the "whatup" link, my button should blink with alternating red and white colors. Below is the HTML code: <a id="blkwhatsup" href="#" >whatup</a> <in ...

What sets PHP fsockopen apart from WebSockets in HTML5?

Are there differences between server-side and client-side processing? Is it possible to send instant messages using PHP's fsockopen, or am I restricted to using JavaScript for polling on the client side? ...

Create circular Styled components in React JS

Currently, I am attempting to create a component within a wrapped styled component. The Styled component has a circular shape, and I am seeking assistance in styling it accordingly. Can anyone provide guidance on how to apply the styles needed to achieve a ...

Angular 2: Issue with disabled functionality not functioning correctly

In my TypeScript code, I have created a boolean variable called readOnlyMode. When this variable is set to true, all elements should be disabled. To achieve this, I am using [disabled]="readOnlyMode" in the HTML for elements that need to be disabled. Howev ...

The background image shifts dynamically with a parallax effect as the page is scrolled

I need help solving a parallax issue that I'm currently facing. On my webpage, I have a background image positioned at the top with a parallax effect achieved through background-position: fixed. However, I now require the image to scroll along with t ...

Javascript - Conceal a Dynamic Div Depending on its Text

I have a unique table that generates dynamic Divs with ID's that count as they are created in the following format: <div id="dgpCheckDiv10_0"> <input Delete </div> <div id="dgpCheckDiv10_1"> text2 </div> Some of t ...

The Spring Boot application is having trouble retrieving static files

I started a fresh springboot project and organized the directory structure as follows: view image description here The yml configuration is outlined below: server: port: 8783 servlet: context-path: /spring-demo spring: scan : com.example appli ...

What is the process of adding background color to text?

Is there a more efficient way to style this text without relying on the span tag? I am looking to add a background color to my text. Code: .subject { color: gold; background: gray; } <h2>Some Subjects</h2> <ol> <li style="bac ...

There was an issue with the Google Maps embed API that resulted in an error with interpolation

My goal is to utilize the Google Maps API in order to showcase a map using data from a JSON file. However, whenever I attempt to incorporate the JSON data, an error message 'Error: [$interpolate:noconcat] Error while interpolating' pops up. < ...

Updating CSS for dropdown menu in Fluent/Fabric design

I am working with a dropdown component from Fluent UI and I am trying to customize the CSS of the dropdown options. Although I can add classes using className to the dropdown itself, I am facing difficulty in styling the dropdown options directly due to th ...