Breadcrumbs stylization. Breadcrumbs in web design: application and examples. Breadcrumbs markup

The previous article “Navigating breadcrumbs with triangles in CSS” described how to create a menu with pure CSS, without the use of graphics.

The method is good for everyone, except for one thing - support for such a menu in older browsers is doubtful. But when translating this article, a link was mentioned to a way to create navigation using graphics.

The article was written a long time ago, but the method is absolutely working. The author of the article is Veerle Pieters, and the post itself is called “Simple scalable CSS based breadcrumbs”. Below I give not even a free translation of it, but a free retelling.

A few days ago, I had the task of creating a breadcrumbs-style navigation menu for a site I was working on. I don't think that such a menu is necessary for every site, but in some cases it is very useful and practical.

However, this example is, as it were, a basis that can be expanded and applied in practice. The menu will be created using a regular bulleted list

1 ul
.

But first, let's look at the sample we'll be working with:

The menu is quite simple, as is the code with which we will create it.

HTML code - bulleted list ul

All menu items have links, except for the last one - “The page you are on right now” (The page you are on right now). While working on the menu, I wondered - is the list the most appropriate structure for creating a menu? I believe that using a list in this case is not a strict rule, but it seems to me that this is the most semantic and correct option.

CSS code - creating styles for the menu

We set general styles for the menu - remove markers and reset indents in Firefox, IE browsers:

make floating through the property equal to the height of the entire menu - . And set the text color. Next, we place a background image cut from the layout for the link. To do this, you need to cut out only the “arrow” itself:

… which we “push” to the right (100%) and place exactly vertically (50%). We also indent the link to the right

1 padding-left: 15px
, which will contain the background image (the cut arrow): .crumbs li a ( display : block ; padding : 0 15px 0 0 ; background : url(img/crumbs.gif) 100% 50% no-repeat ; )

Almost everything has already been done. It remains to set styles for the link text. Remove the standard underline and change its color:

