Rounded corners in HTML

Source: Internet
Author: User


Today, let's talk about the fillet in HTML and how to implement fillets.


At the earliest, we were all using images, making a rounded picture, making a background, or applying this picture in the corner of the container, so it was easy to do.


With the migration of time, it is found that there are too many small images, increasing the number of requests sent by the browser, and increasing the amount of data downloaded, and everyone is starting to flatten the design.


There are some properties in CSS3 that can be used to achieve fillets, but the support for ie6-8 is not good, and various browsers have their own rules of interpretation.

/* Universal Fillet  */.corner{    -moz-border-radius: 10px; /* Firefox -  */    -webkit-border-radius: 10px; /* safari and chrome -  */    border-radius: 10px;    behavior: url (.. /PUBLIC/CSS/PIE.HTC);  /*for ie*/    width:100px;    height : 100px;    background: #000000;} /*  Fillet  */.cornerT{    -moz-border-radius: 10px 10px 0px 0;  /* Firefox - */    -webkit-border-radius: 10px 10px  0px 0; /* safari and chrome - */    border-radius:  10px 10px 0px 0;    behavior: url (.. /PUBLIC/CSS/PIE.HTC);  /*for ie*/    width:100px;    height : 100px;&nbsP;   background: #000000;} /*  Bottom Fillet */.cornerb{    -moz-border-radius: 0 0 10px 10px; /*  Firefox - */    -webkit-border-radius: 0 0 10px 10px;  /* safari and chrome - */    border-radius: 0 0  10px 10px;    behavior: url (.. /PUBLIC/CSS/PIE.HTC);  /*for ie*/    width:100px;    height : 100px;    background: #000000;}

The main is three properties

-moz-border-radius:0 0 10px 10px; /* Firefox-*/-webkit-border-radius:0 0 10px 10px; /* Safari and Chrome-*/border-radius:0 0 10px 10px;

If compatible with IE8 version requires

Behavior:url (.. /PUBLIC/CSS/PIE.HTC); /*for ie*/

This sentence, need to download PIE.HTC file, there is a iecss3.htc file, I tried a bit, compatibility is not as good as PIE.HTC.


can also use Js,jquery has a plug-in jquery.corner.js, I also tried, in firefox30.0 incompatible, did not come out of effect.


The attachment is my code, you can download to try it.


This article is from the "Breaking It Architect" blog, so be sure to keep this source http://virusswb.blog.51cto.com/115214/1430032

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.