Skip to content

Instantly share code, notes, and snippets.

Avatar

lbineau lbineau

View GitHub Profile
@lbineau
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 http://www.sarasoueidan.com/blog/svg-object-fit/
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%">
</image>
@lbineau
lbineau / .html
Last active Jan 6, 2017
Non western languages
View .html
<!DOCTYPE html>
<html lang="zh-Hans">
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<a href="http://www.w3schools.com/TAgs/ref_language_codes.asp">See all the possible languages codes</a>
</body>
</html>
View PATHS.md
src
├── layouts
│   └── default.html
├── pages
│   └── index.html
├── data
│   └── i18n
│       ├── cn.json
│       └── template.html
You can’t perform that action at this time.