Improving the adaptive design of a breadcrumb navigation trail

.breadcrumb input[type="radio"] {
  display: none;
}

.breadcrumb input[type="checkbox"] {
  display: none;
}

.question-header input[type="radio"] {
  display: none;
}

.panel-body input[type="radio"]~label {
  cursor: pointer;
  width: 100%;
  text-align: center;
  padding: 10px 15px;
  margin: 0;
}

.panel-body input[type="radio"]:checked~label {
  background: #6FA8DC;
  color: white;
}

.breadcrumb {
  background: black;
  display: inline-block;
  padding: 1px;
  padding-right: 18px;
}

.breadcrumb a {
  display: inline-block;
  background: white;
  padding: 5px 30px 5px 30px;
  position: relative;
  text-decoration: none;
  -webkit-clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 50%, calc(100% - 15px) 100%, 0 100%, 15px 50%);
  clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 50%, calc(100% - 15px) 100%, 0 100%, 15px 50%);
  margin-right: -17px;
}

.breadcrumb a#last {
  -webkit-clip-path: polygon(0 0, calc(100% - 0px) 0, 100% 50%, calc(100% - 0px) 100%, 0 100%, 15px 50%);
  clip-path: polygon(0 0, calc(100% - 0px) 0, 100% 50%, calc(100% - 0px) 100%, 0 100%, 15px 50%);
}

.breadcrumb a:hover {
  color: white;
  background: #369F00;
}


/* first link should not have anything clipped on the left side */

.breadcrumb a:first-child {
  -webkit-clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 50%, calc(100% - 15px) 100%, 0 100%);
  clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 50%, calc(100% - 15px) 100%, 0 100%);
  padding-left: 20px;
}

.label {
  height: 100%;
  width: 100%;
}
<div class="breadcrumb">


  <a href="#" data-toggle="modal" data-target="#inviteModal" id="invite-breadcrumb">
    First
  </a>

  <a href="#" data-bind="css:{selected:applicationsFilter() === 'new'}">
    <label class="radio-inline" data-bind="css:{selected:applicationsFilter() === 'new'}">
      <input type="radio" value="new" data-bind="checked: applicationsFilter, css:{selected:applicationsFilter() === 'new'}" class="radcss" name="app" id="newapp">
      Second
    </label>
  </a>

  <a href="#" data-bind="css:{selected:applicationsFilter() === 'shortlisted'}">
    <label class="radio-inline" data-bind="css:{selected:applicationsFilter() === 'shortlisted'}">
      <input type="radio" value="shortlisted" data-bind="checked: applicationsFilter, css:{selected:applicationsFilter() === 'shortlisted'}" class="radcss" name="app" id="shortapp">
      Third
    </label>
  </a>

  <a href="#" data-bind="css:{selected:applicationsFilter() === 'connected'}" id="last">
    <label class="radio-inline" data-bind="css:{selected:applicationsFilter() === 'connected'}">
      <input type="radio" value="connected" data-bind="checked: applicationsFilter, css:{selected:applicationsFilter() === 'connected'}" class="radcss" name="app" id="connapp">
      Fourth
    </label>
  </a>

</div>

When the window size is large enough it looks good like in the following image:

https://i.sstatic.net/wSsM9.png

However, when I reduce the window size, it becomes unattractive. I need assistance to make it responsive and organized. Additionally, I would like to eliminate the black background that appears when shrinking the window.

https://i.sstatic.net/t20Fn.png

Answer №1

Utilize @media (max-width: 408px) { .class{ }} for an optimized experience, and I have made updates to your fiddle check the updated fiddle

Consider implementing webkit filter in the .breadcrumb section

@media (max-width: 408px) { 
     .breadcrumb {
            background: none;
             -webkit-filter: drop-shadow(1px 1px 0px black)
        drop-shadow(1px -1px 0px black)
        drop-shadow(-1px 1px 0px black)
        drop-shadow(-1px -1px 0px black);
      filter: drop-shadow(1px 1px 0px black)
        drop-shadow(1px -1px 0px black)
        drop-shadow(-1px 1px 0px black)
        drop-shadow(-1px -1px 0px black);
            }
}

    .breadcrumb input[type="radio"] {
        display: none;
    }

    .breadcrumb input[type="checkbox"] {
        display: none;
    }

    .question-header input[type="radio"] {
        display: none;
    }

    ... [trimmed content for brevity] ...

    }
<div class="breadcrumb">

  ... [trimmed content for brevity] ...

</div>

Answer №2

Building on Udhay's response, here are 2 links that may provide additional assistance. For a multi-step design

View the DEMO

Try resizing the page to see how each link functions. I hope this proves helpful for your future endeavors.

Before

https://i.sstatic.net/cGaNh.png

After

https://i.sstatic.net/Mo3Qk.png

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

Modifying the appearance of a CSS element with jQuery: Step-by-step guide

