Git Product home page Git Product logo

breadcrumb-arrow_style's Introduction

Breadcrumb-Arrow_Style

CSS trick to create an arrow effect using the ::before and ::after pseudo-elements to add filled rectangles (with empty content) before and after each list item in the breadcrumb path.

General info

The purpose of the project is just personal learning. Also kept for future reference.

Description

  • This works by using the ::before and ::after pseudo-elements to add filled rectangles (content="" - empty) before and after each list item.
    .breadcrumb li a::before, .breadcrumb li a::after {
    content: "";
    position: absolute;
    border-color: darkcyan;
    border-style: solid;
    border-width: 15px 5px;
    }

  • The total width of the pseudo-elements is 10px, since the border has 5px on the left and 5px on the right. To move the pseudo-elements to the proper location.
    .breadcrumb a::before {
    left: -10px;
    }
    .breadcrumb a::after {
    left: 100%;
    }

  • The after elements are styled as heads by setting the border color to transparent except for the border-left-color:
    .breadcrumb a::after {
    left: 100%;
    border-color: transparent;
    border-left-color: darkcyan;
    }

  • By setting a portion of the border to transparent, it creates the tail of the arrow:
    .breadcrumb a::before {
    left: -10px;
    border-left-color: transparent;
    }

Screenshots

Example screenshot

Technologies

  • HTML5
  • CSS3

Setup

NA - It's only coding examples, there's no setup.

Status

Project is: finished, - Kept for reference.

References

Based on Codecademy's Learn Navigation Design course

breadcrumb-arrow_style's People

Contributors

candytale55 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.