Skip to content

Instantly share code, notes, and snippets.


lbineau lbineau

View GitHub Profile
lbineau / svg-object-fit.html
Last active Jan 4, 2018
If you need to crop and scale an image in Internet Explorer and provide support back to IE9, you can do that by wrapping the image in an <svg>, and using the viewBox and preserveAspectRatio attributes to do what object-fit and object-position do. Snippet from the great Sara Soueidan blog
View svg-object-fit.html
<svg width="x" height="y"
viewBox="0 0 imgX imgY"
preserveAspectRatio="<align> <meetOrSlice>"
aria-labelledby="title" aria-role="img">
<title id="title"> img alt here &ly;/title>
<image xlink:href="..." width="100%" height="100%">
lbineau / .html
Last active Jan 6, 2017
Non western languages
View .html
<!DOCTYPE html>
<html lang="zh-Hans">
<meta charset="utf-8">
<a href="">See all the possible languages codes</a>
├── layouts
│   └── default.html
├── pages
│   └── index.html
├── data
│   └── i18n
│       ├── cn.json
│       └── template.html
You can’t perform that action at this time.