CSS exercises-navigation bar slash delimited-using pseudo-elements

Source: Internet
Author: User

Start cutting the first picture, the first problem encountered is the top navigation bar here, with a slash split. Think of the idea is to use pseudo-class: Before or: after implementation

Write the HTML structure first.

<!--navigation bar begin -    <Divclass= "Header_right fr">    <ahref="#"class= "link">Home</a>    <ahref="#"class= "link">About</a>    <ahref="#"class= "link">Features</a>    <ahref="#"class= "link">Blog</a>    <ahref="#"class= "link">Shop</a>    <Divclass= "Alarm FR">    <imgsrc= "./images/alarm.png"alt= "Alarm" /></Images><Iclass= "Alarm_number">2</I>    </Div>    </Div> <!--Navigation bar End -

Again the style

. Link:before {content: "/"; margin:0 24px; color: grey;} . Link:first-child:before {display:none;}

First use: Bofore, set the content is "/", front and rear margin, color. Then use First-child to remove the pseudo-class that precedes the first element.

The effect is like this

It seems that there is no diagonal tilt angle in the design chart.

CSS exercises-navigation bar slash delimited-using pseudo-elements

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.