Is a header that curves in a linear fashion towards the bottom?

Apologies for asking a question similar to one on SO: Can I create a div with a curved bottom?

The solution provided there does not meet my specific customization requirements for the header. Instead, I am looking to achieve something different from what I have already accomplished using the border properties here and here.

In the images, you can see that the header design I aim for has a linear curve throughout the bottom, whereas my current implementation results in a more curved border at the edges with the curve not being consistent along the entire bottom. Increasing the percentage only exaggerates the curvature at the edges.

Is there an alternative method to achieve a consistent linear curve throughout the bottom of the header?

Here is my existing code snippet:

header{     
        background-color: #000;
        border-bottom-left-radius:25%;
        border-bottom-right-radius:25%;
        padding: 10px;
        opacity: 0.35;
        position: fixed;
        width: 100%;
        z-index: 1000;
}

Link to JSfiddle with the CSS code:

https://jsfiddle.net/ozqneuha/

@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,600,700);

/* --Global CSS-- */

.header-container {
  margin: 0 auto;
  width: 1170px;
}
ul {
  padding: 0;
  margin: 0;
}
/* Header CSS*/

header {
  background-color: #000;
  border-bottom-left-radius: 25%;
  border-bottom-right-radius: 25%;
  padding: 10px;
  opacity: 0.35;
  position: fixed;
  width: 100%;
  z-index: 1000;
}
header nav ul {
  list-style-type: none;
}
header .logo {
  display: inline-block;
}
header .header-nav {
  display: inline-block;
  float: right;
  padding: 7px;
}
header li {
  float: left;
  margin-left: 20px;
}
header li a {
  color: #fff;
  font: 600 16px'Open Sans';
  text-transform: uppercase;
  text-decoration: none;
}
header li a:hover,
header li a:active {
  color: #e51937;
  text-decoration: none;
}
<header>
  <div class="header-container">
    <div class="logo">
      <a href="#">
        <img src="http://i.imgur.com/2JbjOqY.png" alt="logo">
      </a>
    </div>

    <div class="header-nav">
      <nav>
        <ul>
          <li><a href="#">Search</a>
          </li>
          <li><a href="#">Map</a>
          </li>
          <li><a href="#">Properties</a>
          </li>
          <li><a href="#">Parking</a>
          </li>
          <li><a href="#">Residents</a>
          </li>
          <li><a href="#">Pay Online</a>
          </li>
        </ul>
      </nav>
    </div>
    <!-- /.header-nav -->
  </div>
  <!-- /.header-container -->
</header>

Answer №1

If you're looking to add a unique touch to your website's header, consider experimenting with the clip-path property. Just be sure to verify browser compatibility before implementation.

Check out the CSS clip-path property support

To achieve this effect, you can use an ellipse shape to clip the header div in a visually appealing way.

@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,600,700);

body {
  margin: 0;  
}

/* --Global Styling-- */
.header-container{
  margin: 0 auto;
  width: 1170px;
  text-align: right;
}

ul{
  padding: 0;
  margin:0;
}

/* Header Styling */

header{
  background-color: #000;
  /*
  border-bottom-left-radius:25%;
  border-bottom-right-radius:25%;
  */
  padding: 10px;
  opacity: 0.35;
  position: fixed;
  width: 100%;
  z-index: 1000;
  min-height: 50px;
  -webkit-clip-path: ellipse(60% 100% at 50% 0%);
  clip-path: ellipse(60% 100% at 50% 0%);

}

header nav ul{
  list-style-type: none;
}

header .logo {
  display: inline-block;
  float: left;
}

header .header-nav{
  display: inline-block;
  /*float: right;*/
  padding: 7px;
}

header li{
  float: left;
  margin-left: 20px;
}

header li a{
  color: #fff;
  font: 600 16px 'Open Sans';
  text-transform: uppercase;
  text-decoration: none;
}

header li a:hover,
header li a:active{
  color: #e51937;
  text-decoration: none;
}

@media screen and (max-width: 1169px) {
  .header-container {
    width: 840px;    
  }
  header .header-nav{
    display: inline-block;
  }
}

@media screen and (max-width: 996px) {
  .header-container {
    width: 100%;    
  }
  header .logo {
    float: none;
    display: block;
    text-align: center;
  }
  header .header-nav{
    display: none;
  }
}
<header>
  <div class="header-container">            
    <div class="logo">
      <a href="#">
        <img src="http://i.imgur.com/2JbjOqY.png" alt="logo" />
      </a>
    </div>

    <div class="header-nav">
      <nav>
        <ul>
          <li><a href="#">Search</a></li>
          <li><a href="#">Map</a></li>
          <li><a href="#">Properties</a></li>
          <li><a href="#">Parking</a></li>
          <li><a href="#">Residents</a></li>
          <li><a href="#">Pay Online</a></li>
        </ul>
      </nav>
    </div><!-- /.header-nav -->
  </div><!-- /.header-container -->