The code I have is as follows: $('.signup-form-wrapper').css("style", "display: block"); $('.login-form-wrapper').css("style", "display: none"); I'm not sure why it's not working. The current appearance of ...

What is the best way to retrieve JSON data after a jQuery POST request?

After using jquery.post, I'm attempting to retrieve the returned data in JSON format, but... <script> function sendToJsonTitleConverter() { $.post("/engine/title-converter", { NewTitle: $("#NewTitle").val ...

What is the best way to attach several URLs to a single component?

I am currently using Next.js Here is the structure I have: https://i.stack.imgur.com/jRQBS.png I am in need of opening the same component for multiple URLs, such as 'http://localhost:3000/hakkimizda', 'http://localhost:3000/cerez-politika ...

Replace the element's style using a JavaScript object

While there are numerous versions of this query, the existing answers fail to provide in-depth analysis. Query: How does this result in a height of 200 pixels? Consider the following code snippet: var el = document.querySelector('#r'); cons ...

Unable to adjust the padding of the material UI Select component

I'm having trouble adjusting the padding of the Select component in order to align it with the size of my other text fields. Despite knowing that I need to make changes to nested components, I have yet to discover a viable solution. <div className ...

Customize your cube with unique ThreeJs text on every face!

I am currently experimenting with Three.js to create a rotating cube with unique text on each face. I have managed to use DynamicTexture to assign text to the faces of the cube, but it is displaying the same text on all sides. Is there a way to display dif ...

Utilizing the ng-if directive to choose the second element within an iteration of an ng-repeat loop

I am currently working on a project where I need to organize and group content by day. While the grouping function is working fine, I am facing an issue with treating the first two items in the loop differently from the rest. I have experimented with using ...

React Hook Form: When Submitting, Transform Date Object into String Date within an Array

Below is the data I am working with: { status: "Reserved", label: "Note", title: "Login Fragment - Navigation component With Coroutine", shareWith: "", notification_method: "Every Morning", notification_method_specific_time: Sat ...

Navigating to a different URL in a remoteMethod with Loopback and Express

Can anyone provide any guidance on how to redirect to a URL within a model function or remoteMethod? I've been struggling to find documentation on this. Here is the code snippet for reference: Model Function (Exposes /catch endpoint) Form.catch = func ...

Prevent automatic image blurring within an SVGZ file

Utilizing SVGZ images on my HTML pages for their ability to be resized. These SVGZ images consist of enlarged PNGs that have been altered in specific ways that I desire to maintain, pixelation and all. Firefox is rendering them correctly (as designed in In ...

Creating an asynchronous endpoint in Express

Looking for some assistance in setting up a basic endpoint using Express to practice async/await functionality. Here's the code snippet I'm working with: app.post('/products', async (req, res) => { try { console.log ...

http-proxy-middleware - serving static content

I am currently working on integrating my static landing page with an express.js app (using react.js for the single page application). For my landing page, I have set up a proxy using http-proxy-middleware. Here is what my server.js file for the static pag ...

Transforming a string into an array containing objects

Can you help me understand how to transform a string into an array of objects? let str = `<%-found%>`; let result = []; JSON.parse(`["${str}"]`.replace(/},{/g, `}","{`)).forEach((e) => ...

Retrieve information using PHP with AJAX without revealing it on the screen

Is it feasible to fetch data using Ajax in PHP and store them in a JS variable without displaying it? I require this data for date manipulation but do not want to show it. When I attempted to merely return the data without echoing it, the Ajax data in JS ...

Utilize buttons to sort through and refine card displays in Bootstrap 4

On my landing page, I have 40 cards belonging to different categories or groups. There are a total of 5 categories. I am looking to add 5 buttons that, when clicked, will display only the cards from specific category or categories. I do not want to use a s ...

"Is there a way to retrieve the CSS of all elements on a webpage by providing a URL using

Currently, I am in the process of creating a script that can crawl through all links provided with a site's URL and verify if the font used on each page is helvetica. Below is the code snippet I have put together (partially obtained online). var requ ...

Printing style in CSS

Everything looks good on my webpage. For printing, my CSS adjusts the layout and section sizes. Unfortunately, there is an issue with the print layout - there is a one-inch margin on the left side causing two elements to go off the page on the right. I ...

What is the best way to retrieve the most recent CMS posts information within a Gatsby-constructed project?

I created a static website using Gatsby and everything was working well. However, I encountered an issue when updating the titles and content of posts in Contentful CMS - the changes were not reflected when I refreshed the website. How can I ensure that ...

Leveraging react-query with next-mdx-remote MDX Components?

I have been using next-mdx-remote in my next.js project. One of the components I've passed to it makes API calls using axios, which has been working well. However, I now want to switch to using react-query. When implementing this change, I encountered ...

issue with nodeJS spawn child_process on glitch.com

I am attempting to set up an express server on glitch.com using the code provided below: const path = require('path'); const { spawn } = require('child_process'); const express = require('express'); const app = express(); app ...