Permalink
Browse files

htc cannot be loaded accross origin :-( fix the docs!

  • Loading branch information...
1 parent 20938ee commit b634b245517d79504a44d9880d04f2dccf54c714 @louisremi committed Dec 14, 2012
Showing with 8 additions and 12 deletions.
  1. +1 −0 .htaccess
  2. +7 −12 README.md
View
@@ -0,0 +1 @@
+AddType text/x-component .htc
View
@@ -18,17 +18,21 @@ Unfortunately, they don't degrade gracefully: websites would likely appear broke
...unless you use this behavior!
How to use it?
------------------
+--------------
+
+Upload `backgroundsize.min.htc` to your website, along with the `.htaccess` that will send the mime-type required by IE (Apache only — it's built in nginx, node and IIS).
Everywhere you use `background-size: cover;` or `background-size: contain;` in your CSS, add a reference to this file.
```css
.selector {
background-size: cover;
- -ms-behavior: url(http://louisremi.github.com/background-size-polyfill/backgroundsize.min.htc);
+ /* The url is relative to the document, not to the css file! */
+ /* Prefer absolute urls to avoid confusion. */
+ -ms-behavior: url(/backgroundsize.min.htc);
}
```
-The elements targeted this way should have a `position: relative;` or `position: fixed;` and a z-index.
+The elements styled this way should have a `position: relative;` or `position: fixed;` and a z-index.
If not, they will be given a `position: relative;` and `z-index: 0;`.
Limitations
@@ -56,15 +60,6 @@ The following style properties, values or behavior aren't supported:
Removing any of these limitations is probably just one fork away...
-Self-hosting
-------------
-
-When deploying this solution on production environment, you should switch to a self-hosted version of the file.
-You will need to configure your server to send appropriate `text/x-component` headers along with it.
-
-- Apache: add the following line to an .htaccess file: `AddType text/x-component .htc`
-- Node: the node-mime module already recognizes that extension
-
License
-----------------

0 comments on commit b634b24

Please sign in to comment.