What is the best way to create a circular div that complements a circular navbar design?

Is there a way to make the red div align perfectly with the corners and height of the navbar? I have been experimenting with Bootstrap components and trying to customize them according to my needs. If using a button instead of a div is an option, that would work too, as long as it fits within the navbar dimensions.

Here is my current progress https://i.sstatic.net/lmqBp.png

This is the desired outcome https://i.sstatic.net/s8HEc.png

Below is a snippet of my code:

.container {
                            min-height: 100vh;
                            padding: 2rem 1rem;
                        }
                        
                        .navbar {
                            z-index: -1;
                            width: 70%;
                            margin: 0 auto;
                            border-radius: 20rem;
                        }
                       
                        .nav-item {
                            padding: 0;
                        }
                        
                        .book-now {
                            overflow: visible;
                            z-index: 100;
                            background-color: rgba(255, 48, 48, 1);
                            height: match-parent;
                        }
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet"/>
<header class="container">
        <nav class="navbar bg-dark navbar-expand-lg navbar-dark">
            <a class="navbar-brand" href="">MOTRAVELS</a>
            <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
          <span class="navbar-toggler-icon"></span>
        </button>
            <div class="collapse navbar-collapse" id="navbarSupportedContent">
                <ul class="navbar-nav ml-auto">
                    <li class="nav-item">
                        <a class="nav-link" href="">CITIES</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="">PLACES</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="">EVENTS</a>
                    </li>

                    <div id="book-now">
                        <a class="nav-link" href="">BOOK NOW</a>

                    </div>


                </ul>
                </div>
        </nav>
    </header>

Answer №1

Is it possible to create something like this?

.container {
  min-height: 100vh;
  padding: 2rem 1rem;
}

.navbar {
  z-index: -1;
  width: 70%;
  margin: 0 auto;
  border-radius: 20rem;
}

.nav-item {
  padding: 0;
}