.crumbs li a :link , .crumbs li a :visited ( text-decoration : none ; color : #777 ; )
1 :hover
And
1 :focus
. When hovering the mouse or receiving keyboard focus, the color of the link text will change: .crumbs li a :hover , .crumbs li a :focus ( color : #dd2c0d ; )

The result of our work is presented here:

Translator's note:

The author of the article simplified the example as much as possible and the code itself, respectively, as far as I understand. The fact is that the linear horizontal gradient for each of the menu items is clearly visible in the example. However, this was not shown in the code. Well, it doesn't matter - is it really a problem to create a linear gradient in CSS3? The task itself is done!

Hello dear readers. On this day we will learn to create beautiful bread crumbs (breadcrumbs) for regular sites, as well as for WordPress blogs. I advise you not to skip this moment, because the crumbs show the path to your article or information on the site, which will greatly facilitate site navigation, as well as additional internal links.

css

ul( margin: 0; padding: 0; list-style: none; )

Everything, the first not unimportant step was taken. Now let's add beautiful view to our little ones.

First example

The very view of the element will consist of three parts, which are connected into one whole part. To make it clearer, see the figure below:

#breadcrumbs-one( background: #eee; border-width: 1px; border-style: solid; border-color: #f5f5f5 #e5e5e5 #ccc; border-radius: 5px; box-shadow: 0 0 2px rgba(0, 0,0,.2); overflow: hidden; width: 100%; ) #breadcrumbs-one li( float: left; ) #breadcrumbs-one a( padding: .7em 1em .7em 2em; float: left; text- decoration: none; color: #444; position: relative; text-shadow: 0 1px 0 rgba(255,255,255,.5); background-color: #ddd; background-image: linear-gradient(to right, #f5f5f5, # ddd); ) #breadcrumbs-one li:first-child a( padding-left: 1em; border-radius: 5px 0 0 5px; ) #breadcrumbs-one a:hover( background: #fff; ) #breadcrumbs-one a ::after, #breadcrumbs-one a::before( content: ""; position: absolute; top: 50%; margin-top: -1.5em; border-top: 1.5em solid transparent; border-bottom: 1.5em solid transparent; border-left: 1em solid; right: -1em; ) #breadcrumbs-one a::after( z-index: 2; border-left-color: #ddd; ) #breadcrumbs-one a::before( border-left-color: #ccc; right: -1.1em; z-index: 1; ) #breadcrumbs-one a:hover::after( border-left-color: #fff; ) #breadcrumbs-one .current, #breadcrumbs-one .current:hover( font-weight: bold; background: none; ) # breadcrumbs-one .current::after, #breadcrumbs-one .current::before( content: normal; )

Second example

Here, as in the first example, the element consists of three parts, which are combined into one part using CSS.

#breadcrumbs-two( overflow: hidden; width: 100%; ) #breadcrumbs-two li( float: left; margin: 0 .5em 0 1em; ) #breadcrumbs-two a( background: #ddd; padding: .7em 1em ; float: left; text-decoration: none; color: #444; text-shadow: 0 1px 0 rgba(255,255,255,.5); position: relative; ) #breadcrumbs-two a:hover( background: #99db76; ) #breadcrumbs-two a::before( content: ""; position: absolute; top: 50%; margin-top: -1.5em; border-width: 1.5em 0 1.5em 1em; border-style: solid; border- color: #ddd #ddd #ddd transparent; left: -1em; ) #breadcrumbs-two a:hover::before( border-color: #99db76 #99db76 #99db76 transparent; ) #breadcrumbs-two a::after( content : ""; position: absolute; top: 50%; margin-top: -1.5em; border-top: 1.5em solid transparent; border-bottom: 1.5em solid transparent; border-left: 1em solid #ddd; right: -1em; ) #breadcrumbs-two a:hover::after( border-left-color: #99db76; ) #breadcrumbs-two .current, #breadcrumbs-two .current:hover( font-weight: bold; background: none; ) #breadcrumbs-two .current::after, #breadcrumbs-two .current::before( content: normal; )

Third example

In the third subject, the elements consist of two parts.

#breadcrumbs-three( overflow: hidden; width: 100%; ) #breadcrumbs-three li( float: left; margin: 0 2em 0 0; ) #breadcrumbs-three a( padding: .7em 1em .7em 2em; float: left; text-decoration: none; color: #444; background: #ddd; position: relative; z-index: 1; text-shadow: 0 1px 0 rgba(255,255,255,.5); border-radius: .4em 0 0 .4em; ) #breadcrumbs-three a:hover( background: #abe0ef; ) #breadcrumbs-three a::after( background: #ddd; content: ""; height: 2.5em; margin-top: -1.25em ; position: absolute; right: -1em; top: 50%; width: 2.5em; z-index: -1; transform: rotate(45deg); border-radius: .4em; ) #breadcrumbs-three a:hover: :after( background: #abe0ef; ) #breadcrumbs-three .current, #breadcrumbs-three .current:hover( font-weight: bold; background: none; ) #breadcrumbs-three .current::after( content: normal; )

Fourth example

#breadcrumbs-four( overflow: hidden; width: 100%; ) #breadcrumbs-four li( float: left; margin: 0 .5em 0 1em; ) #breadcrumbs-four a( background: #ddd; padding: .7em 1em ; float: left; text-decoration: none; color: #444; text-shadow: 0 1px 0 rgba(255,255,255,.5); position: relative; ) #breadcrumbs-four a:hover( background: #efc9ab; ) #breadcrumbs-four a::before, #breadcrumbs-four a::after( content:""; position:absolute; top: 0; bottom: 0; width: 1em; background: #ddd; transform: skew(-10deg ); ) #breadcrumbs-four a::before( left: -.5em; border-radius: 5px 0 0 5px; ) #breadcrumbs-four a:hover::before( background: #efc9ab; ) #breadcrumbs-four a ::after( right: -.5em; border-radius: 0 5px 5px 0; ) #breadcrumbs-four a:hover::after( background: #efc9ab; ) #breadcrumbs-four .current, #breadcrumbs-four .current :hover( font-weight: bold; background: none; ) #breadcrumbs-four .current::after, #breadcrumbs-four .current::before( content: normal; )

Example

That's all, I think that they are very stylish and at the same time simple crumbs. Moreover, there are no images, respectively, they load faster.

All examples in styles use the tag hover, which changes the color of the element when , so if you do not like any of the colors presented, you can easily replace it with your own.

Now it's time to move on to the second part, namely, we will attach one of the examples to our WordPress blog, let's go.

Part 2. How to Attach Breadcrumb Data to a WordPress Blog

And so, first we need to download the plugin Breadcrumb NavXT, you can download it. After the plugin is downloaded and activated, you will need to make some settings:

The settings are in the options. In the tab General need to find the line Breadcrumb Separator and remove the standard value that is there, in other words, you need to leave the field empty.

Everything, with the plugin finished, now you need to choose the design that you like the most. In this case, the example will be this style:

This second example located above in the article.

We take and simply copy these styles, and then add them to style.css Your theme, in any place that you like best, I advise you to highlight the beginning and end of the styles of the crumbs, because if in the future you want to change anything there, you will get confused.

Now we need to add the breadcrumbs directly to the blog.

In the blog admin we find appearance, then editor, and choose single.php. Next, add the following:

Important

Please note that the function of calling crumbs itself is between the tags

whose id breadcrumbs-two, do not forget to change this id to the example that you added to the styles. For example, if this is the first example (the one above) then it should be like this:
and so on. (Sorry for the puzzle) :-)

If your blog template is similar to mine, in the sense that the background is gray and the content block itself is white, crumbs are best placed above the block, like mine. Because they can wrap to a new line if the name is too long and, believe me, it's not very pretty. :-)

That's all. Dear friends, if there are any difficulties, be sure to ask in the comments. See you soon.

Thanks to the development of CSS and CSS3 in recent years, we have reached the point where many old software solutions involving background images can now be built entirely in CSS. In this tutorial, we'll look at creating a sequence of navigation links called "breadcrumb" in a flat style, without the need for the previously popular background image technique called the "sliding door" method.

« breadcrumbs” that we will create are styled in the form of chevrons to visualize the idea of ​​structured content. Previously, we would have used a PNG background image to create this chevron shape, but now with a clever border technique, we can create the same effect using just CSS.

We'll start by creating breadcrumb navigation links as an unordered list. Each breadcrumb will be an element

  • with the anchor element installed.

    #crumbs ul li a ( display : block ; float : left ; height : 50px ; background : #3498db ; text-align : center ; padding : 30px 40px 0 40px ; position : relative ; margin : 0 10px 0 0 ; font-size : 20px ; text-decoration : none ; color : #fff ; )

    The initial CSS code sets each list item anchor to a neat blue rectangle style. The text is centered and equal padding is added on all sides. In order to position absolutely next elements, a position: relative; property has been added to those elements so that those absolutely positioned elements appear relative to that parent element.

    #crumbs ul li a:after ( content : "" ; border-top : 40px solid red ; border-bottom : 40px solid red ; border-left : 40px solid blue ; position : absolute ; right : -40px ; top : 0 ; )

    Now we'll create a chevron effect in CSS, which was previously only achievable using a background image. Use the :after selector to create an additional element that can be individually styled. The triangular shape is created using different CSS borders, so as you can see in the previous image, the blue triangle can be created by applying top and bottom borders to intersect the covering area. These borders are colored red for clarity, but if they are transparent, a blue triangle will result. This border effect is then moved into place using absolute positioning.

    Border-top : 40px solid transparent ; border-bottom : 40px solid transparent ; border-left : 40px solid #3498db ;

    The border effect with the correct color values ​​will create the desired triangle that gives the breadcrumbs the popular chevron shape.

    #crumbs ul li a:before ( content : "" ; border-top : 40px solid transparent ; border-bottom : 40px solid transparent ; border-left : 40px solid #d4f2ff ; position : absolute ; left : 0 ; top : 0 ; )

    Using the same principles, another triangular shape can be applied to the left side of the breadcrumb. This time, the border color is set to the same color as the background color to hide parts of the link's blue background color.

    Padding : 30px 40px 0 80px ;

    As links are added to the HTML, the sequence of breadcrumbs increases, separated by interestingly shaped chevrons, thanks to the triangular CSS border effect and a slight right margin.

    #crumbs ul li:first-child a ( border-top-left-radius: 10px ; border-bottom-left-radius: 10px ; ) #crumbs ul li:first-child a:before ( display : none ; ) #crumbs ul li:last-child a ( padding-right : 80px ; border-top-right-radius: 10px ; border-bottom-right-radius: 10px ; ) #crumbs ul li:last-child a:after ( display : none ; )

    The complete breadcrumb box can be further styled by removing the triangle effect from the first and last elements with the :first-child and :last-child selectors, after which you can give the corners a little rounding with the border-radius property.

    #crumbs ul li a:hover ( background : #fa5ba5 ; ) #crumbs ul li a:hover :after ( border-left-color : #fa5ba5 ; )

    All that's left is to apply the hover effect to the links. Don't forget to change the value of the border-left-color property for the triangle effect on the hover state so that the whole breadcrumb changes color.

    Translation - Desk

    CSS and CSS3 have come a long way in recent times, so the old styles that use images in the background to get the right shape are no longer required.

    In this article, I'll show you how to make breadcrumbs on a website using flat HTML and CSS. You can also look at interesting sites, something might come in handy. I recently made a compilation.

    At the end we will get the following result:

    Previously, in order to make transparent arrows between two blocks, a transparent background image was used. Now this problem can be solved using only CSS.

    1. Frame crumbs

    • Breadcrumb

    First, let's create a bulleted list −

  • Articles By topic:
    Receiving information What is the difference between receiving information and receiving a message
    Information is information about somethingThe concept and types of information, transmission and processing, search and storage of informationExpand content Collapse content Information is, definition Information is any information received and transmitted, stored
    What is a landing page and how should it look like What is the name of a landing page on the Internet
    Most owners of private businesses, various services and small organizations understand how important it is to conduct business online. Creating a website and maintaining a page in social networks is now part of the marketing strategy of any company. But few companies and
    How to install your template on ucoz - A program that you did not know about, we are learning to connect!
    How to Install a Joomla Template - Troubleshooting - 4.5 out of 5 based on 2 votes Selecting, installing and configuring a template is one of the most important steps in creating a Joomla site. In this tutorial, we'll look at how to install a template
    Faibisovich - a guide to the design of electrical networks
    HANDBOOK ON THE DESIGN OF ELECTRIC NETWORKS Edited by D. L. FAIBISOVICH Edition 4, revised and supplemented Reviewer V. V. Mogirev Authors : I. G. Karapetyan (pp. 3.2, 5.1, 5.3–5.8, sec. 6, sec. 7), D. L. Faibisovi