</header>

Answer №2

Have you considered trying this method?

@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,600,700);

/* --Global CSS-- */

.header-container {
  margin: 0 auto;
  width: 1170px;
}
ul {
  padding: 0;
  margin: 0;
}
/* Header CSS*/

header {
  background-color: #000;
  border-bottom-left-radius: 50%;
  border-bottom-right-radius: 50%;
  padding: 10px 10px 35px;
  opacity: 0.35;
  position: fixed;
  width: 100%;
  z-index: 1000;
}
header nav ul {
  list-style-type: none;
}
header .logo {
  display: inline-block;
}
header .header-nav {
  display: inline-block;
  float: right;
  padding: 7px;
}
header li {
  float: left;
  margin-left: 20px;
}
header li a {
  color: #fff;
  font: 600 16px'Open Sans';
  text-transform: uppercase;
  text-decoration: none;
}
header li a:hover,
header li a:active {
  color: #e51937;
  text-decoration: none;
}
<header>
  <div class="header-container">
    <div class="logo">
      <a href="#">
        <img src="http://i.imgur.com/2JbjOqY.png" alt="logo">
      </a>
    </div>

    <div class="header-nav">
      <nav>
        <ul>
          <li><a href="#">Search</a>
          </li>
          <li><a href="#">Map</a>
          </li>
          <li><a href="#">Properties</a>
          </li>
          <li><a href="#">Parking</a>
          </li>
          <li><a href="#">Residents</a>
          </li>
          <li><a href="#">Pay Online</a>
          </li>
        </ul>
      </nav>
    </div>
    <!-- /.header-nav -->
  </div>
  <!-- /.header-container -->
</header>

Answer №3

Here's the method I used:

.overlay {
    position: absolute;
    z-index: -1;
    height: 100%;
    border-radius: 50%;
    width: 150%;
    left: -25%;
    top: -60%;
    background: rgba(121, 121, 121, 0.8);
    pointer-events:none;
}

Check out the JSFiddle demonstration

Feel free to customize the width, left, and top percentages according to your preferences :)

Answer №4

After much deliberation, I have finally cracked the solution to this problem. My approach involved using the pseudo-class :before.

/* --Custom CSS-- */
.header-container {
  display: grid;
  margin: 0 auto;
  width: 1170px;
  height: 100%;
}
ul {
  padding: 0;
  margin: 0;
}
/* Styling for header */

header {
  padding: 10px;
  position: fixed;
  width: 100%;
  z-index: 1000;
}
header:before {
  background-color: rgba(0, 0, 0, 0.35);
  width: 150%;
  content: '';
  height: 150px;
  border-bottom-left-radius: 50%;
  border-bottom-right-radius: 50%;
  top: -76px;
  position: absolute;
  z-index: -1;
  margin-left: -25%;
}
header ul {
  list-style-type: none;
}
header .logo {
  display: inline-block;
  vertical-align: middle;
}
header .header-nav {
  display: inline-block;
  float: right;
  padding: 7px;
  vertical-align: middle;
}
header li {
  display: inline-block;
}
header li a {
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  font-family: 'Open Sans';
  padding: 0 15px;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.3s;
}
header li a:hover,
header li a:active {
  color: #e51937;
  text-decoration: none;
}
<header>
  <div class="header-container">
    <div class="logo">
      <a href="#">
        <img src="http://i.imgur.com/2JbjOqY.png" alt="logo">
      </a>
    </div>

    <div class="header-nav">
      <nav>
        <ul>
          <li><a href="#">Search</a></li>
          <li><a href="#">Map</a></li>
          <li><a href="#">Properties</a></li>
          <li><a href="#">Parking</a></li>
          <li><a href="#">Residents</a></li>
          <li><a href="#">Pay Online</a></li>
        </ul>
      </nav>
    </div>
    <!-- /.header-nav -->
  </div>
  <!-- /.header-container -->
</header>

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

Unable to find the XPATH element with Selenium in Python due to element not being located

Can anyone help me troubleshoot? My XPATH seems correct, but it's showing 'no element found' error. I also attempted using find_elements(By.XPATH, "/html/body/div[3]/div[3]/div[5]/div[1]/table[*]/tbody/tr[*]/td[1]/a") import time from selen ...

Displaying a specific fieldset based on the radio button selection

I have created a form to handle user input using PHP, with the initial question prompting the user to choose from three radio buttons for the "type" parameter - the options being "book", "journal", and "website". Here is what the code looks like: <stro ...