.nav-item:last-child {
  background-color: rgba(255, 48, 48, 1);
  height: match-parent;
  border-radius: 0rem 25rem 25rem 0rem;
  margin-right: -0.5rem;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet"/>
<header class="container">
  <nav class="navbar bg-dark navbar-expand-lg navbar-dark">
    <a class="navbar-brand" href="">MOTRAVELS</a>
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    </button>
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto">
        <li class="nav-item">
          <a class="nav-link" href="">CITIES</a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="">PLACES</a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="">EVENTS</a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="">BOOK NOW</a>
        </li>
      </ul>
      </div>
  </nav>
</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

Transfer the document to the server using ajax

I've been attempting to upload an image to the server using the following simple code: <form enctype="multipart/form-data"> <input name="file" type="file" /> <input type="button" value="Upload" /> </form> <progress ...

Utilizing Django for tables with over two items in a template

I've been on the lookout for a solution to create a Django template that can display more than just 2 values per row in a table. Imagine having a class with 5 attributes, and wanting these attribute values showcased in a table on your HTML page. Init ...

Modify border color of vuetify v-card upon clicking a button

How can I update the border color of the v-card element from vuetify when the user clicks the showError button associated with the limited-products id? I want the border color to change to red. Additionally, when the user clicks the removeError button, I ...

Organize columns on mobile devices using Materialize

I'm currently working with the materialize framework and am attempting to change the order of columns on mobile view. Specifically, I want the BUY BUTTON to appear before the CONTENT section on phones. I've been experimenting with pull and push b ...

An error occurs when attempting to assign a value to a MUI file TextField

Struggling with setting the value of a MUI Textfield that has type="file" props, resulting in the following exception being thrown: Uncaught DOMException: An attempt was made to use an object that is not, or is no longer, usable Interest ...

Switching Angular Buttons

I am developing an Angular application with a Bootstrap theme that includes 2 radio buttons, each triggering a separate page. It is important that only one radio button can be selected at a time. I want the class values to be btn btn-primary active for the ...

Conceal a different div unless it includes

Hi everyone, I need help with a filter code snippet: $(".title").not(":contains('" + $("[name=filter]").val() + "')").hide() The issue I'm facing is that the .title class is nested within the .sortAll class along with many other divs. I w ...

Tips for accessing the HTML code of a TextBox in JavaScript while utilizing HTMLEditorExtender

Currently, I am utilizing the HTMLEditorExtender ajax tool on my website. The data is being saved in HTML format into the database and then retrieved within my project without any issues. However, there is a setback that I have encountered... When attemp ...

Is this loader going through a triple loop?

<style> .loader { position: fixed; left: 0px; top: 0px; width: 100%; height: 100%; z-index: 9999; background-repeat: no-repeat; background: url('images/page-loader.gif'); } </style> <script src="//ajax.googleapis.com/ajax/libs/jque ...

Toggle between pausing and running CSS animations with this handy button!

My awesome graphic animation is in CSS and SVG format. I've been struggling to add a play/pause button to control the animation on click. Here is what I have so far: .animation1 { --animation-delay: 0.1s; animation: ani_keyframes 1 ...

How can the color of unselected mat-steps be customized in Angular?

In my CSS code, I have specified the styling for the selected mat-step as follows: ::ng-deep .mat-step-header .mat-step-icon-selected { background-color: #a94442; } While this code works well, I encountered a need to update only certain blue icons: ...

Opinions on crafting a new gadget?

I will only provide each website interested in my widget with the code to copy and paste once. It is crucial that the code is future-proof. After much consideration, this is the widget code I have developed: <script type="text/javascript" src="http:/ ...

What is the method to adjust line spacing of hyperlinks in JavaFX?

I am setting up a vbox and inserting hyperlinks into it. Hyperlink clickableString; clickableString = new Hyperlink(); clickableString.setStyle("-fx-text-fill: black;-fx-padding: 0; -fx-line-spacing: 0em;"); //setting the hyperlink color to black. clicka ...

The Font Awesome icons are not appearing on the cypress runner container

Currently, I am diving into the world of Cypress by working on my own React todo app. During integration testing, I encountered an issue where my UI icons (sourced from Font Awesome via CDN) were not displaying. As a result, the delete button for my todos ...

Having trouble accessing the menu in the dropdown div when clicking back?

I am working on creating a menu that drops down from the top of the page using JQuery. I have everything set up with the code below: <div id="menu"> <div id="menucontentwrapper"> <div id="menucontent"></div> </di ...

Avoiding the overflow of the y-axis by applying a slight left margin to bootstrap columns

Context: I'm in the process of developing a collapsible sidebar navigation menu inspired by the bootstrap admin panel example found at: Issue: Upon collapsing the admin bar, a small bar of icons appears. To accommodate this, I added margin-left: 50 ...

Troubleshooting flow problems in flexbox container for

https://i.stack.imgur.com/ZpVaH.png I have implemented a flexbox-based page layout. The layout consists of two sidebars on the left and right sides, with fixed widths, and a central content panel that dynamically adjusts to fill the remaining space. Howe ...

Utilize CSS to selectively target specific sections of a repetitive pattern within a list

I have come across a list fragment that is generated automatically and I only have the ability to adjust the CSS for it. <ul class="menu"> <li class=" menuItem1 first parent"></li> <li class=" menuItem2 parent"></li> ...

Select a dropdown menu option in Cypress by clicking on it only if it is checked

In this html code snippet, I have multiple elements within a dropdown menu. I am looking for a way to click on an item only if it is selected (has the class selected) or has a check mark in front of the name, as shown in this screenshot. How can I achieve ...

Can the navigation bar be filled automatically with content that corresponds to the anchors found within the content?

Currently, I am utilizing a Bootstrap frontend for the project at hand. The task I am tackling involves a significant amount of automatically generated content and code, which greatly simplifies the work process. My goal is to explore the potential of cre ...