CSS-based breadcrumbs navigation and css breadcrumbs

Source: Internet
Author: User

CSS-based breadcrumbs navigation and css breadcrumbs

I made a breadcrumb-style navigation by referring to the tutorial. Here, I will share with you the implementation method and review it myself. First Effect

The HTML code is as follows:

<Div id = "crumbs"> <ul> <li> <a href = "#"> Breadcrumb </a> </li> </ul> </div>

We use an unordered list to fill the bread navigation. Each navigation connection is equivalent to a <li> element embedded with <a> elements.
First, render each a element as a blue rectangle. Place the text in the center with appropriate padding on both sides. Set the <a> element to relative positioning. In this way, its absolute positioning sub-elements can be located relative to it.
#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;}

Use the: after selector to create an element. Use the css border to generate a triangle. Used: Apply the upper and lower borders and the left border of the elements generated by the after selector, and set the color of the upper and lower borders to transparent. Place this element in the appropriate place (via position: absolute). Note that you must set the z-index.

#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;
z-index:5;}

Set the upper and lower borders to transparent. After resetting the color of the left border
border-top: 40px solid transparent;border-bottom: 40px solid transparent;border-left: 40px solid #3498db;

Use the same method to render a triangle style on the left of the rectangle frame. This time it is set: the upper and lower borders of the before element are transparent. The color of the left border is the same as the background color of the page, disguised as part of the page.
#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;}

<div id="crumbs"><ul><li><a href="#1">One</a></li><li><a href="#2">Two</a></li><li><a href="#3">Three</a></li><li><a href="#4">Four</a></li><li><a href="#5">Five</a></li></ul></div>

#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; }
# Crumbs ul li a: hover {background: # fa5ba5;} # crumbs ul li a: hover: after {border-left-color: # fa5ba5 ;}
This complete breadcrumb navigation is complete. The translation level still needs to be improved...
Attached original address: http://line25.com/tutorials/how-to-create-flat-style-breadcrumb-links-with-css

 

 

 


 


Css problems in wordpress breadcrumb navigation

Try to limit the div width of the breadcrumb part in the introduced css file.
For example:
. Breadcrumbs {width: 960px ;}
Hope you can help the landlord. wordpress has never been used. Try it.

How can I help you simplify the navigation structure of a site?

? Why? Are you confused? Why is there a zinc deficiency? Which of the following is anti-fraud protection? Which of the following has it fallen ?? Why ?? School? 5 bytes? Zheng He: What is the lag of melons? Why is jomm throwing a beep? Is the stool ready for living? Why? What is the barrier muscle protection? The ghost value has all been the Yundi value of qinghuan tongtan tongxia ?? Why is it true? What is the ultimate travel experience? What are the differences between the V and the V? What kind of work is it? Hey, what's the brain of gender? Why ???. If your website directories are stored in different folders by category, you can use PHP or javascript, but use PHP, it is more conducive to SEO search engine optimization, because this method can be easily recognized by crawlers, And the implementation method can use the PHP $ _ SERVER variable to get the URL of the page and then process it. For example, you can use str () series functions of php or ereg () series functions. Of course, you must use any of the following methods. 2. Your website uses PHP, right? Most of the data is stored in the database, right? So you have set up directory classification for MYSQL, right? Maybe even cascade ends or internal connections, right? When you read the webpage content, you can extract the category information from the database and column it to the navigation bread step by step. This approach is even easier than the first one. 3. if your database category is not very clear (of course, if this step is achieved, the quality of your website remains to be discussed ), then you should simply create a new field in your database and put the breadcrumb navigation link of the article into the record. Then you can extract it directly. 4. Is your page static? Comments from the questioner:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.