The horizontal display of images is currently experiencing issues

I am having trouble displaying images horizontally in a row. I am aiming to show 8 images next to each other, but my current grid system setup is not achieving this. The images are currently stacked on top of each other, but I want them to be aligned horiz ...

What could be causing the remove attribute API to not function properly only for the "is" attribute?

var divElement = document.createElement("div"); var innerHTMLText = "<div id='issue' is='if'> some content </div>"; divElement.innerHTML = innerHTMLText; document.body.appendChild(divElement); var newDivElement = document.qu ...

Enhancing BarGraph and Bars Size in Oracle ADF

We have created a web application using Oracle ADF. The application includes a page with a graph displayed below. Currently, we are looking to enlarge the bar graph by increasing its height, width, and size of the bars themselves. Difficulty 1: While we ...

Having trouble with the overflow hidden feature in my Firefox browser

My Firefox browser is having issues with the overflow hidden property, whereas all other browsers are working fine. select { overflow: hidden; } <select multiple="" size="20"> <option value="1">1</option> <option value="2"> ...

How can CSS be used to create columns with text of different sizes?

Attempting to construct a text-based webpage entirely with HTML and CSS, the objective is to divide the page into two columns. The first column should occupy 2/3 of the width to accommodate the primary text, while the second column should take up the remai ...

Tips on changing the background image when hovering over a list item and a link with CSS

I have been attempting to adjust an image that is nested within a link which is nested inside a list. My initial idea was to use the image as a background picture. The issue arises when I try to position the background picture correctly with respect to th ...

Tips for displaying JSON arrays in HTML

I have been using ECWID for my website's store and I am interested in creating some code that involves JSON requests. Although I haven't had experience working with JSON before, I attempted to make a request by typing the following in my address ...

Is it possible to customize the font color of a placeholder in a v-text-field component in Vue?

Recently, I added the following code snippet to my project: <v-text-field hide-details class="search-field" id="name-input" placeholder="Search by name" v-model="search"></v-text-field> I wanted to change the font color of the placeholder tex ...

Adjust vertical dimension using rich text editor tag

I am currently using JSF with RichFaces version v.3.3.1.GA. I am trying to decrease the height style of the rich:editor tag (using TinyMCE), but for some reason it does not seem to be changing. <rich:editor id="transactionResult" style="height: 10px;" ...

What is the reason why the VIEW SOURCE feature does not display filled dropdown list boxes?

The following code functions well in terms of dynamically populating two dropdown list boxes. Initially, the getBuildings function is called to make a request to the getBuildings.php file. This action fills the buildingID dropdown list box with options. ...

Utilizing Bootstrap Classes in ReactJS: A Comprehensive Guide

Is it possible to incorporate Bootstrap classes in a React application without actually installing the framework? If so, how can this be achieved and utilized effectively? I would greatly appreciate your assistance with this matter. ...

What is the best way to ensure that the text input spans the entire width of the div in Bootstrap 4?

I am currently exploring the implementation of Bootstrap 4. I have a basic div that includes a text box, and my goal is for the text box to occupy the full width of the div. Initially, I assumed that in Bootstrap, input elements automatically inherit the f ...

Utilize the input field value in an HTML dialog box to assign it to a variable in the code.gs file with the help

I'm trying to create a dialog box where the user can select a year, and then have the server process the selected value using the function doSomethingWithCompetitionYear(theYear). I've researched several discussions, but I'm having trouble ...

OptinMonster's innovative feature - the Pardot form with an inline button

Having trouble integrating an HTML Pardot form into OptinMonster's floating footer option. I'm looking to align all three fields inline, along with the button. Can anyone assist me in placing the button inline with the fields? HTML: <fo ...

What is the best way to incorporate server-side rendered content from a CMS to hydrate Vue.js?

Consider this scenario: content is managed through a traditional CMS such as Joomla or Drupal content is provided by the CMS as fully rendered HTML and CSS In the Frontend React.js should be utilized for all UI interactions. Despite going over most of R ...

What is the best way to align a label, input box, and a small search image on the same line

I'm currently working on developing a mobile page using jQuery Mobile version 1.4.4. I've managed to get the label and input box to display correctly in one line, but I'm encountering an issue with the small search image appearing on the nex ...

Incorporating dynamic content changes for enhanced user experience can be achieved more effectively with AngularJS

I am utilizing a REST service to retrieve information for a banner. The goal is to dynamically update the slider on the main page using this data. Currently, I am using $http.get to fetch the data, and then implementing interpolation with additional ng-if ...

Adding animation effects using CSS and/or jQuery

Are there any Jquery plugins or CSS codes available to achieve similar effects as seen on the following pages and , without utilizing webGL?... ...