"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[5683],{3905:function(e,t,a){a.d(t,{Zo:function(){return m},kt:function(){return g}});var i=a(7294);function n(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function r(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,i)}return a}function l(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?r(Object(a),!0).forEach((function(t){n(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):r(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function s(e,t){if(null==e)return{};var a,i,n=function(e,t){if(null==e)return{};var a,i,n={},r=Object.keys(e);for(i=0;i<r.length;i++)a=r[i],t.indexOf(a)>=0||(n[a]=e[a]);return n}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(i=0;i<r.length;i++)a=r[i],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}var o=i.createContext({}),c=function(e){var t=i.useContext(o),a=t;return e&&(a="function"==typeof e?e(t):l(l({},t),e)),a},m=function(e){var t=c(e.components);return i.createElement(o.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return i.createElement(i.Fragment,{},t)}},p=i.forwardRef((function(e,t){var a=e.components,n=e.mdxType,r=e.originalType,o=e.parentName,m=s(e,["components","mdxType","originalType","parentName"]),p=c(a),g=n,h=p["".concat(o,".").concat(g)]||p[g]||u[g]||r;return a?i.createElement(h,l(l({ref:t},m),{},{components:a})):i.createElement(h,l({ref:t},m))}));function g(e,t){var a=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var r=a.length,l=new Array(r);l[0]=p;var s={};for(var o in t)hasOwnProperty.call(t,o)&&(s[o]=t[o]);s.originalType=e,s.mdxType="string"==typeof e?e:n,l[1]=s;for(var c=2;c<r;c++)l[c]=a[c];return i.createElement.apply(null,l)}return i.createElement.apply(null,a)}p.displayName="MDXCreateElement"},2695:function(e,t,a){a.d(t,{Z:function(){return s}});var i=a(7462),n=a(3366),r=a(7294),l=["isBad","isGood","children","disableFullscreen","limitWidth"];function s(e){var t=e.isBad,a=e.isGood,s=e.children,o=e.disableFullscreen,c=e.limitWidth,m=(0,n.Z)(e,l),u=(0,r.useState)(!1),p=u[0],g=u[1];return r.createElement("div",{className:"preview-box-wrapper",style:c?{width:c,display:"table",margin:"0 auto"}:{}},!o&&r.createElement("button",{"aria-label":p?"Minimize the example":"Fullscreen the example",className:"preview-box-fullscreen-toggle",onClick:function(e){var t=e.target.closest(".preview-box-wrapper");p?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen():t.requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.msRequestFullscreen&&t.msRequestFullscreen(),g(!p)}},p?r.createElement("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",x:"0",y:"0",viewBox:"0 0 24 24"},r.createElement("path",{d:"M19.707 18.293a1 1 0 01-1.414 1.414L16 17.414V18a1 1 0 01-2 0v-3a1 1 0 011-1h3a1 1 0 010 2h-.586zM9 14H6a1 1 0 000 2h.586l-2.293 2.293a1 1 0 001.414 1.414L8 17.414V18a1 1 0 002 0v-3a1 1 0 00-1-1zm0-9a1 1 0 00-1 1v.586L5.707 4.293a1 1 0 00-1.414 1.414L6.586 8H6a1 1 0 000 2h3a1 1 0 001-1V6a1 1 0 00-1-1zm6 5h3a1 1 0 000-2h-.586l2.293-2.293a1 1 0 00-1.414-1.414L16 6.586V6a1 1 0 00-2 0v3a1 1 0 001 1z"})):r.createElement("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",x:"0",y:"0",viewBox:"26 26 48 48"},r.createElement("path",{d:"M54.347 57.882A8.96 8.96 0 0150 59a8.96 8.96 0 01-4.347-1.118L40.736 62.8c-.38.38-.257.701.29.701h.98A2.503 2.503 0 0144.5 66c0 1.39-1.122 2.5-2.507 2.5h-7.986a2.505 2.505 0 01-2.507-2.507v-7.986A2.502 2.502 0 0134 55.5a2.49 2.49 0 012.5 2.493v.98c0 .547.314.678.7.29l4.918-4.916A8.96 8.96 0 0141 50a8.96 8.96 0 011.118-4.347L37.2 40.736c-.38-.38-.701-.257-.701.29v.98A2.503 2.503 0 0134 44.5c-1.39 0-2.5-1.122-2.5-2.507v-7.986a2.505 2.505 0 012.507-2.507h7.986A2.502 2.502 0 0144.5 34a2.49 2.49 0 01-2.493 2.5h-.98c-.547 0-.678.314-.29.7l4.916 4.918A8.96 8.96 0 0150 41a8.96 8.96 0 014.347 1.118l4.917-4.917c.38-.38.257-.701-.29-.701h-.98A2.503 2.503 0 0155.5 34c0-1.39 1.122-2.5 2.507-2.5h7.986a2.505 2.505 0 012.507 2.507v7.986A2.502 2.502 0 0166 44.5a2.49 2.49 0 01-2.5-2.493v-.98c0-.547-.314-.678-.7-.29l-4.918 4.916A8.96 8.96 0 0159 50a8.96 8.96 0 01-1.118 4.347l4.917 4.917c.38.38.701.257.701-.29v-.98A2.503 2.503 0 0166 55.5c1.39 0 2.5 1.122 2.5 2.507v7.986a2.505 2.505 0 01-2.507 2.507h-7.986A2.502 2.502 0 0155.5 66a2.49 2.49 0 012.493-2.5h.98c.547 0 .678-.314.29-.7l-4.916-4.918zM50 54a4 4 0 100-8 4 4 0 000 8z"}))),t&&r.createElement("div",{className:"is-bad-example style-red"},r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",x:"0",y:"0",viewBox:"2 2 12 12"},r.createElement("path",{d:"M3.3 12.7c.2.2.4.3.7.3s.5-.1.7-.3L8 9.4l3.3 3.3c.2.2.5.3.7.3s.5-.1.7-.3c.4-.4.4-1 0-1.4L9.4 8l3.3-3.3c.4-.4.4-1 0-1.4s-1-.4-1.4 0L8 6.6 4.7 3.3c-.4-.4-1-.4-1.4 0s-.4 1 0 1.4L6.6 8l-3.3 3.3c-.4.4-.4 1 0 1.4z"}))),a&&r.createElement("div",{className:"is-good-example style-green"},r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",x:"0",y:"0",viewBox:"0 0 18 18"},r.createElement("path",{d:"M5.056 15.04a1.5 1.5 0 002.217-.119l10.17-12.476A1.5 1.5 0 0015.118.55L6.007 11.758l-3.453-3.41a1.5 1.5 0 10-2.109 2.133l4.611 4.56"}))),r.createElement("iframe",(0,i.Z)({width:"100%",className:"docus-preview-box"+(p?" is-fullscreen":""),srcDoc:s},m)))}},8764:function(e,t,a){a.r(t),a.d(t,{frontMatter:function(){return o},contentTitle:function(){return c},metadata:function(){return m},toc:function(){return u},default:function(){return g}});var i=a(7462),n=a(3366),r=(a(7294),a(3905)),l=a(2695),s=["components"],o={title:"Figure and image"},c=void 0,m={unversionedId:"content/figure",id:"content/figure",isDocsHomePage:!1,title:"Figure and image",description:"Figures are independant parts of a page mostly contain images with captions.",source:"@site/docs/content/figure.mdx",sourceDirName:"content",slug:"/content/figure",permalink:"/docs/content/figure",editUrl:"https://github.com/amir2mi/flatifycss/tree/master/website/docs/content/figure.mdx",tags:[],version:"current",frontMatter:{title:"Figure and image"},sidebar:"tutorialSidebar",previous:{title:"Blockquote",permalink:"/docs/content/blockquote"},next:{title:"Highlight",permalink:"/docs/content/highlight"}},u=[{value:"Default",id:"default",children:[],level:3},{value:"Source link",id:"source-link",children:[],level:3},{value:"Overlay caption",id:"overlay-caption",children:[],level:3},{value:"Helper classes",id:"helper-classes",children:[],level:3}],p={toc:u};function g(e){var t=e.components,a=(0,n.Z)(e,s);return(0,r.kt)("wrapper",(0,i.Z)({},p,a,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,"Figures are independant parts of a page mostly contain images with captions."),(0,r.kt)("h3",{id:"default"},"Default"),(0,r.kt)("p",null,"A primary figure with image inside."),(0,r.kt)(l.Z,{height:"420px",children:'\n<!DOCTYPE html>\n<html lang="en"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatifycss/dist/css/flatify.min.css" /> <title>Figures</title> </head> <body> <figure> <img src="https://picsum.photos/500/300" alt="a random image"/> <figcaption>A random image - high quality images</figcaption> </figure>      </body>\n</html>\n',mdxType:"PreviewBox"}),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-html",metastring:'title="index.html"',title:'"index.html"'},'<figure>\n  <img src="https://picsum.photos/500/300" alt="a random image" />\n  <figcaption>A random image - high quality images</figcaption>\n</figure>\n')),(0,r.kt)("h3",{id:"source-link"},"Source link"),(0,r.kt)("p",null,"To mention source of the image you can put a link inside figure with ",(0,r.kt)("inlineCode",{parentName:"p"},".source")," class."),(0,r.kt)(l.Z,{height:"420px",children:'\n<!DOCTYPE html>\n<html lang="en"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatifycss/dist/css/flatify.min.css" /> <title>Figure</title> </head> <body> <figure> <img src="https://picsum.photos/500/300" alt="a random image"/> <figcaption>A random image - high quality images</figcaption> <a href="#" class="source" target="_blank" rel="nofollow">Picsum</a> </figure>      </body>\n</html>\n',mdxType:"PreviewBox"}),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-html",metastring:'{4} title="index.html"',"{4}":!0,title:'"index.html"'},'<figure>\n  <img src="https://picsum.photos/500/300" alt="a random image" />\n  <figcaption>A random image - high quality images</figcaption>\n  <a href="#" class="source" target="_blank" rel="nofollow">Picsum</a>\n</figure>\n')),(0,r.kt)("h3",{id:"overlay-caption"},"Overlay caption"),(0,r.kt)("p",null,"By adding ",(0,r.kt)("inlineCode",{parentName:"p"},".overlay-caption")," captions can be over image it is possible when you use figures because there is a wrapper."),(0,r.kt)(l.Z,{height:"420px",children:'\n<!DOCTYPE html>\n<html lang="en"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatifycss/dist/css/flatify.min.css" /> <title>Figure</title> </head> <body> <figure class="overlay-caption"> <img src="https://picsum.photos/500/300" alt="a random image"/> <figcaption>A random image - high quality images</figcaption> <a href="#" class="source" target="_blank" rel="nofollow">Picsum</a> </figure>      </body>\n</html>\n',mdxType:"PreviewBox"}),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-html",metastring:'{1} title="index.html"',"{1}":!0,title:'"index.html"'},'<figure class="overlay-caption">\n  <img src="https://picsum.photos/500/300" alt="a random image" />\n  <figcaption>A random image - high quality images</figcaption>\n  <a href="#" class="source" target="_blank" rel="nofollow">Picsum</a>\n</figure>\n')),(0,r.kt)("h3",{id:"helper-classes"},"Helper classes"),(0,r.kt)("p",null,"To center align image add ",(0,r.kt)("inlineCode",{parentName:"p"},".centered")," class to the figure, also by adding ",(0,r.kt)("inlineCode",{parentName:"p"},".fill")," class it will fill the whole space.",(0,r.kt)("br",{parentName:"p"}),"\n","There are ",(0,r.kt)("a",{parentName:"p",href:"/docs/helpers/roundness-setters"},"helper classes for roundness"),", for example by adding ",(0,r.kt)("inlineCode",{parentName:"p"},".edge-sharp")," you'll have an image without roundness."),(0,r.kt)(l.Z,{height:"1250px",children:'\n<!DOCTYPE html>\n<html lang="en"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatifycss/dist/css/flatify.min.css" /> <title>Figure</title> </head> <body>\t\t <figure class="overlay-caption edge-sharp"> <img class="edge-sharp" src="https://picsum.photos/500/300" alt="a random image"/> <figcaption>A random image - high quality images</figcaption> <a href="#" class="source" target="_blank" rel="nofollow">Picsum</a> </figure>  <br> <br> <figure class="overlay-caption centered"> <img src="https://picsum.photos/500/300" alt="a random image"/> <figcaption>A random image - high quality images</figcaption> <a href="#" class="source" target="_blank" rel="nofollow">Picsum</a> </figure>      <br> <br>  <figure class="overlay-caption fill"> <img src="https://picsum.photos/500/300" alt="a random image"/> <figcaption>A random image - high quality images</figcaption> <a href="#" class="source" target="_blank" rel="nofollow">Picsum</a> </figure>     </body>\n</html>\n',mdxType:"PreviewBox"}),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-html",metastring:'{1-2} title="index.html"',"{1-2}":!0,title:'"index.html"'},'<figure class="overlay-caption edge-sharp">\n  <img class="edge-sharp" src="https://picsum.photos/500/300" alt="a random image" />\n  <figcaption>A random image - high quality images</figcaption>\n  <a href="#" class="source" target="_blank" rel="nofollow">Picsum</a>\n</figure>\n\n<figure class="overlay-caption centered">\n  <img src="https://picsum.photos/500/300" alt="a random image" />\n  <figcaption>A random image - high quality images</figcaption>\n  <a href="#" class="source" target="_blank" rel="nofollow">Picsum</a>\n</figure>\n\n<figure class="overlay-caption fill">\n  <img src="https://picsum.photos/500/300" alt="a random image" />\n  <figcaption>A random image - high quality images</figcaption>\n  <a href="#" class="source" target="_blank" rel="nofollow">Picsum</a>\n</figure>\n')))}g.isMDXComponent=!0}}]);