CSS Learning: the creation of bevel menus

Source: Internet
Author: User

To create a bevel menu is to use the corner of the border to construct a bevel, each menu item of a element, a SPAN element, set to the corner class, to achieve the bevel effect.

Set the A element to relative positioning, a is a child of span set to absolute positioning, and then set the top and left of span to zero, so that the bevel is positioned in the upper-right corner bounded by the border.

The following code shows the effect as follows

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "><Htmlxmlns= "Http://www.w3.org/1999/xhtml"><Head><MetaHttp-equiv= "Content-type"Content= "text/html; Charset=utf-8 "/><Title> Bevel Menu</Title><StyleType= "Text/css">#menu{Font-family:Arial;Font-size:14px;}#menu A, #manu a:visited{Text-decoration:None;Float:Left;Color:#fff;Display:Block;Background-color:#00f;Padding:6px;Margin:1px 0 0 1px;Position:Relative;}#menu A. Corner{Position:Absolute;Height:0;Width:0;Overflow:Hidden;Border-bottom:Solid 6px #00f;Border-left:Solid 6px #fff;Top:0;Left:0;}</Style></Head><Body><DivId= "Menu"><AHref="#"><SpanClass= "Corner"></Span> Menu 1</A><AHref="#"><SpanClass= "Corner"></Span> Menu 2</A><AHref="#"><SpanClass= "Corner"></Span> Menu 3</A><AHref="#"><SpanClass= "Corner"></Span> Menu 4</A><a href= "#"><span class= "Corner"></span> Menu 5  </a></div></body></html>  

CSS Learning: the creation of bevel menus

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.