2016-09-11 11:00:49 +00:00
---
layout: documentation
doc-tab: elements
doc-subtab: image
2017-07-28 21:57:51 +00:00
variables:
- name: $dimensions
value: 16 24 32 48 64 96 128
2016-09-11 11:00:49 +00:00
---
{% include subnav-elements.html %}
< section class = "section" >
< div class = "container" >
< h1 class = "title" > Images< / h1 >
< h2 class = "subtitle" >
A container for < strong > responsive images< / strong >
< / h2 >
< hr >
< div class = "content" >
< p > Because images can take a few seconds to load (or not at all), use the < code > .image< / code > container to specify a < strong > precisely sized< / strong > container so that your layout isn't broken because of image loading or image errors.< / p >
< / div >
< div class = "example" >
< figure class = "image is-128x128" >
2016-12-22 18:17:26 +00:00
< img src = "{{site.url}}/images/placeholders/128x128.png" >
2016-09-11 11:00:49 +00:00
< / figure >
< / div >
{% highlight html %}
< figure class = "image is-128x128" >
2016-12-22 18:17:26 +00:00
< img src = "{{site.url}}/images/placeholders/128x128.png" >
2016-09-11 11:00:49 +00:00
< / figure >
{% endhighlight %}
< hr >
< h3 class = "title" > Fixed square images< / h3 >
< div class = "content" >
< p > There are < strong > 7< / strong > dimensions to choose from, useful for < strong > avatars< / strong > :< / p >
< / div >
< table class = "table is-bordered" >
< tbody >
< tr >
< td > < code > image is-16x16< / code > < / td >
2016-12-22 18:17:26 +00:00
< td > < figure class = "image is-16x16" > < img src = "{{site.url}}/images/placeholders/16x16.png" > < / figure > < / td >
2016-09-11 11:00:49 +00:00
< td > 16x16px< / td >
< / tr >
< tr >
< td > < code > image is-24x24< / code > < / td >
2016-12-22 18:17:26 +00:00
< td > < figure class = "image is-24x24" > < img src = "{{site.url}}/images/placeholders/24x24.png" > < / figure > < / td >
2016-09-11 11:00:49 +00:00
< td > 24x24px< / td >
< / tr >
< tr >
< td > < code > image is-32x32< / code > < / td >
2016-12-22 18:17:26 +00:00
< td > < figure class = "image is-32x32" > < img src = "{{site.url}}/images/placeholders/32x32.png" > < / figure > < / td >
2016-09-11 11:00:49 +00:00
< td > 32x32px< / td >
< / tr >
< tr >
< td > < code > image is-48x48< / code > < / td >
2016-12-22 18:17:26 +00:00
< td > < figure class = "image is-48x48" > < img src = "{{site.url}}/images/placeholders/48x48.png" > < / figure > < / td >
2016-09-11 11:00:49 +00:00
< td > 48x48px< / td >
< / tr >
< tr >
< td > < code > image is-64x64< / code > < / td >
2016-12-22 18:17:26 +00:00
< td > < figure class = "image is-64x64" > < img src = "{{site.url}}/images/placeholders/64x64.png" > < / figure > < / td >
2016-09-11 11:00:49 +00:00
< td > 64x64px< / td >
< / tr >
< tr >
< td > < code > image is-96x96< / code > < / td >
2016-12-22 18:17:26 +00:00
< td > < figure class = "image is-96x96" > < img src = "{{site.url}}/images/placeholders/96x96.png" > < / figure > < / td >
2016-09-11 11:00:49 +00:00
< td > 96x96px< / td >
< / tr >
< tr >
< td > < code > image is-128x128< / code > < / td >
2016-12-22 18:17:26 +00:00
< td > < figure class = "image is-128x128" > < img src = "{{site.url}}/images/placeholders/128x128.png" > < / figure > < / td >
2016-09-11 11:00:49 +00:00
< td > 128x128px< / td >
< / tr >
< / tbody >
< / table >
< h4 class = "title is-4" > Retina images< / h4 >
< div class = "content" >
< p > Because the image is fixed in size, you can use an image that is < strong > twice as big< / strong > . So for example, in a < code > 128x128< / code > container, you can use a < code > 256x256< / code > image, but resized to < strong > 128x128< / strong > pixels.< / p >
< / div >
< div class = "example" >
< figure class = "image is-128x128" >
2016-12-22 18:17:26 +00:00
< img src = "{{site.url}}/images/placeholders/256x256.png" >
2016-09-11 11:00:49 +00:00
< / figure >
< / div >
{% highlight html %}
< figure class = "image is-128x128" >
2016-12-22 18:17:26 +00:00
< img src = "{{site.url}}/images/placeholders/256x256.png" >
2016-09-11 11:00:49 +00:00
< / figure >
{% endhighlight %}
< hr >
< h3 class = "title" > Responsive images with ratios< / h3 >
< div class = "content" >
< p > If you don't know the exact dimensions but know the < strong > ratio< / strong > instead, you can use one of the < strong > 5 ratio modifers< / strong > :< / p >
< / div >
< table id = "images" class = "table is-bordered" >
< tbody >
< tr >
< td > < code > image is-square< / code > < / td >
2016-12-22 18:17:26 +00:00
< td > < figure class = "image is-square" > < img src = "{{site.url}}/images/placeholders/480x480.png" > < / figure > < / td >
2016-09-11 11:00:49 +00:00
< td > Square (or 1by1)< / td >
< / tr >
< tr >
< td > < code > image is-1by1< / code > < / td >
2016-12-22 18:17:26 +00:00
< td > < figure class = "image is-1by1" > < img src = "{{site.url}}/images/placeholders/480x480.png" > < / figure > < / td >
2016-09-11 11:00:49 +00:00
< td > 1 by 1< / td >
< / tr >
< tr >
< td > < code > image is-4by3< / code > < / td >
2016-12-22 18:17:26 +00:00
< td > < figure class = "image is-4by3" > < img src = "{{site.url}}/images/placeholders/640x480.png" > < / figure > < / td >
2016-09-11 11:00:49 +00:00
< td > 4 by 3< / td >
< / tr >
< tr >
< td > < code > image is-3by2< / code > < / td >
2016-12-22 18:17:26 +00:00
< td > < figure class = "image is-3by2" > < img src = "{{site.url}}/images/placeholders/480x320.png" > < / figure > < / td >
2016-09-11 11:00:49 +00:00
< td > 3 by 2< / td >
< / tr >
< tr >
< td > < code > image is-16by9< / code > < / td >
2016-12-22 18:17:26 +00:00
< td > < figure class = "image is-16by9" > < img src = "{{site.url}}/images/placeholders/640x360.png" > < / figure > < / td >
2016-09-11 11:00:49 +00:00
< td > 16 by 9< / td >
< / tr >
< tr >
< td > < code > image is-2by1< / code > < / td >
2016-12-22 18:17:26 +00:00
< td > < figure class = "image is-2by1" > < img src = "{{site.url}}/images/placeholders/640x320.png" > < / figure > < / td >
2016-09-11 11:00:49 +00:00
< td > 2 by 1< / td >
< / tr >
< / tbody >
< / table >
< div class = "content" >
< p > The < code > .image< / code > container will take up the < strong > whole width< / strong > while maintaining the perfect ratio.< / p >
< / div >
2017-07-28 21:57:51 +00:00
{% include variables.html %}
2016-09-11 11:00:49 +00:00
< / div >
< / section >