Bootstrap 4 Remove the first forward slash in breadcrumbs

Mr. ED

On my breadcrumbs in Bootstrap 4 after the first li I need to be able to remove forward slash

Change

Location: / Catalog

To

Location: Catalog

Question: How am I able to remove the first forward slash on bootstrap breadcrumbs

enter image description here

I tried

.breadcrumb-item:first-of-type::before {
    display: inline-block;
    padding-right: 0.5rem;
    padding-left: 0.5rem;
    color: #868e96;
    content: "";
}

HTML

<div class="modal-header justify-content-center">
<ol class="breadcrumb">
<li class="breadcrumb-item">Location: </li>
<?php foreach ($breadcrumbs as $breadcrumb) { ?>
<li class="breadcrumb-item"><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a></li>
<?php } ?>
</ol>
</div> 
Raphael Cunha

I believe what you're looking for is this.

Since Bootstrap adds the / before the elements starting on the second element, we have to select the second element by using the nth-child() CSS selector like so.

.breadcrumb .breadcrumb-item:nth-child(2)::before {
  content: "";
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">

<div class="modal-header justify-content-center">
  <ol class="breadcrumb">
    <li class="breadcrumb-item">Location: </li>
    <li class="breadcrumb-item"><a href="#">Content</a></li>
  </ol>
</div> 

<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js" integrity="sha384-h0AbiXch4ZDo7tp9hKZ4TsHbi047NrKGLO3SEJAg45jXxnGIfYzk4Si90RDIqNm1" crossorigin="anonymous"></script>

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

how can i remove the first forward slash?

How to remove trailing forward slash

Remove backslash before forward slash

How to replace before first forward slash

How to decode bytes to first forward slash?

Removing first forward slash from string

How to remove bootstrap breadcrumbs outline border color?

How to remove only the last forward slash in the field?

how to remove a specific forward slash in a URL?

How to remove escaped forward slash using php?

Remove Part of String Before the Last Forward Slash

Remove forward-slash using sed

Remove trailing forward slash and question mark

php remove forward slash from php URL

How to remove forward slash (\) from a string in Python?

FontAwesome Pro icons and Bootstrap 4 breadcrumbs

Right align text within Bootstrap 4 breadcrumbs

Java Regex pattern to pull date format up to the first forward slash

Why is the first value in pathlib.Path.parts a forward slash?

How to remove first slash in href - jQuery

Javascript regular expression: remove first and last slash

Remove all text between (and including) a forward-slash and a comma

Remove and adding forward slash when serializing Path in Jackson

how to remove forward slash from specific url using htaccess

Remove everything after last forward slash in Google Sheets with Regex

Remove forward slash when tabbing to see a list of directories

Apache remove last forward slash before the "?param=value"

how to remove forward slash generated from wordpress editor

how to remove the start of a link and add a forward slash in python