Giter Site home page Giter Site logo

schepp / chroma-corners Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 120 KB

“Chroma Corners” is the name of a new technique to create rounded corners in IE 6 – 8. It uses IE’s chroma-filter as a tool to mask away corner areas, which are created as a graphic and which are filled with a solid color. It is and behaves like standard HTML + CSS as opposed to the newer VML-based approches. It gives you more freeness and needs less photoshopping work than older background image based techniques for rounded corners like “Mountain Top” or “Sliding Doors”.

Home Page: http://www.peterkroener.de/chroma-corners-fast-perfekte-runde-ecken-im-internet-explorer

License: GNU Lesser General Public License v3.0

PHP 100.00%

chroma-corners's Introduction

Copyright © 2010 Christian “Schepp” Schaefer
http://twitter.com/derSchepp

About “Chroma Corners”

“Chroma Corners” is the name of a new technique to create rounded corners in IE 6 – 8. It uses IE’s chroma-filter as a tool to mask away corner areas, which are created as a graphic and which are filled with a solid color.
It is and behaves like standard HTML + CSS as opposed to the newer VML-based approches. It gives you more freeness and needs less photoshopping work than older background image based techniques for rounded corners like “Mountain Top” or “Sliding Doors”.

Usage

You can use this solution for all borderless rounded elements and for bordered elements with a solid border-style in one single border-color.

This is how you use “Chroma Corners”:

.borderradius {
  -moz-border-radius: 14px;
  -webkit-border-radius: 14px;
  border-radius: 14px;
  behavior: url(chromacorners.htc); /* relative path from HTML-file! */
}

or:

.borderradius {
  -moz-border-radius: 14px 4px;
  -webkit-border-radius: 14px 4px;
  border-radius: 14px 4px;
  behavior: url(chromacorners.htc); /* relative path from HTML-file! */
}

or:

.borderradius {
  -moz-border-radius: 14px 4px 14px 4px;
  -webkit-border-radius: 14px 4px 14px 4px;
  border-radius: 14px 4px 14px 4px;
  behavior: url(chromacorners.htc); /* relative path from HTML-file! */
}

or:

.borderradius {
  -moz-border-top-left-radius: 14px;
  -webkit-border-top-left-radius: 14px;
  border-top-left-radius: 14px;
  behavior: url(chromacorners.htc); /* relative path from HTML-file! */
}

or:

.borderradius {
  -moz-border-radius: 14px;
  -webkit-border-radius: 14px;
  border-radius: 14px;
  border: black 1px solid;
  behavior: url(chromacorners.htc); /* relative path from HTML-file! */
}

Important: Please note that you need to set the url of the behavior not relative to the stylesheet but relative to the HTML-document. The best thing is to use an absolute path e.g.: behavior: url(/css/chromacorners/chromacorners.htc);.

Caveats

In order for this technique to work, the behavior will apply position: relative; to the to be rounded element. Keep that in mind when absolutely positioning children of the rounded one.

System Requirements

Your webspace must be running PHP 5 (no PHP 4, we are in 2010!) and GDLib v2 extension must enabled.

3rd party elements used

This behavior comes together with a PHP-script named “Rounded PHP” origined from here:
http://sourceforge.net/projects/roundedphp/
You will find all the license and author infomation inside the folder rounded-php.

In addition it borrowed a function from Dean Edward’s IE7 framework found here:
http://code.google.com/p/ie7-js/
MIT License (http://www.opensource.org/licenses/mit-license.php)

chroma-corners's People

Contributors

schepp avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.