CINXE.COM
HTML・CSSで実装するかわいいフキダシのアイデア - ICS MEDIA
<!DOCTYPE html><html lang="ja" dir="ltr" data-capo=""><head><meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=yes"> <title>HTML・CSSで実装するかわいいフキダシのアイデア - ICS MEDIA</title> <script src="https://cdn.ampproject.org/v0.js" async></script> <script src="https://cdn.ampproject.org/v0/amp-twitter-0.1.js" async custom-element="amp-twitter"></script> <script src="https://cdn.ampproject.org/v0/amp-youtube-0.1.js" async custom-element="amp-youtube"></script> <style>.ripple{overflow:hidden;position:relative}.ripple-effect{animation-name:ripple;background:#888;border-radius:50%;display:block;opacity:.2;pointer-events:none;position:absolute;transform:scale(0);-webkit-user-select:none;user-select:none;will-change:opacity,transform}.ripple[data-ripple=light] .ripple-effect{background:#fff!important}.ripple[data-ripple=dark] .ripple-effect{background:#000!important}@keyframes ripple{to{opacity:0;transform:scale(2)}}</style> <style>.btn{background-color:initial;border:1px solid #0000;border-radius:.25rem;color:#000;display:inline-block;font-size:1rem;font-weight:400;line-height:1.5;padding:.375rem .75rem;text-align:center;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;-webkit-user-select:none;user-select:none}@media (prefers-reduced-motion:reduce){.btn{transition:none}}.btn-group,.btn-group-vertical{display:inline-flex;position:relative;vertical-align:middle}button:focus{outline:5px auto var(--primary)}.btn-group>.btn-group:not(:last-child)>.btn,.btn-group>.btn:not(:last-child,.dropdown-toggle){border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn-group:not(:first-child)>.btn,.btn-group>.btn:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.btn-primary{background-color:var(--primary);color:#fff!important}@media (any-hover:hover){@supports (background-color:color-mix(in srgb,#000,#000)){.btn-primary:hover{background-color:color-mix(in srgb,var(--primary),#000 20%)}}}.btn-secondary{background-color:var(--color-btn-secondary)}@media (prefers-color-scheme:dark){.btn-secondary{color:var(--color-text-p)}}@media (any-hover:hover){@supports (background-color:color-mix(in srgb,#000,#000)){.btn-secondary:hover{background-color:color-mix(in srgb,var(--color-btn-secondary),#888 20%)}}}.btn-group-vertical>.btn,.btn-group>.btn{flex:1 1 auto;position:relative}.btn-primary:not(:disabled,.disabled).active:focus,.btn-primary:not(:disabled,.disabled):active:focus,.show>.btn-primary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem #268fff80}.text-center{text-align:center!important}.mx-auto{margin-left:auto!important;margin-right:auto!important}.badge{accent-color:red;border-radius:.25rem;display:inline-block;font-size:75%;font-weight:700;line-height:1;padding:.25em .4em;text-align:center;transition:color .2s,background-color .2s,border-color .2s;vertical-align:initial;white-space:nowrap}.badge-pill{border-radius:10rem;padding-left:.6em;padding-right:.6em}.badge-light{background-color:var(--color-btn-secondary);color:var(--color-text-p)}.badge-primary{background-color:var(--primary);color:#fff}@media (prefers-reduced-motion:reduce){*,:after,:before{animation:none!important;transition:none!important}}html{scroll-padding-top:32px;touch-action:manipulation}body{line-break:strict;margin:0;overflow-wrap:anywhere;padding:0;word-break:normal;text-autospace:normal;accent-color:var(--primary)}body ::selection{background-color:rgba(50,35,179,.251)}@media (prefers-color-scheme:dark){body ::selection{background-color:rgba(126,112,254,.251)}}img{vertical-align:bottom}a{color:inherit;-webkit-text-decoration:none;text-decoration:none;-webkit-tap-highlight-color:rgba(0,0,0,.2)}@media (prefers-color-scheme:dark){a{-webkit-tap-highlight-color:rgba(255,255,255,.1)}}ul{padding:0}ul li{list-style:none}button{appearance:none;border:none;cursor:pointer}</style> <style>.language-glsl,.language-html,.language-js{background:var(--color-bg-code);color:#383a42;display:block;overflow-x:auto;padding:.5em}.hljs-comment,.hljs-quote{color:#666}.hljs-doctag,.hljs-formula,.hljs-keyword{color:#a626a4}.hljs-deletion,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-subst{color:#813b32}.hljs-literal{color:#005c7d}.hljs-addition,.hljs-attribute,.hljs-meta-string,.hljs-regexp,.hljs-string{color:#2f612f}.hljs-built_in,.hljs-class .hljs-title{color:#733801}.hljs-attr,.hljs-number,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-pseudo,.hljs-template-variable,.hljs-type,.hljs-variable{color:#7f5901}.hljs-bullet,.hljs-link,.hljs-meta,.hljs-selector-id,.hljs-symbol,.hljs-title{color:#3060bf}.hljs-strong{font-weight:700}.hljs-link{-webkit-text-decoration:underline;text-decoration:underline}</style> <style>@media (prefers-color-scheme:dark){.language-glsl,.language-html,.language-js{background:var(--color-bg-code);color:#abb2bf;display:block;overflow-x:auto;padding:.5em}.hljs-comment,.hljs-quote{color:#5c6370}.hljs-doctag,.hljs-formula,.hljs-keyword{color:#c678dd}.hljs-deletion,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-subst{color:#e06c75}.hljs-literal{color:#56b6c2}.hljs-addition,.hljs-attribute,.hljs-meta-string,.hljs-regexp,.hljs-string{color:#98c379}.hljs-built_in,.hljs-class .hljs-title{color:#e6c07b}.hljs-attr,.hljs-number,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-pseudo,.hljs-template-variable,.hljs-type,.hljs-variable{color:#d19a66}.hljs-bullet,.hljs-link,.hljs-meta,.hljs-selector-id,.hljs-symbol,.hljs-title{color:#61aeee}.hljs-strong{font-weight:700}.hljs-link{-webkit-text-decoration:underline;text-decoration:underline}}</style> <style>:root{--color-text-p:#404040;--color-text-p-secondary:#606060;--color-text-h:#202020;--color-bg:#eff2f5;--color-bg-code:#fff;--color-bg-footer:#f9f9f9;--color-bg-strong:#fff996;--color-bg-btn:#1976d2;--color-btn-secondary:#e0e0e0;--color-text-a:#1976d2;--color-text-a-hover:var(--primary);--color-text-a-visited:var(--color-text-a);--color-border:#0000001a;--primary:#3223b3;--font-sans:Helvetica Neue,Arial,Hiragino Sans,Hiragino Kaku Gothic ProN,BIZ UDPGothic,Meiryo,sans-serif;--font-mono:SFMono-Regular,Menlo,Consolas,Bitstream Vera Sans Mono,Courier New,Courier,BIZ UDGothic,Meiryo,monospace}@media (prefers-color-scheme:dark){:root{--color-text-p:#d0d0d0;--color-text-p-secondary:#a0a0a0;--color-text-h:#fff;--color-bg:#202020;--color-bg-code:#282c34;--color-bg-footer:#090909;--color-bg-strong:#7a0099;--color-text-a:#90caf9;--color-border:#d6d6d61a;--color-btn-secondary:#404040;--primary:#7e70fe}}@supports (-webkit-touch-callout:none) and (font:-apple-system-body){:root{font:-apple-system-body}}body{background-color:var(--color-bg);font-family:var(--font-sans)}iframe{border:none}.btn-primary{background-color:var(--primary);border-color:var(--primary);color:#fff}@media (min-width:768px){br.mobile{display:none}}@media (min-width:992px){br.tablet{display:none}}</style> <style>.ly-top-header[data-v-53af800e]{background-color:var(--color-bg);width:100%;z-index:1}@media print{.ly-top-header[data-v-53af800e]{position:static}}</style> <style>.mediaHeader[data-v-c016e82a]{border-bottom:1px solid var(--color-border);overflow:hidden;width:100%}.mediaHeader-row[data-v-c016e82a]{height:48px;margin:0 auto;max-width:960px;position:relative}@media (min-width:1200px){.mediaHeader-row[data-v-c016e82a]{max-width:1080px}}.mediaHeader-row h1[data-v-c016e82a]{left:50%;margin:0;position:absolute;top:50%;transform:translate(-50%,-50%)}.mediaHeader-row-tool[data-v-c016e82a]{align-items:center;display:flex;position:absolute;right:0;top:50%;transform:translateY(-50%)}.mediaHeader-row-tool a[data-v-c016e82a]{border-radius:6px;box-sizing:initial;color:var(--color-text-p);display:block;height:32px;padding:3px;-webkit-text-decoration:none;text-decoration:none;transition:background .2s}@media (any-hover:hover){.mediaHeader-row-tool a[data-v-c016e82a]:hover{background:#8080804d}}.mediaHeader-row-tool a[data-v-c016e82a]:active{background:#80808080}.mediaHeader-row-tool svg[data-v-c016e82a]{background:#0000;fill:#333}@media (prefers-color-scheme:dark){.mediaHeader-row-tool svg[data-v-c016e82a]{fill:#ccc}}.mediaHeader-row-tool-item[data-v-c016e82a]{margin-left:.5rem}</style> <style>a[data-v-39193113]{align-items:center;background-image:url(/_nuxt/logo-website.Cz5k_taM.png);background-position:50%;background-repeat:no-repeat;background-size:contain;display:flex;height:48px;width:144px}span[data-v-39193113]{visibility:hidden}</style> <style>nav[data-v-5ddcd2fd]{width:100%}.category-list[data-v-5ddcd2fd]{display:flex;justify-content:space-between;margin:0 auto;max-width:960px}@media (min-width:1200px){.category-list[data-v-5ddcd2fd]{max-width:1080px}}@media (max-width:767.98px){.category-list[data-v-5ddcd2fd]{overflow:auto}.category-list[data-v-5ddcd2fd]::-webkit-scrollbar{height:2px}.category-list[data-v-5ddcd2fd]::-webkit-scrollbar-track{border-radius:0}.category-list[data-v-5ddcd2fd]::-webkit-scrollbar-thumb{background-color:#80808080}}.category-list-item[data-v-5ddcd2fd]{flex:1}.category-list-item a[data-v-5ddcd2fd]{color:var(--color-text-p);display:block;font-feature-settings:"palt";font-size:.75rem;font-weight:700;padding:.5rem 1rem;text-align:center;-webkit-text-decoration:none;text-decoration:none;transition:color .2s,background .2s;-webkit-user-select:none;user-select:none;white-space:nowrap;word-break:keep-all}@media (any-hover:hover){.category-list-item a[data-v-5ddcd2fd]:hover{background:var(--primary);color:#fff}}.category-list-item a._current[data-v-5ddcd2fd],.category-list-item a[aria-current=page][data-v-5ddcd2fd]{background:var(--primary);color:#fff}@media (max-width:767.98px){.category-list-item a[data-v-5ddcd2fd]{font-size:.625rem;padding-left:.5rem;padding-right:.5rem}}</style> <style>.heroSpace[data-v-cb0dd5fc]{background:#000;height:256px;overflow:hidden;position:relative;width:100%}.heroSpace-title[data-v-cb0dd5fc]{align-items:center;color:#fff;display:flex;font-weight:400;height:100%;justify-content:center;position:absolute;text-align:center;width:100%}.heroSpace-title p[data-v-cb0dd5fc]{color:#fff;font-feature-settings:"palt";font-size:1rem;font-weight:400;letter-spacing:.01em;margin:0 auto 16px;max-width:1080px}@media (max-width:767.98px){.heroSpace-title p[data-v-cb0dd5fc]{padding-left:16px;padding-right:16px}}.heroSpace-title h1[data-v-cb0dd5fc]{font-feature-settings:"palt";font-size:2rem;font-weight:400;letter-spacing:2px;margin:0 auto;max-width:1080px}@media (max-width:767.98px){.heroSpace-title h1[data-v-cb0dd5fc]{font-size:1.5rem;padding-left:16px;padding-right:16px}}.heroSpace_padding[data-v-cb0dd5fc]{height:326px}@media (max-width:767.98px){.heroSpace_padding[data-v-cb0dd5fc]{height:212px}}.heroSpace_padding .heroSpace-title[data-v-cb0dd5fc]{align-items:center;display:flex;height:100%;justify-content:center;width:100%}.heroSpace iframe[data-v-cb0dd5fc]{height:100%;position:absolute;width:100%}</style> <style>.wbr[data-v-92dd477a]{display:inline-block}</style> <style>.top_link[data-v-da421125]{margin-bottom:64px;text-align:center}.entry-column[data-v-da421125]{display:flex;margin:0 auto;max-width:960px;width:100%}</style> <style>.site_updater[data-v-63cb43db]{background:var(--color-bg-footer);bottom:0;margin-top:20px;position:sticky}.site_updater p[data-v-63cb43db]{margin:0;padding:10px 0;text-align:center}.site_info[data-v-63cb43db]{background:var(--color-bg-footer);color:var(--color-text-p);padding:32px 0}@media (max-width:1199.98px){.site_info[data-v-63cb43db]{padding:32px 16px}}.site_info-sections[data-v-63cb43db]{display:grid;gap:32px;grid-template-columns:repeat(3,1fr);margin:0 auto;max-width:960px;width:100%}@media (max-width:991.98px){.site_info-sections[data-v-63cb43db]{gap:16px}}@media (max-width:767.98px){.site_info-sections[data-v-63cb43db]{grid-template-columns:1fr}}@media (min-width:1200px){.site_info-sections[data-v-63cb43db]{max-width:1080px}}.site_info-sections_item h3[data-v-63cb43db]{color:var(--color-text-h);font-size:1.5rem;font-weight:400;line-height:1;margin-bottom:16px}.site_info-sections_item p[data-v-63cb43db]{color:var(--color-text-p-secondary);font-size:.75rem;line-height:1.75;text-align:justify}.site_info-sections_item ul[data-v-63cb43db]{list-style-position:inside;padding:0 0 0 1rem}.site_info-sections_item ul li[data-v-63cb43db]{font-size:.75rem;line-height:1.75;list-style:circle}.site_info-sections_item a[data-v-63cb43db]{color:var(--color-text-p-secondary);-webkit-text-decoration:none;text-decoration:none;transition:color .2s}@media (any-hover:hover){.site_info-sections_item a[data-v-63cb43db]:hover{color:var(--color-text-a-hover)}}</style> <style>.copyright[data-v-4b34f398]{font-size:1rem;margin-top:32px;text-align:center}@media (min-width:768px){.copyright br.mobile[data-v-4b34f398]{display:none}}.raw-pages[data-v-4b34f398]{display:flex;font-size:.875rem;gap:24px;justify-content:center;margin-bottom:16px;margin-top:16px}@media (max-width:767.98px){.raw-pages[data-v-4b34f398]{flex-direction:column;gap:4px}}.raw-pages a[data-v-4b34f398]{color:var(--color-text-p-secondary);transition:color .2s}@media (any-hover:hover){.raw-pages a[data-v-4b34f398]:hover{color:var(--color-text-a-hover)}}</style> <style>.eyecatch[data-v-921b35f7]{overflow:hidden;position:relative}.eyecatch .eyecatch-blur-container[data-v-921b35f7]{height:100%;overflow:hidden;position:absolute;width:100%}.eyecatch .eyecatch-blur[data-v-921b35f7]{background-size:cover;content:"";filter:brightness(1.25) blur(64px);height:150%;left:-25%;position:absolute;top:-25%;width:150%}@media (max-width:991.98px){.eyecatch .eyecatch-blur[data-v-921b35f7]{display:none}}.eyecatch-inner[data-v-921b35f7]{margin:0 auto;position:relative}@media (min-width:1200px){.eyecatch-inner[data-v-921b35f7]{max-width:1080px}}@media (min-width:992px) and (max-width:1199.98px){.eyecatch-inner[data-v-921b35f7]{max-width:960px}}.eyecatch-inner-img[data-v-921b35f7]{view-transition-name:var(--0e97d286);aspect-ratio:1280/512;contain:paint;height:auto;object-fit:cover;width:100%}@media (max-width:767.98px){.eyecatch-inner-img[data-v-921b35f7]{aspect-ratio:1280/720}}</style> <style>@media (min-width:992px){.entry[data-v-49d92408]{display:flex;flex-direction:row;gap:32px;margin:0 auto}}.entry-article[data-v-49d92408]{margin:0 auto;max-width:720px}@media (min-width:992px) and (max-width:1199.98px){.entry-article[data-v-49d92408]{width:640px}}.entry-sidebar[data-v-49d92408]{flex:1}@media (max-width:991.98px){.entry-sidebar[data-v-49d92408]{display:none}}</style> <style>@charset "UTF-8";.article-date{color:var(--color-text-p-secondary);font-size:.8rem;margin:1rem 0;text-align:center}@media (max-width:767.98px){.article-date{padding:0 1rem}}.article-date a{color:currentcolor;-webkit-text-decoration:none;text-decoration:none;transition:color .2s}@media (any-hover:hover){.article-date a:hover{color:var(--color-text-a-hover)}}.article-date .article-date-slash{margin-left:.25rem;margin-right:.25rem}.article-tag{display:flex;flex-wrap:wrap;gap:8px 4px;justify-content:center;list-style:none;padding:0}.article-tag li{display:inline-block}.article-tag a{border:1px solid var(--color-text-p);border-radius:6px;color:var(--color-text-p);font-size:.75rem;padding:.2em .5em;-webkit-text-decoration:none;text-decoration:none;transition:color .2s,border .2s}@media (any-hover:hover){.article-tag a:hover{border:1px solid var(--color-text-a-hover);color:var(--color-text-a-hover);-webkit-text-decoration:none;text-decoration:none}}.article{color:var(--color-text-p);font-size:1rem;line-break:strict;line-height:200%;overflow-wrap:anywhere;word-break:normal}.article h3{color:var(--color-text-h);font-family:var(--font-sans);font-size:2rem;font-variant-east-asian:proportional-width;font-weight:400;letter-spacing:.025em;line-height:1.25;margin-bottom:.5em;margin-top:3em}@media (max-width:767.98px){.article h3{font-size:1.5rem}}.article h3:after{background-color:var(--color-border);content:"";display:block;height:1px;margin-top:.25rem}.article h4,.article h5{color:var(--color-text-h);font-family:var(--font-sans);font-variant-east-asian:proportional-width;font-weight:400;letter-spacing:.025em;margin-bottom:1em;margin-top:2em}.article h4{font-size:1.5rem}.article h5{font-size:1.25rem}.article h1,.article h6{background:red;color:#000}.article h1:before,.article h6:before{content:"(この見出しレベルはサポートされてません)"}.article p{text-align:left}.article p small{color:var(--color-text-p-secondary);font-size:.75em}.article p>a>img,.article p>img{height:auto;max-width:100%}@media (max-width:767.98px){.article p>a>img,.article p>img{margin-left:-1rem;margin-right:-1rem;max-width:none;width:100vw}.article p amp-youtube{margin-left:-1rem;margin-right:-1rem;max-width:100vw}}.article strong{background:linear-gradient(#0000 61%,var(--color-bg-strong) 0,var(--color-bg-strong) 0);font-weight:700}.article code{background-color:var(--color-bg-code);border-radius:.25rem;color:var(--color-text-p);font-family:var(--font-mono);padding:.2rem .4rem}@media (max-width:767.98px){.article{padding:0 1rem}}.article a{color:var(--color-text-a);-webkit-text-decoration:none;text-decoration:none}@media (any-hover:hover){.article a:hover{color:var(--color-text-a);-webkit-text-decoration:underline;text-decoration:underline}}.article a:visited{color:var(--color-text-a-visited)}.article a[target=_blank]:after{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0MCA0MCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOiMxOTc2ZDJ9PC9zdHlsZT48L2RlZnM+PHBhdGggZD0iTTI0LjU1IDB2M2gxMC4zM0wxNC40NCAyMy40NGwyLjEyIDIuMTJMMzcgNS4xMnYxMC4zNGgzVjB6IiBjbGFzcz0iY2xzLTEiLz48cGF0aCBkPSJNMzAgMzdIM1YxMGgxMVY3SDB2MzNoMzNWMjZoLTN6IiBjbGFzcz0iY2xzLTEiLz48L3N2Zz4=");background-repeat:no-repeat;content:"";display:inline-block;height:.7rem;margin:0 .25rem;width:.7rem}.article ol,.article ul{padding-inline-start:32px}.article li{list-style:inherit}.article>section>iframe{aspect-ratio:16/9;height:auto;width:100%}@media (max-width:767.98px){.article>section>iframe{margin-left:-1rem;margin-right:-1rem;max-width:none;width:100vw}}.article kbd{background-color:var(--color-bg-code);border-radius:4px;color:inherit;font-family:var(--font-mono);padding:.2rem .4rem;white-space:nowrap}.article blockquote{background:var(--color-bg-code);border-radius:6px;color:var(--color-text-p);margin:0;padding:1em}.article blockquote p{margin:0}.article pre{color:var(--color-text-p);font-family:var(--font-mono);font-size:.9rem;line-height:150%;overflow:auto;word-break:break-all;word-wrap:break-word;background:var(--color-bg-code);border-radius:5px}@media (max-width:767.98px){.article pre{font-size:.8rem;margin-left:-1rem;margin-right:-1rem}}.article code.hljs,.article pre>code{box-sizing:border-box;display:block;padding:20px;position:relative}.article code.hljs:before{background:var(--color-text-p);color:var(--color-bg);display:inline;font-size:.5rem;left:20px;line-height:1.25;padding:0 1em;position:absolute;top:0;-webkit-user-select:none;user-select:none}.article code.hljs.language-javascript:before,.article code.hljs.language-js:before{content:"JS"}.article code.hljs.language-json:before{content:"JSON"}.article code.hljs.language-xml:before{content:"XML"}.article code.hljs.language-html:before{content:"HTML"}.article code.hljs.language-css:before{content:"CSS"}.article code.hljs.language-scss:before{content:"SCSS"}.article code.hljs.language-ts:before,.article code.hljs.language-typescript:before{content:"TypeScript"}.article code.hljs.language-actionscript:before{content:"ActionScript 3.0"}.article code.hljs.language-cs:before{content:"C#"}.article code.hljs.language-bash:before{content:"コマンドライン"}.article code.hljs.language-swift:before{content:"Swift"}.article code.hljs.language-glsl:before{content:"GLSL"}.article code.hljs.language-vue:before{content:"Vue"}.breadcrumb{margin:5rem auto 1rem;max-width:1080px}@media (max-width:1199.98px){.breadcrumb{margin:0 1rem}}.breadcrumb ul{display:block;font-size:.9rem;list-style:none;overflow:hidden;padding:0;width:100%}.breadcrumb li{display:inline;word-break:break-all}.breadcrumb li:before{content:"/";margin:0 .5rem}.breadcrumb li:first-child:before{content:none}.breadcrumb li a{color:var(--color-text-p);-webkit-text-decoration:none;text-decoration:none}.breadcrumb li a:visited{color:currentcolor}@media (any-hover:hover){.breadcrumb li a:hover{color:var(--color-text-a-hover)}}.wrap{overflow:hidden}@media (min-width:768px){.wrap{margin:0 auto;max-width:720px}}.wrap_960{margin:0 auto}@media (min-width:1200px){.wrap_960{max-width:1080px}}@media (min-width:992px) and (max-width:1199.98px){.wrap_960{max-width:960px}}footer #copyright{font-size:.75rem;text-align:center}hr{border-color:var(--color-text-p);border-style:inset;border-width:1px;display:block;margin-block:.5em;margin-inline:auto;opacity:.5;overflow:hidden;unicode-bidi:isolate}table{font-size:.9rem;line-height:1.5;width:100%;word-break:break-all}table td,table th{border-top:1px solid var(--color-border);padding:.5rem .25rem;vertical-align:top}table thead th{border-bottom:1px solid var(--color-border);vertical-align:bottom}</style> <style>h2.article_title[data-v-3469d367]{color:var(--color-text-h);font-family:var(--font-sans);font-feature-settings:"palt";font-size:2rem;font-weight:700;letter-spacing:.005em;line-height:1.5;margin-left:auto;margin-right:auto;max-width:720px;text-align:center}@media (max-width:767.98px){h2.article_title[data-v-3469d367]{font-size:5vw;padding:0 .25rem}}h2.article_title[data-v-3469d367] strong{background:none;font-size:1.5em;font-weight:700}h2.article_title[data-v-3469d367] small{font-size:.75em;font-weight:inherit}h2.article_title[data-v-3469d367] span.wbr{display:inline-block}</style> <style>@media (max-width:767.98px){.article-date-item[data-v-d384dd23]{display:inline-block}}</style> <style>.sns-share[data-v-694562d6]{display:flex;gap:8px;justify-content:center;margin:1rem 0;text-align:center}.sns-share-badge[data-v-694562d6]{display:inline-block;font-size:12px;font-weight:700;line-height:1;margin-top:3px;padding:3px 6px;-webkit-user-select:none;user-select:none}.sns-share-btn[data-v-694562d6]{border-radius:6px;display:block;height:44px;transition:background-color .2s;width:44px}.sns-share-btn._x[data-v-694562d6]{background-color:#000;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' fill='none' viewBox='0 0 240 240'%3E%3Cpath fill='%23fff' d='m88.2 60.66 81.26 118.15h-18.04L70.16 60.66zm4.73-9H53.04l93.64 136.15h39.89zM132.54 109.25l49.7-57.59h-11.25l-43.44 50.33z'/%3E%3Cpath fill='%23fff' d='m105.36 127.72-52.32 60.62H64.3l46.05-53.36z'/%3E%3C/svg%3E");background-repeat:no-repeat;background-size:contain}@media (any-hover:hover){.sns-share-btn._x[data-v-694562d6]:hover{background-color:#111}}.sns-share-btn._facebook[data-v-694562d6]{background-color:#32529f;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='%23fff' d='M212 197h-37v60h37v176h70V257h50l5-60h-55v-33c0-14 3-20 17-20h38V83h-49c-52 0-76 23-76 67z'/%3E%3C/svg%3E");background-repeat:no-repeat;background-size:contain}@media (any-hover:hover){.sns-share-btn._facebook[data-v-694562d6]:hover{background-color:#2a4887}}.sns-share-btn._hatena[data-v-694562d6]{background-color:#00a4de;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 500 500'%3E%3Cpath fill='%23fff' d='M278.2 258.1q-13.6-15.2-37.8-17c14.4-3.9 24.8-9.6 31.4-17.3s9.8-17.8 9.8-30.7A55 55 0 0 0 275 166a48.8 48.8 0 0 0-19.2-18.6c-7.3-4-16-6.9-26.2-8.6s-28.1-2.4-53.7-2.4h-62.3v227.2h64.2q38.7 0 55.8-2.6c11.4-1.8 20.9-4.8 28.6-8.9a52.5 52.5 0 0 0 21.9-21.4c5.1-9.2 7.7-19.9 7.7-32.1 0-16.9-4.5-30.4-13.6-40.5m-107-71.4h13.3q23.1 0 31 5.2c5.3 3.5 7.9 9.5 7.9 18s-2.9 14-8.5 17.4-16.1 5-31.4 5h-12.3zM224 317c-6.1 3.7-16.5 5.5-31.1 5.5h-21.7V273h22.6c15 0 25.4 1.9 30.9 5.7s8.4 10.4 8.4 20-3 14.7-9.2 18.4zm133.6-10.9a28.8 28.8 0 1 0 28.8 28.8 28.8 28.8 0 0 0-28.8-28.8m-25-169.7h50v151.52h-50z'/%3E%3C/svg%3E");background-repeat:no-repeat;background-size:contain}@media (any-hover:hover){.sns-share-btn._hatena[data-v-694562d6]:hover{background-color:#0091c8}}</style> <style>.sidebar{position:sticky;top:32px}.sidebarList{background-color:var(--color-bg-content-static);border-radius:8px;font-size:.75rem;line-height:1.5;list-style:none;max-height:calc(100vh - 96px);overflow:auto;padding:16px;position:relative;--color-bg-content-static:#fff;--color-contents-shadow:#0003}@media (prefers-color-scheme:dark){.sidebarList{--color-bg-content-static:#303030;--color-contents-shadow:#0006}}.sidebarList:before{background-color:var(--color-border);content:"";height:calc(100% - 64px);position:absolute;top:32px;width:1px}.sidebarList_item{color:var(--color-text-p-secondary);font-weight:700;padding-left:16px;position:relative;word-break:auto-phrase}.sidebarList_item:before{background-color:var(--color-btn-secondary);border:3px solid var(--color-bg-content-static);border-radius:50%;content:"";height:6px;left:-5.5px;position:absolute;top:6px;transition:background-color .3s;width:6px}@media (any-hover:hover){.sidebarList_item:hover:before{background-color:var(--primary)}}.sidebarList_item>a{display:inline-block;padding:4px 0;position:relative;transition:color .3s;width:100%}.sidebarList_item__sub{font-size:.75rem;font-weight:400}.sidebarList_item__sub:before{height:4px;left:-4.5px;top:8px;width:4px}.sidebarList_item__sub>a{padding-left:1em}.sidebarList_item.is-active>a{color:var(--primary)}.sidebarList_item.is-active:before{background-color:var(--primary)}@media (any-hover:hover){.sidebarList_item>a:hover{color:var(--primary)}}</style> <style>.SnsButtons[data-v-b5cbd36c]{padding-bottom:32px;padding-top:32px}.SnsButtons-sns[data-v-b5cbd36c]{display:flex;flex-flow:row wrap;gap:16px;justify-content:center}.SnsButtons-head[data-v-b5cbd36c],.SnsButtons-top[data-v-b5cbd36c]{text-align:center}.btn-sm[data-v-b5cbd36c]{align-items:center;display:flex;font-size:.875rem;gap:8px;padding:.25rem .5rem}</style> <style>.author-info[data-v-9742c4dd]{display:flex;margin:32px auto;max-width:640px}@media (max-width:767.98px){.author-info[data-v-9742c4dd]{padding-left:16px;padding-right:16px}}.author-info .btn[data-v-9742c4dd]{border:1px solid #0000;border-radius:.25rem;cursor:pointer;display:inline-block;font-size:1rem;font-weight:400;line-height:1.25;padding:.5rem 1rem;text-align:center;transition:all .2s ease-in-out;-webkit-user-select:none;user-select:none;vertical-align:middle;white-space:nowrap}.author-info .btn[data-v-9742c4dd],.author-info .btn[data-v-9742c4dd]:active,.author-info .btn[data-v-9742c4dd]:hover{-webkit-text-decoration:none;text-decoration:none}.author-info .btn-x[data-v-9742c4dd]{align-items:center;display:inline-flex;font-size:.75rem;padding:.1em .25em .1em .1em}.author-info .btn-x svg[data-v-9742c4dd]{margin-right:.25rem}.author-avatar[data-v-9742c4dd]{margin-right:24px}.author-avatar img[data-v-9742c4dd]{border-radius:50%}.author-avatar._large img[data-v-9742c4dd]{height:128px;width:128px}.author-desc[data-v-9742c4dd]{line-height:1.75}.author-desc-name[data-v-9742c4dd]{color:var(--color-text-h);display:flex;font-size:1.25rem;margin:0}@media (min-width:768px){.author-desc-name[data-v-9742c4dd]{align-items:center;gap:16px}}@media (max-width:767.98px){.author-desc-name[data-v-9742c4dd]{flex-direction:column;gap:4px}}.author-desc-script[data-v-9742c4dd]{color:var(--color-text-p);font-size:.9rem}.author-desc-script[data-v-9742c4dd] a{color:var(--color-text-a)}@media (any-hover:hover){.author-desc-script[data-v-9742c4dd] a:hover{color:var(--color-text-a-hover)}}.author-desc-script[data-v-9742c4dd] a:visited{color:var(--color-text-a-visited)}.is-inview img[data-v-9742c4dd]{view-transition-name:var(--475ed944)}</style> <style>.banner-img[data-v-84d78e6a]{border-radius:6px;height:auto;width:100%}@media (max-width:767.98px){.banner-img[data-v-84d78e6a]{border-radius:0}}.banners ul[data-v-84d78e6a]{display:grid;gap:1rem;grid-template-columns:repeat(2,1fr);list-style:none;padding:0}@media (max-width:767.98px){.banners ul[data-v-84d78e6a]{grid-template-columns:repeat(1,1fr)}}@media (any-hover:hover){.banners a[data-v-84d78e6a]:hover{filter:brightness(1.2)}}</style> <style>.related[data-v-c7eaaedb]{margin:64px 0}.related-in[data-v-c7eaaedb]{margin:0 auto;max-width:960px}@media (min-width:1200px){.related-in[data-v-c7eaaedb]{max-width:1080px}}@media (max-width:1199.98px){.related-in[data-v-c7eaaedb]{padding:0 1rem}}.related-in-head[data-v-c7eaaedb]{color:var(--color-text-h);font-family:var(--font-sans);font-feature-settings:"palt";font-size:1.5rem;font-weight:400;text-align:center}.related-in-ul[data-v-c7eaaedb]{display:grid;gap:1rem;grid-template-columns:1fr 1fr 1fr 1fr;list-style:none;margin:0;padding:0}@media (max-width:767.98px){.related-in-ul[data-v-c7eaaedb]{grid-template-columns:repeat(auto-fill,minmax(145px,1fr))}}.related-in-ul-li-thumb[data-v-c7eaaedb]{border-radius:6px;margin:0 0 10px;position:relative;transition:all .2s}.related-in-ul-li-thumb-img[data-v-c7eaaedb]{border-radius:6px;height:auto;width:100%}.related-in-ul-li-thumb[data-v-c7eaaedb]:after{border:2px solid #0000;border-radius:6px;box-sizing:border-box;content:"";display:block;height:100%;left:0;pointer-events:none;position:absolute;top:0;transition:border-color .2s;width:100%}.related-in-ul-li-title[data-v-c7eaaedb]{font-size:.9rem;line-height:1.5;text-align:left}.related-in-ul li a[data-v-c7eaaedb]{color:var(--color-text-p);display:block;-webkit-text-decoration:none;text-decoration:none}@supports (word-break:auto-phrase){.related-in-ul li a[data-v-c7eaaedb]{word-break:auto-phrase}}@media (any-hover:hover){.related-in-ul li a[data-v-c7eaaedb]:hover{color:var(--color-text-a-hover)}.related-in-ul li a:hover .related-in-ul-li-thumb[data-v-c7eaaedb]:after{border-color:var(--primary)}.related-in-ul li a:hover .related-in-ul-li-title[data-v-c7eaaedb]{-webkit-text-decoration:none;text-decoration:none}}</style> <style>.header-breadcrumb[data-v-b934bba3]{background:var(--color-bg);container-type:inline-size;top:0;width:100%;z-index:10}.header-breadcrumb__inner[data-v-b934bba3]{font-size:.75rem;margin:0 auto;max-width:960px}@container (1200px <= width){.header-breadcrumb__inner[data-v-b934bba3]{max-width:1080px}}@media (max-width:991.98px){.header-breadcrumb__inner[data-v-b934bba3]{padding-left:16px;padding-right:16px}}.header-breadcrumb__inner ul[data-v-b934bba3]{margin:0;overflow:hidden;padding:0;width:100%}.header-breadcrumb__inner ul li[data-v-b934bba3]{color:#ccc;display:inline;line-height:36px;margin-right:.5em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header-breadcrumb__inner ul li a[data-v-b934bba3]{color:var(--color-text-p);line-height:inherit;-webkit-text-decoration:none;text-decoration:none;transition:all .3s}@media (any-hover:hover){.header-breadcrumb__inner ul li a[data-v-b934bba3]:hover{color:var(--color-text-a)}}.header-breadcrumb__inner ul li[data-v-b934bba3]:after{content:"/";margin-left:.5em}.header-breadcrumb__inner ul li[data-v-b934bba3]:last-child{margin-left:0}.header-breadcrumb__inner ul li[data-v-b934bba3]:last-child:after{content:""}.header-breadcrumb__inner ul li .date[data-v-b934bba3]{color:#888}.header-breadcrumb__inner nav[data-v-b934bba3]{line-height:36px;min-width:60px}@media (max-width:1199.98px){.header-breadcrumb__inner nav[data-v-b934bba3]{margin-right:10px}}</style> <link rel="stylesheet" href="/_nuxt/Logo.B08_Goey.css"> <link rel="stylesheet" href="/_nuxt/CopyrightFooter.QnetxqVn.css"> <link rel="stylesheet" href="/_nuxt/style.CY4FSRKp.css"> <link rel="stylesheet" href="/_nuxt/StaffItem.DNxbzzNe.css"> <link rel="modulepreload" as="script" crossorigin href="/_nuxt/C4Imxykg.js"> <link rel="modulepreload" as="script" crossorigin href="/_nuxt/Cd6wHYGO.js"> <link rel="modulepreload" as="script" crossorigin href="/_nuxt/xUjygnMF.js"> <link rel="modulepreload" as="script" crossorigin href="/_nuxt/C-0LdZH-.js"> <link rel="modulepreload" as="script" crossorigin href="/_nuxt/FJAmFW6U.js"> <link rel="modulepreload" as="script" crossorigin href="/_nuxt/DyrHuGZd.js"> <link rel="modulepreload" as="script" crossorigin href="/_nuxt/ZYJihW0Q.js"> <link rel="modulepreload" as="script" crossorigin href="/_nuxt/B_7PM-cJ.js"> <link rel="modulepreload" as="script" crossorigin href="/_nuxt/3M2JxWNy.js"> <link rel="modulepreload" as="script" crossorigin href="/_nuxt/DJSJ69I6.js"> <link rel="modulepreload" as="script" crossorigin href="/_nuxt/BTEVS__d.js"> <link rel="modulepreload" as="script" crossorigin href="/_nuxt/Bet3yIFP.js"> <link rel="modulepreload" as="script" crossorigin href="/_nuxt/wbuvRwaU.js"> <link rel="modulepreload" as="script" crossorigin href="/_nuxt/qDTQlHTA.js"> <link rel="modulepreload" as="script" crossorigin href="/_nuxt/DVQ_T6w8.js"> <link rel="modulepreload" as="script" crossorigin href="/_nuxt/DU2oTVfN.js"> <link rel="modulepreload" as="script" crossorigin href="/_nuxt/vHY6b5TH.js"> <link rel="dns-prefetch" href="https://ics-creative.github.io"> <link rel="prefetch" as="image" type="image/png" href="/_nuxt/logo-website.Cz5k_taM.png"> <meta name="referrer" content="unsafe-url"> <meta name="format-detection" content="telephone=no"> <meta name="author" content="株式会社ICS"> <meta name="color-scheme" content="light dark"> <meta name="theme-color" content="#eff2f5" media="(prefers-color-scheme: light)"> <meta name="theme-color" content="#202020" media="(prefers-color-scheme: dark)"> <meta name="apple-mobile-web-app-title" content="ICS MEDIA"> <meta name="apple-mobile-web-app-status-bar-style" content="default"> <link rel="icon" href="/_assets/icons/favicon.png"> <link rel="apple-touch-icon" href="/_assets/icons/apple-touch-icon.png"> <link rel="alternate" type="application/rss+xml" href="/feed/atom.xml"> <link rel="manifest" href="/_assets/manifest_static.json"> <link rel="author" href="http://www.hatena.ne.jp/ics-media/"> <meta name="description" content="見出しなどのテキストを目立たせたいときに便利なフキダシ(吹き出し)。この記事では、HTMLとCSSだけで簡単に実装できる、シンプルなデザインのフキダシをご紹介します。雑誌やポスターなどで見かける可愛いあしらいをウェブサイトにも取り入れたいと思ったことが、今回のテーマを選んだきっかけです。"> <meta property="article:author" content="https://www.facebook.com/icswebjp"> <meta property="fb:pages" content="1414915712086775"> <meta property="og:locale" content="ja_JP"> <meta property="og:type" content="website"> <meta property="og:title" content="HTML・CSSで実装するかわいいフキダシのアイデア - ICS MEDIA"> <meta property="og:description" content="見出しなどのテキストを目立たせたいときに便利なフキダシ(吹き出し)。この記事では、HTMLとCSSだけで簡単に実装できる、シンプルなデザインのフキダシをご紹介します。雑誌やポスターなどで見かける可愛いあしらいをウェブサイトにも取り入れたいと思ったことが、今回のテーマを選んだきっかけです。"> <meta property="og:url" content="https://ics.media/entry/240425/"> <meta property="og:site_name" content="ICS MEDIA"> <meta property="og:image" content="https://ics.media/entry/240425/images/240425_eyecatch.jpg"> <meta name="twitter:card" content="summary_large_image"> <meta name="twitter:description" content="見出しなどのテキストを目立たせたいときに便利なフキダシ(吹き出し)。この記事では、HTMLとCSSだけで簡単に実装できる、シンプルなデザインのフキダシをご紹介します。雑誌やポスターなどで見かける可愛いあしらいをウェブサイトにも取り入れたいと思ったことが、今回のテーマを選んだきっかけです。"> <meta name="twitter:title" content="HTML・CSSで実装するかわいいフキダシのアイデア - ICS MEDIA"> <meta name="twitter:image" content="https://ics.media/entry/240425/images/240425_eyecatch.jpg"> <meta name="twitter:site" content="@icsweb"> <meta property="article:published_time" content="2024-04-25T00:00:00+09:00"> <meta property="article:modified_time" content="2024-05-31T00:00:00+09:00"> <meta property="og:updated_time" content="2024-05-31T00:00:00+09:00"> <meta name="date" content="2024-05-31T00:00:00+09:00"> <meta name="robots" content="max-image-preview:large"> <link rel="canonical" href="https://ics.media/entry/240425/"> <script type="application/ld+json">{"@context":"http://schema.org","@type":"BlogPosting","mainEntityOfPage":{"@type":"WebPage","@id":"https://ics.media/entry/240425/"},"headline":"HTML・CSSで実装するかわいいフキダシのアイデア","image":{"@type":"ImageObject","url":"/entry/240425/images/240425_eyecatch.jpg","height":512,"width":1280},"datePublished":"2024-04-25","dateModified":"2024-05-31","author":{"@type":"Organization","name":"株式会社ICS"},"publisher":{"@type":"Organization","name":"株式会社ICS","logo":{"@type":"ImageObject","url":"/_assets/icons/apple-touch-icon.png","width":512,"height":512}},"description":""}</script> <script type="module" src="/_nuxt/C4Imxykg.js" crossorigin></script></head><body><div id="__nuxt"><div class="ly-top" data-v-53af800e><div class="ly-top-header" data-v-53af800e><div class="mediaHeader" data-v-53af800e data-v-c016e82a><div class="mediaHeader-row" data-v-c016e82a><h1 data-v-c016e82a><a href="/" class="" title="ICS MEDIA" data-v-c016e82a data-v-39193113><span data-v-39193113>ICS MEDIA</span></a></h1><div class="mediaHeader-row-tool" data-v-c016e82a><span class="mediaHeader-row-tool-item mediaHeader-row-tool-item_search" data-v-c016e82a><a href="/entry/search/" class="" title="サイト内を検索する" data-v-c016e82a><svg width="32" height="32" viewBox="0 0 24 24" data-v-c016e82a><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z" data-v-c016e82a></path><path d="M0 0h24v24H0z" fill="none" data-v-c016e82a></path></svg></a></span></div></div></div><nav class="category" categoryid data-v-53af800e data-v-5ddcd2fd><ul class="category-list" data-v-5ddcd2fd><!--[--><li class="category-list-item" data-v-5ddcd2fd><a href="/entry/category/design/" class="" data-v-5ddcd2fd>UIデザイナー</a></li><li class="category-list-item" data-v-5ddcd2fd><a href="/entry/category/html5/" class="" data-v-5ddcd2fd>HTMLコーダー</a></li><li class="category-list-item" data-v-5ddcd2fd><a href="/entry/category/frontend/" class="" data-v-5ddcd2fd>フロントエンジニア</a></li><li class="category-list-item" data-v-5ddcd2fd><a href="/entry/category/creative/" class="" data-v-5ddcd2fd>クリエイティブコーダー</a></li><li class="category-list-item" data-v-5ddcd2fd><a href="/entry/category/3d/" class="" data-v-5ddcd2fd>3Dデベロッパー</a></li><!--]--></ul></nav></div><div itemscope itemtype="http://schema.org/Article" style="display:none;" data-v-53af800e data-v-cb0dd5fc><div class="heroSpace_padding heroSpace" data-v-cb0dd5fc><iframe src="/_assets/top_hero/archives.html" width="100%" height="100%" tabindex="-1" aria-hidden="true" loading="lazy" data-v-cb0dd5fc></iframe><div class="heroSpace-title" data-v-cb0dd5fc><header data-v-cb0dd5fc><p data-v-cb0dd5fc><!--[--><!--]--></p><h1 itemprop="name" data-v-cb0dd5fc><!--[--><!--]--></h1></header></div></div></div><!--[--><div data-v-da421125><div class="eyecatch" data-v-da421125 style="--0e97d286:eyecatch-240425;" data-v-921b35f7><div class="eyecatch-blur-container" data-v-921b35f7><img class="eyecatch-blur" fetchpriority="high" src="/entry/240425/images/240425_eyecatch.jpg" width="1280" height="512" alt="" data-v-921b35f7></div><div class="eyecatch-inner" data-v-921b35f7><img src="/entry/240425/images/240425_eyecatch.jpg" alt="" width="1280" height="512" class="eyecatch-inner-img" fetchpriority="high" data-v-921b35f7></div></div><main class="wrap_960" data-v-da421125 data-v-49d92408><article data-v-49d92408><h2 class="article_title" data-v-49d92408 data-v-3469d367>HTML・CSSで実装する<br>かわいいフキダシのアイデア</h2><div class="article-date" data-v-49d92408><!--[--><meta itemProp="datePublished" content="2024-04-25" data-v-d384dd23><span class="article-date-item" data-v-d384dd23><time itemProp="dateModified" dateTime="2024-05-31" title="2024年4月25日に公開" data-v-d384dd23>2024年5月31日</time> 更新</span><!--]--><span class="article-date-item article-date-slash" data-v-49d92408> / </span><a href="/entry/staff/iwama/" class="article-date-item" data-v-49d92408>株式会社ICS 岩間 日菜</a></div><ul class="article-tag" data-v-49d92408><!--[--><li data-v-49d92408><a href="/entry/tag/CSS/" class="" data-v-49d92408>CSS</a></li><!--]--></ul><div class="sns-share" data-v-49d92408 data-v-694562d6><div data-v-694562d6><a href="https://twitter.com/intent/tweet?url=https://ics.media/entry/240425/&text=HTML・CSSで実装するかわいいフキダシのアイデア - ICS MEDIA" class="sns-share-btn _x" target="_blank" title="X(旧Twitter)でシェア" data-v-694562d6></a><span class="sns-share-badge" data-v-694562d6></span></div><div data-v-694562d6><a class="sns-share-btn _hatena" href="https://b.hatena.ne.jp/entry/s/ics.media/entry/240425/" target="_blank" title="はてなブックマークでブックマーク" data-v-694562d6></a><span class="sns-share-badge" data-v-694562d6>216</span></div></div><div class="entry" data-v-49d92408><div class="entry-article article" data-v-49d92408><section data-v-49d92408><p>見出しなどのテキストを目立たせたいときに便利な<strong>フキダシ(吹き出し)</strong>。 この記事では、HTMLとCSSだけで簡単に実装できる、シンプルなデザインのフキダシをご紹介します。</p> <p>雑誌やポスターなどで見かける可愛いあしらいをウェブサイトにも取り入れたいと思ったことが、今回のテーマを選んだきっかけです。 とくにフキダシは、少ないコードで表現でき、見出しなどのテキストに華やかな印象を与えられます。 ウェブサイトを制作する際に、ぜひ取り入れてみてください。</p> <p>また、この記事のほとんどの作例で、CSSの疑似要素『<code>::before</code>』と『<code>::after</code>』を利用しています。 疑似要素を使うと、不要なHTMLタグを増やさずにCSSで装飾できます。</p> <ul> <li><code>::before</code> = 選択した要素の最初の子要素として疑似要素を生成</li> <li><code>::after</code> = 選択した要素の最後の子要素として疑似要素を生成</li> </ul> <p>これらは、要素に装飾的な内容を追加するために用いられることがよくあります。</p> <h3 id="1.-%E7%B7%9A%E3%81%A8%E4%BD%99%E7%99%BD%E3%82%92%E6%B4%BB%E7%94%A8%E3%81%97%E3%81%9F%E3%83%95%E3%82%AD%E3%83%80%E3%82%B7" tabindex="-1">1. 線と余白を活用したフキダシ</h3> <h4 id="1-1-%E7%B7%9A%E5%8D%8A%E5%88%86%E3%81%AE%E3%83%95%E3%82%AD%E3%83%80%E3%82%B7" tabindex="-1">1-1 線半分のフキダシ</h4> <p>下半分のみに枠のあるフキダシ。 <code>border</code>を<code>top</code>のみ削除し、左下と右下に角丸(<code>border-radius</code>)を指定することで実装しています。</p> <p>ナナメの線は<code>::after</code>疑似要素で描いています。ここでは、<code>box-shadow</code>に背景色と同じ色を指定することで、線が途切れたような表現をしています。</p> <iframe loading="lazy" width="960" height="540" sandbox="allow-scripts allow-same-origin" src="https://ics-creative.github.io/240425_fukidashi/01-01/"></iframe> <ul> <li><a href="https://ics-creative.github.io/240425_fukidashi/01-01/" target="_blank">サンプルを別ウインドウで開く</a></li> <li><a href="https://github.com/ics-creative/240425_fukidashi/tree/main/01-01/index.html" target="_blank">ソースコードを確認する</a></li> </ul> <p>▼ HTML</p> <pre><code class="hljs language-html"><span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"fukidashi-01-01"</span>></span> <span class="hljs-tag"><<span class="hljs-name">div</span>></span>かわいいフキダシ<span class="hljs-tag"></<span class="hljs-name">div</span>></span> <span class="hljs-tag"></<span class="hljs-name">div</span>></span> </code></pre> <p>▼ CSS</p> <pre><code class="hljs language-css"><span class="hljs-selector-class">.fukidashi-01-01</span> { <span class="hljs-attribute">position</span>: relative; <span class="hljs-attribute">width</span>: fit-content; <span class="hljs-attribute">padding</span>: <span class="hljs-number">12px</span> <span class="hljs-number">16px</span>; } <span class="hljs-selector-class">.fukidashi-01-01</span><span class="hljs-selector-pseudo">::before</span> { <span class="hljs-attribute">content</span>: <span class="hljs-string">""</span>; <span class="hljs-attribute">position</span>: absolute; <span class="hljs-attribute">bottom</span>: -<span class="hljs-number">6px</span>; <span class="hljs-attribute">left</span>: <span class="hljs-number">50%</span>; <span class="hljs-attribute">width</span>: <span class="hljs-number">100%</span>; <span class="hljs-attribute">height</span>: <span class="hljs-number">50%</span>; <span class="hljs-attribute">box-sizing</span>: border-box; <span class="hljs-attribute">border</span>: <span class="hljs-number">2px</span> solid <span class="hljs-number">#333333</span>; <span class="hljs-attribute">border-top</span>: none; <span class="hljs-attribute">border-bottom-right-radius</span>: <span class="hljs-number">50px</span>; <span class="hljs-comment">/* 左下の角丸 */</span> <span class="hljs-attribute">border-bottom-left-radius</span>: <span class="hljs-number">50px</span>; <span class="hljs-comment">/* 右下の角丸 */</span> <span class="hljs-attribute">translate</span>: -<span class="hljs-number">50%</span>; } <span class="hljs-selector-class">.fukidashi-01-01</span><span class="hljs-selector-pseudo">::after</span> { <span class="hljs-attribute">content</span>: <span class="hljs-string">""</span>; <span class="hljs-attribute">position</span>: absolute; <span class="hljs-attribute">top</span>: <span class="hljs-built_in">calc</span>(<span class="hljs-number">100%</span> + <span class="hljs-number">8px</span>); <span class="hljs-comment">/* フキダシのサイズに応じて調整してください */</span> <span class="hljs-attribute">left</span>: <span class="hljs-number">50%</span>; <span class="hljs-attribute">width</span>: <span class="hljs-number">30px</span>; <span class="hljs-attribute">height</span>: <span class="hljs-number">2px</span>; <span class="hljs-attribute">box-sizing</span>: border-box; <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#333333</span>; <span class="hljs-attribute">box-shadow</span>: <span class="hljs-number">0</span> <span class="hljs-number">2px</span> <span class="hljs-number">0</span> <span class="hljs-number">#ffffff</span>, <span class="hljs-number">0</span> -<span class="hljs-number">2px</span> <span class="hljs-number">0</span> <span class="hljs-number">#ffffff</span>; <span class="hljs-attribute">rotate</span>: <span class="hljs-number">50deg</span>; <span class="hljs-attribute">translate</span>: -<span class="hljs-number">50%</span>; } </code></pre> <h4 id="1-2-%E4%B8%8B%E7%B7%9A-%2B-%E7%B7%9A%E3%81%AE%E3%83%95%E3%82%AD%E3%83%80%E3%82%B7" tabindex="-1">1-2 下線 + 線のフキダシ</h4> <p>下線のみのフキダシ。 <code>::after</code>疑似要素でナナメの線を描画し、フキダシの枠部分に重ねています。</p> <iframe loading="lazy" width="960" height="540" sandbox="allow-scripts allow-same-origin" src="https://ics-creative.github.io/240425_fukidashi/01-02/"></iframe> <ul> <li><a href="https://ics-creative.github.io/240425_fukidashi/01-02/" target="_blank">サンプルを別ウインドウで開く</a></li> <li><a href="https://github.com/ics-creative/240425_fukidashi/tree/main/01-02/index.html" target="_blank">ソースコードを確認する</a></li> </ul> <p>▼ HTML</p> <pre><code class="hljs language-html"><span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"fukidashi-01-02"</span>></span> <span class="hljs-tag"><<span class="hljs-name">div</span>></span>かわいいフキダシ<span class="hljs-tag"></<span class="hljs-name">div</span>></span> <span class="hljs-tag"></<span class="hljs-name">div</span>></span> </code></pre> <p>▼ CSS</p> <pre><code class="hljs language-css"><span class="hljs-selector-class">.fukidashi-01-02</span> { <span class="hljs-attribute">position</span>: relative; <span class="hljs-attribute">width</span>: fit-content; <span class="hljs-attribute">padding</span>: <span class="hljs-number">12px</span> <span class="hljs-number">16px</span>; <span class="hljs-attribute">border-bottom</span>: <span class="hljs-number">2px</span> solid <span class="hljs-number">#333333</span>; } <span class="hljs-selector-class">.fukidashi-01-02</span><span class="hljs-selector-pseudo">::after</span> { <span class="hljs-attribute">content</span>: <span class="hljs-string">""</span>; <span class="hljs-attribute">position</span>: absolute; <span class="hljs-attribute">top</span>: <span class="hljs-built_in">calc</span>(<span class="hljs-number">100%</span> + <span class="hljs-number">5px</span>); <span class="hljs-attribute">left</span>: <span class="hljs-number">50%</span>; <span class="hljs-attribute">width</span>: <span class="hljs-number">30px</span>; <span class="hljs-attribute">height</span>: <span class="hljs-number">2px</span>; <span class="hljs-attribute">box-sizing</span>: border-box; <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#333333</span>; <span class="hljs-attribute">box-shadow</span>: <span class="hljs-number">0</span> <span class="hljs-number">2px</span> <span class="hljs-number">0</span> <span class="hljs-number">#ffffff</span>, <span class="hljs-number">0</span> -<span class="hljs-number">2px</span> <span class="hljs-number">0</span> <span class="hljs-number">#ffffff</span>; <span class="hljs-attribute">rotate</span>: <span class="hljs-number">50deg</span>; <span class="hljs-attribute">translate</span>: -<span class="hljs-number">25%</span>; } </code></pre> <h4 id="1-3-%E4%B8%8B%E7%B7%9A-%2B-%E4%B8%89%E8%A7%92%E3%81%A4%E3%81%BE%E3%81%BF%E3%81%AE%E3%83%95%E3%82%AD%E3%83%80%E3%82%B7" tabindex="-1">1-3 下線 + 三角つまみのフキダシ</h4> <p>下線の中央に三角のつまみをつけたフキダシ。 <code>::after</code>疑似要素でつまみ部分を描画しています。 さらにその上に背景と同じ色の<code>::before</code>疑似要素を重ねることで、不要な線を隠しています。</p> <iframe loading="lazy" width="960" height="540" sandbox="allow-scripts allow-same-origin" src="https://ics-creative.github.io/240425_fukidashi/01-03/"></iframe> <ul> <li><a href="https://ics-creative.github.io/240425_fukidashi/01-03/" target="_blank">サンプルを別ウインドウで開く</a></li> <li><a href="https://github.com/ics-creative/240425_fukidashi/tree/main/01-03/index.html" target="_blank">ソースコードを確認する</a></li> </ul> <p>▼ HTML</p> <pre><code class="hljs language-html"><span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"fukidashi-01-03"</span>></span> <span class="hljs-tag"><<span class="hljs-name">div</span>></span>かわいいフキダシ<span class="hljs-tag"></<span class="hljs-name">div</span>></span> <span class="hljs-tag"></<span class="hljs-name">div</span>></span> </code></pre> <p>▼ CSS</p> <pre><code class="hljs language-css"><span class="hljs-selector-class">.fukidashi-01-03</span> { <span class="hljs-attribute">position</span>: relative; <span class="hljs-attribute">width</span>: fit-content; <span class="hljs-attribute">padding</span>: <span class="hljs-number">12px</span> <span class="hljs-number">16px</span>; <span class="hljs-attribute">border-bottom</span>: <span class="hljs-number">2px</span> solid <span class="hljs-number">#333333</span>; <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#ffffff</span>; } <span class="hljs-selector-class">.fukidashi-01-03</span><span class="hljs-selector-pseudo">::before</span> { <span class="hljs-attribute">content</span>: <span class="hljs-string">""</span>; <span class="hljs-attribute">position</span>: absolute; <span class="hljs-attribute">bottom</span>: -<span class="hljs-number">5px</span>; <span class="hljs-attribute">left</span>: <span class="hljs-number">50%</span>; <span class="hljs-attribute">width</span>: <span class="hljs-number">15px</span>; <span class="hljs-attribute">height</span>: <span class="hljs-number">15px</span>; <span class="hljs-attribute">box-sizing</span>: border-box; <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#ffffff</span>; <span class="hljs-comment">/* 背景色と同じ色を指定 */</span> <span class="hljs-attribute">rotate</span>: <span class="hljs-number">135deg</span>; <span class="hljs-attribute">translate</span>: -<span class="hljs-number">50%</span>; } <span class="hljs-selector-class">.fukidashi-01-03</span><span class="hljs-selector-pseudo">::after</span> { <span class="hljs-attribute">content</span>: <span class="hljs-string">""</span>; <span class="hljs-attribute">position</span>: absolute; <span class="hljs-attribute">bottom</span>: -<span class="hljs-number">8px</span>; <span class="hljs-attribute">left</span>: <span class="hljs-number">50%</span>; <span class="hljs-attribute">z-index</span>: -<span class="hljs-number">1</span>; <span class="hljs-attribute">width</span>: <span class="hljs-number">15px</span>; <span class="hljs-attribute">height</span>: <span class="hljs-number">15px</span>; <span class="hljs-attribute">box-sizing</span>: border-box; <span class="hljs-attribute">border</span>: <span class="hljs-number">2px</span> solid; <span class="hljs-attribute">border-color</span>: <span class="hljs-number">#333333</span> <span class="hljs-number">#333333</span> transparent transparent; <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#ffffff</span>; <span class="hljs-attribute">rotate</span>: <span class="hljs-number">135deg</span>; <span class="hljs-attribute">translate</span>: -<span class="hljs-number">50%</span>; } </code></pre> <h4 id="1-4-%E4%B8%8B%E7%B7%9A-%2B-%E7%B7%9A%EF%BC%88%E9%9A%99%E9%96%93%E3%81%82%E3%82%8A%EF%BC%89%E3%81%AE%E3%83%95%E3%82%AD%E3%83%80%E3%82%B7" tabindex="-1">1-4 下線 + 線(隙間あり)のフキダシ</h4> <p>下線のみのフキダシ。 背景と同じ色の<code>::before</code>疑似要素を下線に重ねることで、隙間が空いているようなデザインを表現しています。</p> <iframe loading="lazy" width="960" height="540" sandbox="allow-scripts allow-same-origin" src="https://ics-creative.github.io/240425_fukidashi/01-04/"></iframe> <ul> <li><a href="https://ics-creative.github.io/240425_fukidashi/01-04/" target="_blank">サンプルを別ウインドウで開く</a></li> <li><a href="https://github.com/ics-creative/240425_fukidashi/tree/main/01-04/index.html" target="_blank">ソースコードを確認する</a></li> </ul> <p>▼ HTML</p> <pre><code class="hljs language-html"><span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"fukidashi-01-04"</span>></span> <span class="hljs-tag"><<span class="hljs-name">div</span>></span>かわいいフキダシ<span class="hljs-tag"></<span class="hljs-name">div</span>></span> <span class="hljs-tag"></<span class="hljs-name">div</span>></span> </code></pre> <p>▼ CSS</p> <pre><code class="hljs language-css"><span class="hljs-selector-class">.fukidashi-01-04</span> { <span class="hljs-attribute">position</span>: relative; <span class="hljs-attribute">width</span>: fit-content; <span class="hljs-attribute">padding</span>: <span class="hljs-number">12px</span> <span class="hljs-number">16px</span>; <span class="hljs-attribute">border-bottom</span>: <span class="hljs-number">2px</span> solid <span class="hljs-number">#333333</span>; <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#ffffff</span>; } <span class="hljs-selector-class">.fukidashi-01-04</span><span class="hljs-selector-pseudo">::before</span> { <span class="hljs-attribute">content</span>: <span class="hljs-string">""</span>; <span class="hljs-attribute">position</span>: absolute; <span class="hljs-attribute">bottom</span>: -<span class="hljs-number">5px</span>; <span class="hljs-attribute">left</span>: <span class="hljs-number">50%</span>; <span class="hljs-attribute">width</span>: <span class="hljs-number">15px</span>; <span class="hljs-attribute">height</span>: <span class="hljs-number">15px</span>; <span class="hljs-attribute">box-sizing</span>: border-box; <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#ffffff</span>; <span class="hljs-comment">/* 背景色と同じ色を指定 */</span> <span class="hljs-attribute">rotate</span>: <span class="hljs-number">135deg</span>; <span class="hljs-attribute">translate</span>: -<span class="hljs-number">50%</span>; } <span class="hljs-selector-class">.fukidashi-01-04</span><span class="hljs-selector-pseudo">::after</span> { <span class="hljs-attribute">content</span>: <span class="hljs-string">""</span>; <span class="hljs-attribute">position</span>: absolute; <span class="hljs-attribute">top</span>: <span class="hljs-built_in">calc</span>(<span class="hljs-number">100%</span> + <span class="hljs-number">5px</span>); <span class="hljs-attribute">left</span>: <span class="hljs-built_in">calc</span>(<span class="hljs-number">50%</span> - <span class="hljs-number">4px</span>); <span class="hljs-attribute">z-index</span>: -<span class="hljs-number">1</span>; <span class="hljs-attribute">width</span>: <span class="hljs-number">30px</span>; <span class="hljs-attribute">height</span>: <span class="hljs-number">2px</span>; <span class="hljs-attribute">transform</span>: <span class="hljs-built_in">rotate</span>(<span class="hljs-number">50deg</span>); <span class="hljs-attribute">box-sizing</span>: border-box; <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#333333</span>; <span class="hljs-attribute">box-shadow</span>: <span class="hljs-number">0</span> <span class="hljs-number">2px</span> <span class="hljs-number">0</span> <span class="hljs-number">#ffffff</span>, <span class="hljs-number">0</span> -<span class="hljs-number">2px</span> <span class="hljs-number">0</span> <span class="hljs-number">#ffffff</span>; <span class="hljs-comment">/* 背景色と同じ色を指定 */</span> } </code></pre> <h4 id="1-5-%E4%B8%8B%E7%B7%9A-%2B-%E7%B7%9A-%2B-%E3%83%9D%E3%82%A4%E3%83%B3%E3%83%88%E3%81%AE%E3%83%95%E3%82%AD%E3%83%80%E3%82%B7" tabindex="-1">1-5 下線 + 線 + ポイントのフキダシ</h4> <p>下線のみのフキダシ。 <code>::after</code>疑似要素で、線の伸びた先に黒丸を配置しています。</p> <iframe loading="lazy" width="960" height="540" sandbox="allow-scripts allow-same-origin" src="https://ics-creative.github.io/240425_fukidashi/01-05/"></iframe> <ul> <li><a href="https://ics-creative.github.io/240425_fukidashi/01-05/" target="_blank">サンプルを別ウインドウで開く</a></li> <li><a href="https://github.com/ics-creative/240425_fukidashi/tree/main/01-05/index.html" target="_blank">ソースコードを確認する</a></li> </ul> <p>▼ HTML</p> <pre><code class="hljs language-html"><span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"fukidashi-01-05"</span>></span> <span class="hljs-tag"><<span class="hljs-name">div</span>></span>かわいいフキダシ<span class="hljs-tag"></<span class="hljs-name">div</span>></span> <span class="hljs-tag"></<span class="hljs-name">div</span>></span> </code></pre> <p>▼ CSS</p> <pre><code class="hljs language-css"><span class="hljs-selector-class">.fukidashi-01-05</span> { <span class="hljs-attribute">position</span>: relative; <span class="hljs-attribute">width</span>: fit-content; <span class="hljs-attribute">padding</span>: <span class="hljs-number">12px</span> <span class="hljs-number">16px</span>; <span class="hljs-attribute">border-bottom</span>: <span class="hljs-number">2px</span> solid <span class="hljs-number">#333333</span>; } <span class="hljs-selector-class">.fukidashi-01-05</span><span class="hljs-selector-pseudo">::before</span> { <span class="hljs-attribute">content</span>: <span class="hljs-string">""</span>; <span class="hljs-attribute">position</span>: absolute; <span class="hljs-attribute">right</span>: -<span class="hljs-number">24px</span>; <span class="hljs-attribute">bottom</span>: -<span class="hljs-number">13px</span>; <span class="hljs-attribute">width</span>: <span class="hljs-number">30px</span>; <span class="hljs-attribute">height</span>: <span class="hljs-number">2px</span>; <span class="hljs-attribute">transform</span>: <span class="hljs-built_in">rotate</span>(<span class="hljs-number">50deg</span>); <span class="hljs-attribute">box-sizing</span>: border-box; <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#333333</span>; } <span class="hljs-selector-class">.fukidashi-01-05</span><span class="hljs-selector-pseudo">::after</span> { <span class="hljs-attribute">content</span>: <span class="hljs-string">""</span>; <span class="hljs-attribute">position</span>: absolute; <span class="hljs-attribute">right</span>: -<span class="hljs-number">23px</span>; <span class="hljs-attribute">bottom</span>: -<span class="hljs-number">28px</span>; <span class="hljs-attribute">width</span>: <span class="hljs-number">8px</span>; <span class="hljs-attribute">height</span>: <span class="hljs-number">8px</span>; <span class="hljs-attribute">box-sizing</span>: border-box; <span class="hljs-attribute">border</span>: <span class="hljs-number">1px</span> solid <span class="hljs-number">#ffffff</span>; <span class="hljs-comment">/* 背景色と同じ色を指定 */</span> <span class="hljs-attribute">border-radius</span>: <span class="hljs-number">50%</span>; <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#333333</span>; } </code></pre> <h4 id="1-6-%E6%9E%A0-%2B-%E4%B8%89%E8%A7%92%E3%81%A4%E3%81%BE%E3%81%BF%E3%81%AE%E3%83%95%E3%82%AD%E3%83%80%E3%82%B7" tabindex="-1">1-6 枠 + 三角つまみのフキダシ</h4> <p>下線の中央に三角のつまみをつけた四角いフキダシ。 1-3と同様に、<code>::after</code>疑似要素でつまみ部分を描画しています。 さらにその上に背景と同じ色の<code>::before</code>疑似要素を重ねることで、不要な線を隠しています。</p> <iframe loading="lazy" width="960" height="540" sandbox="allow-scripts allow-same-origin" src="https://ics-creative.github.io/240425_fukidashi/01-06/"></iframe> <ul> <li><a href="https://ics-creative.github.io/240425_fukidashi/01-06/" target="_blank">サンプルを別ウインドウで開く</a></li> <li><a href="https://github.com/ics-creative/240425_fukidashi/tree/main/01-06/index.html" target="_blank">ソースコードを確認する</a></li> </ul> <p>▼ HTML</p> <pre><code class="hljs language-html"><span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"fukidashi-01-06"</span>></span> <span class="hljs-tag"><<span class="hljs-name">div</span>></span>かわいいフキダシ<span class="hljs-tag"></<span class="hljs-name">div</span>></span> <span class="hljs-tag"></<span class="hljs-name">div</span>></span> </code></pre> <p>▼ CSS</p> <pre><code class="hljs language-css"><span class="hljs-selector-class">.fukidashi-01-06</span> { <span class="hljs-attribute">position</span>: relative; <span class="hljs-attribute">width</span>: fit-content; <span class="hljs-attribute">padding</span>: <span class="hljs-number">12px</span> <span class="hljs-number">16px</span>; <span class="hljs-attribute">border</span>: <span class="hljs-number">2px</span> solid <span class="hljs-number">#333333</span>; <span class="hljs-attribute">border-radius</span>: <span class="hljs-number">4px</span>; } <span class="hljs-selector-class">.fukidashi-01-06</span><span class="hljs-selector-pseudo">::before</span> { <span class="hljs-attribute">content</span>: <span class="hljs-string">""</span>; <span class="hljs-attribute">position</span>: absolute; <span class="hljs-attribute">bottom</span>: -<span class="hljs-number">5px</span>; <span class="hljs-attribute">left</span>: <span class="hljs-number">50%</span>; <span class="hljs-attribute">width</span>: <span class="hljs-number">15px</span>; <span class="hljs-attribute">height</span>: <span class="hljs-number">15px</span>; <span class="hljs-attribute">box-sizing</span>: border-box; <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#ffffff</span>; <span class="hljs-comment">/* 背景色と同じ色を指定 */</span> <span class="hljs-attribute">rotate</span>: <span class="hljs-number">135deg</span>; <span class="hljs-attribute">translate</span>: -<span class="hljs-number">50%</span>; } <span class="hljs-selector-class">.fukidashi-01-06</span><span class="hljs-selector-pseudo">::after</span> { <span class="hljs-attribute">content</span>: <span class="hljs-string">""</span>; <span class="hljs-attribute">position</span>: absolute; <span class="hljs-attribute">bottom</span>: -<span class="hljs-number">8px</span>; <span class="hljs-attribute">left</span>: <span class="hljs-number">50%</span>; <span class="hljs-attribute">width</span>: <span class="hljs-number">15px</span>; <span class="hljs-attribute">height</span>: <span class="hljs-number">15px</span>; <span class="hljs-attribute">box-sizing</span>: border-box; <span class="hljs-attribute">border</span>: <span class="hljs-number">2px</span> solid; <span class="hljs-attribute">border-color</span>: <span class="hljs-number">#333333</span> <span class="hljs-number">#333333</span> transparent transparent; <span class="hljs-attribute">rotate</span>: <span class="hljs-number">135deg</span>; <span class="hljs-attribute">translate</span>: -<span class="hljs-number">50%</span>; } </code></pre> <h4 id="1-7-%E6%9E%A0-%2B-%E7%B7%9A%E3%81%AE%E3%83%95%E3%82%AD%E3%83%80%E3%82%B7" tabindex="-1">1-7 枠 + 線のフキダシ</h4> <p>下線のナナメの線を重ねた四角いフキダシ。 1-2と同じ方法で、ナナメの線を実装しています。</p> <iframe loading="lazy" width="960" height="540" sandbox="allow-scripts allow-same-origin" src="https://ics-creative.github.io/240425_fukidashi/01-07/"></iframe> <ul> <li><a href="https://ics-creative.github.io/240425_fukidashi/01-07/" target="_blank">サンプルを別ウインドウで開く</a></li> <li><a href="https://github.com/ics-creative/240425_fukidashi/tree/main/01-07/index.html" target="_blank">ソースコードを確認する</a></li> </ul> <p>▼ HTML</p> <pre><code class="hljs language-html"><span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"fukidashi-01-07"</span>></span> <span class="hljs-tag"><<span class="hljs-name">div</span>></span>かわいいフキダシ<span class="hljs-tag"></<span class="hljs-name">div</span>></span> <span class="hljs-tag"></<span class="hljs-name">div</span>></span> </code></pre> <p>▼ CSS</p> <pre><code class="hljs language-css"><span class="hljs-selector-class">.fukidashi-01-07</span> { <span class="hljs-attribute">position</span>: relative; <span class="hljs-attribute">width</span>: fit-content; <span class="hljs-attribute">padding</span>: <span class="hljs-number">12px</span> <span class="hljs-number">16px</span>; <span class="hljs-attribute">border</span>: <span class="hljs-number">2px</span> solid <span class="hljs-number">#333333</span>; } <span class="hljs-selector-class">.fukidashi-01-07</span><span class="hljs-selector-pseudo">::after</span> { <span class="hljs-attribute">content</span>: <span class="hljs-string">""</span>; <span class="hljs-attribute">position</span>: absolute; <span class="hljs-attribute">top</span>: <span class="hljs-built_in">calc</span>(<span class="hljs-number">100%</span> + <span class="hljs-number">5px</span>); <span class="hljs-attribute">left</span>: <span class="hljs-number">50%</span>; <span class="hljs-attribute">width</span>: <span class="hljs-number">30px</span>; <span class="hljs-attribute">height</span>: <span class="hljs-number">2px</span>; <span class="hljs-attribute">box-sizing</span>: border-box; <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#333333</span>; <span class="hljs-attribute">box-shadow</span>: <span class="hljs-number">0</span> <span class="hljs-number">2px</span> <span class="hljs-number">0</span> <span class="hljs-number">#ffffff</span>, <span class="hljs-number">0</span> -<span class="hljs-number">2px</span> <span class="hljs-number">0</span> <span class="hljs-number">#ffffff</span>; <span class="hljs-comment">/* 背景色と同じ色を指定 */</span> <span class="hljs-attribute">rotate</span>: <span class="hljs-number">50deg</span>; } </code></pre> <h4 id="1-8-%E7%AB%8B%E4%BD%93%E6%84%9F%E3%81%AE%E3%81%82%E3%82%8B%E3%83%95%E3%82%AD%E3%83%80%E3%82%B7" tabindex="-1">1-8 立体感のあるフキダシ</h4> <p>下線のナナメの線を重ねた四角いフキダシ。 こちらは背景に<code>::before</code>疑似要素で同じサイズの図形を作成し、ズラして配置することで、立体感のあるデザインになっています。</p> <iframe loading="lazy" width="960" height="540" sandbox="allow-scripts allow-same-origin" src="https://ics-creative.github.io/240425_fukidashi/01-08/"></iframe> <ul> <li><a href="https://ics-creative.github.io/240425_fukidashi/01-08/" target="_blank">サンプルを別ウインドウで開く</a></li> <li><a href="https://github.com/ics-creative/240425_fukidashi/tree/main/01-08/index.html" target="_blank">ソースコードを確認する</a></li> </ul> <p>▼ HTML</p> <pre><code class="hljs language-html"><span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"fukidashi-01-08"</span>></span> <span class="hljs-tag"><<span class="hljs-name">div</span>></span>かわいいフキダシ<span class="hljs-tag"></<span class="hljs-name">div</span>></span> <span class="hljs-tag"></<span class="hljs-name">div</span>></span> </code></pre> <p>▼ CSS</p> <pre><code class="hljs language-css"><span class="hljs-selector-class">.fukidashi-01-08</span> { <span class="hljs-attribute">position</span>: relative; <span class="hljs-attribute">width</span>: fit-content; <span class="hljs-attribute">padding</span>: <span class="hljs-number">12px</span> <span class="hljs-number">16px</span>; <span class="hljs-attribute">border</span>: <span class="hljs-number">2px</span> solid <span class="hljs-number">#333333</span>; <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#ffffff</span>; } <span class="hljs-selector-class">.fukidashi-01-08</span><span class="hljs-selector-pseudo">::before</span> { <span class="hljs-attribute">content</span>: <span class="hljs-string">""</span>; <span class="hljs-attribute">position</span>: absolute; <span class="hljs-attribute">top</span>: <span class="hljs-number">8px</span>; <span class="hljs-attribute">left</span>: <span class="hljs-number">8px</span>; <span class="hljs-attribute">z-index</span>: -<span class="hljs-number">2</span>; <span class="hljs-attribute">width</span>: <span class="hljs-number">100%</span>; <span class="hljs-attribute">height</span>: <span class="hljs-number">100%</span>; <span class="hljs-attribute">box-sizing</span>: border-box; <span class="hljs-attribute">border</span>: <span class="hljs-number">2px</span> solid <span class="hljs-number">#333333</span>; <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#ffffff</span>; } <span class="hljs-selector-class">.fukidashi-01-08</span><span class="hljs-selector-pseudo">::after</span> { <span class="hljs-attribute">content</span>: <span class="hljs-string">""</span>; <span class="hljs-attribute">position</span>: absolute; <span class="hljs-attribute">top</span>: <span class="hljs-built_in">calc</span>(<span class="hljs-number">100%</span> + <span class="hljs-number">10px</span>); <span class="hljs-attribute">left</span>: <span class="hljs-number">50%</span>; <span class="hljs-attribute">z-index</span>: -<span class="hljs-number">1</span>; <span class="hljs-attribute">width</span>: <span class="hljs-number">20px</span>; <span class="hljs-attribute">height</span>: <span class="hljs-number">2px</span>; <span class="hljs-attribute">transform</span>: <span class="hljs-built_in">rotate</span>(<span class="hljs-number">50deg</span>); <span class="hljs-attribute">box-sizing</span>: border-box; <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#333333</span>; <span class="hljs-attribute">box-shadow</span>: <span class="hljs-number">0</span> <span class="hljs-number">2px</span> <span class="hljs-number">0</span> <span class="hljs-number">#ffffff</span>, <span class="hljs-number">0</span> -<span class="hljs-number">2px</span> <span class="hljs-number">0</span> <span class="hljs-number">#ffffff</span>; <span class="hljs-comment">/* 背景色と同じ色を指定 */</span> } </code></pre> <h4 id="1-9-%E5%86%86-%2B-%E7%B7%9A%E3%81%AE%E3%83%95%E3%82%AD%E3%83%80%E3%82%B7" tabindex="-1">1-9 円 + 線のフキダシ</h4> <p>下線のナナメの線を重ねた丸いフキダシ。 こちらも<code>::after</code>疑似要素でナナメの線を描画し、フキダシの枠部分に重ねています。</p> <p>※テキストの量に応じて、widthやheightを調整してお使いください。</p> <iframe loading="lazy" width="960" height="540" sandbox="allow-scripts allow-same-origin" src="https://ics-creative.github.io/240425_fukidashi/01-09/"></iframe> <ul> <li><a href="https://ics-creative.github.io/240425_fukidashi/01-09/" target="_blank">サンプルを別ウインドウで開く</a></li> <li><a href="https://github.com/ics-creative/240425_fukidashi/tree/main/01-09/index.html" target="_blank">ソースコードを確認する</a></li> </ul> <p>▼ HTML</p> <pre><code class="hljs language-html"><span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"fukidashi-01-09"</span>></span> <span class="hljs-tag"><<span class="hljs-name">div</span>></span>かわいい<span class="hljs-tag"><<span class="hljs-name">br</span>></span>フキダシ<span class="hljs-tag"></<span class="hljs-name">div</span>></span> <span class="hljs-tag"></<span class="hljs-name">div</span>></span> </code></pre> <p>▼ CSS</p> <pre><code class="hljs language-css"><span class="hljs-selector-class">.fukidashi-01-09</span> { <span class="hljs-attribute">position</span>: relative; <span class="hljs-attribute">display</span>: grid; place-items: center; <span class="hljs-attribute">width</span>: <span class="hljs-number">120px</span>; <span class="hljs-attribute">height</span>: <span class="hljs-number">120px</span>; <span class="hljs-attribute">border</span>: <span class="hljs-number">2px</span> solid <span class="hljs-number">#333333</span>; <span class="hljs-attribute">border-radius</span>: <span class="hljs-number">50%</span>; } <span class="hljs-selector-class">.fukidashi-01-09</span><span class="hljs-selector-pseudo">::after</span> { <span class="hljs-attribute">content</span>: <span class="hljs-string">""</span>; <span class="hljs-attribute">position</span>: absolute; <span class="hljs-attribute">top</span>: <span class="hljs-number">100%</span>; <span class="hljs-attribute">left</span>: <span class="hljs-number">50%</span>; <span class="hljs-attribute">width</span>: <span class="hljs-number">26px</span>; <span class="hljs-attribute">height</span>: <span class="hljs-number">2px</span>; <span class="hljs-attribute">transform</span>: <span class="hljs-built_in">rotate</span>(<span class="hljs-number">50deg</span>); <span class="hljs-attribute">box-sizing</span>: border-box; <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#333333</span>; <span class="hljs-attribute">box-shadow</span>: <span class="hljs-number">0</span> <span class="hljs-number">2px</span> <span class="hljs-number">0</span> <span class="hljs-number">#ffffff</span>, <span class="hljs-number">0</span> -<span class="hljs-number">2px</span> <span class="hljs-number">0</span> <span class="hljs-number">#ffffff</span>; <span class="hljs-comment">/* 背景色と同じ色を指定 */</span> } </code></pre> <h4 id="1-10-%E5%86%86-%2B-%E7%B7%9A%EF%BC%88%E9%9A%99%E9%96%93%E3%81%82%E3%82%8A%EF%BC%89%E3%81%AE%E3%83%95%E3%82%AD%E3%83%80%E3%82%B7" tabindex="-1">1-10 円 + 線(隙間あり)のフキダシ</h4> <p>下線のナナメの線を重ねた丸いフキダシ。 こちらも背景と同じ色の<code>::before</code>疑似要素を下線に重ねることで、隙間が空いているようなデザインを表現しています。</p> <p>※テキストの量に応じて、widthやheightを調整してお使いください。</p> <iframe loading="lazy" width="960" height="540" sandbox="allow-scripts allow-same-origin" src="https://ics-creative.github.io/240425_fukidashi/01-10/"></iframe> <ul> <li><a href="https://ics-creative.github.io/240425_fukidashi/01-10/" target="_blank">サンプルを別ウインドウで開く</a></li> <li><a href="https://github.com/ics-creative/240425_fukidashi/tree/main/01-10/index.html" target="_blank">ソースコードを確認する</a></li> </ul> <p>▼ HTML</p> <pre><code class="hljs language-html"><span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"fukidashi-01-10"</span>></span> <span class="hljs-tag"><<span class="hljs-name">div</span>></span>かわいい<span class="hljs-tag"><<span class="hljs-name">br</span>></span>フキダシ<span class="hljs-tag"></<span class="hljs-name">div</span>></span> <span class="hljs-tag"></<span class="hljs-name">div</span>></span> </code></pre> <p>▼ CSS</p> <pre><code class="hljs language-css"><span class="hljs-selector-class">.fukidashi-01-10</span> { <span class="hljs-attribute">position</span>: relative; <span class="hljs-attribute">display</span>: grid; place-items: center; <span class="hljs-attribute">width</span>: <span class="hljs-number">120px</span>; <span class="hljs-attribute">height</span>: <span class="hljs-number">120px</span>; <span class="hljs-attribute">border</span>: <span class="hljs-number">2px</span> solid <span class="hljs-number">#333333</span>; <span class="hljs-attribute">border-radius</span>: <span class="hljs-number">50%</span>; } <span class="hljs-selector-class">.fukidashi-01-10</span><span class="hljs-selector-pseudo">::before</span> { <span class="hljs-attribute">content</span>: <span class="hljs-string">""</span>; <span class="hljs-attribute">position</span>: absolute; <span class="hljs-attribute">bottom</span>: -<span class="hljs-number">5px</span>; <span class="hljs-attribute">left</span>: <span class="hljs-number">58%</span>; <span class="hljs-attribute">width</span>: <span class="hljs-number">15px</span>; <span class="hljs-attribute">height</span>: <span class="hljs-number">15px</span>; <span class="hljs-attribute">transform</span>: <span class="hljs-built_in">rotate</span>(<span class="hljs-number">135deg</span>); <span class="hljs-attribute">box-sizing</span>: border-box; <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#ffffff</span>; <span class="hljs-comment">/* 背景色と同じ色を指定 */</span> } <span class="hljs-selector-class">.fukidashi-01-10</span><span class="hljs-selector-pseudo">::after</span> { <span class="hljs-attribute">content</span>: <span class="hljs-string">""</span>; <span class="hljs-attribute">position</span>: absolute; <span class="hljs-attribute">top</span>: <span class="hljs-built_in">calc</span>(<span class="hljs-number">100%</span> + <span class="hljs-number">5px</span>); <span class="hljs-attribute">left</span>: <span class="hljs-number">54%</span>; <span class="hljs-attribute">width</span>: <span class="hljs-number">20px</span>; <span class="hljs-attribute">height</span>: <span class="hljs-number">2px</span>; <span class="hljs-attribute">transform</span>: <span class="hljs-built_in">rotate</span>(<span class="hljs-number">50deg</span>); <span class="hljs-attribute">box-sizing</span>: border-box; <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#333333</span>; <span class="hljs-attribute">box-shadow</span>: <span class="hljs-number">0</span> <span class="hljs-number">2px</span> <span class="hljs-number">0</span> <span class="hljs-number">#ffffff</span>, <span class="hljs-number">0</span> -<span class="hljs-number">2px</span> <span class="hljs-number">0</span> <span class="hljs-number">#ffffff</span>; <span class="hljs-comment">/* 背景色と同じ色を指定 */</span> } </code></pre> <h4 id="1-11-%E3%81%B5%E3%81%9F%E3%81%A4%E3%81%AE%E5%86%86-%2B-%E7%B7%9A%E3%81%AE%E3%83%95%E3%82%AD%E3%83%80%E3%82%B7" tabindex="-1">1-11 ふたつの円 + 線のフキダシ</h4> <p>左上にさらに円形の要素を重ねた丸いフキダシ。 こちらは<code>span</code>タグを追加することで実装しています。雪だるまのように配置しても可愛いかもしれません。</p> <p>※テキストの量に応じて、widthやheightを調整してお使いください。</p> <iframe loading="lazy" width="960" height="540" sandbox="allow-scripts allow-same-origin" src="https://ics-creative.github.io/240425_fukidashi/01-11/"></iframe> <ul> <li><a href="https://ics-creative.github.io/240425_fukidashi/01-11/" target="_blank">サンプルを別ウインドウで開く</a></li> <li><a href="https://github.com/ics-creative/240425_fukidashi/tree/main/01-11/index.html" target="_blank">ソースコードを確認する</a></li> </ul> <p>▼ HTML</p> <pre><code class="hljs language-html"><span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"fukidashi-01-11"</span>></span> <span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"text"</span>></span>かわいい<span class="hljs-tag"><<span class="hljs-name">br</span>></span>フキダシ<span class="hljs-tag"></<span class="hljs-name">div</span>></span> <span class="hljs-tag"><<span class="hljs-name">span</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"ornament"</span>></span>Cute!<span class="hljs-tag"></<span class="hljs-name">span</span>></span> <span class="hljs-tag"></<span class="hljs-name">div</span>></span> </code></pre> <p>▼ CSS</p> <pre><code class="hljs language-css"><span class="hljs-selector-class">.fukidashi-01-11</span> { <span class="hljs-attribute">position</span>: relative; <span class="hljs-attribute">display</span>: grid; place-items: center; <span class="hljs-attribute">width</span>: <span class="hljs-number">120px</span>; <span class="hljs-attribute">height</span>: <span class="hljs-number">120px</span>; <span class="hljs-attribute">border</span>: <span class="hljs-number">2px</span> solid <span class="hljs-number">#333333</span>; <span class="hljs-attribute">border-radius</span>: <span class="hljs-number">50%</span>; } <span class="hljs-selector-class">.fukidashi-01-11</span><span class="hljs-selector-pseudo">::after</span> { <span class="hljs-attribute">content</span>: <span class="hljs-string">""</span>; <span class="hljs-attribute">position</span>: absolute; <span class="hljs-attribute">top</span>: <span class="hljs-number">100%</span>; <span class="hljs-attribute">left</span>: <span class="hljs-number">58%</span>; <span class="hljs-attribute">width</span>: <span class="hljs-number">26px</span>; <span class="hljs-attribute">height</span>: <span class="hljs-number">2px</span>; <span class="hljs-attribute">transform</span>: <span class="hljs-built_in">rotate</span>(<span class="hljs-number">50deg</span>); <span class="hljs-attribute">box-sizing</span>: border-box; <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#333333</span>; <span class="hljs-attribute">box-shadow</span>: <span class="hljs-number">0</span> <span class="hljs-number">2px</span> <span class="hljs-number">0</span> <span class="hljs-number">#ffffff</span>, <span class="hljs-number">0</span> -<span class="hljs-number">2px</span> <span class="hljs-number">0</span> <span class="hljs-number">#ffffff</span>; <span class="hljs-comment">/* 背景色と同じ色を指定 */</span> } <span class="hljs-selector-class">.fukidashi-01-11</span> > <span class="hljs-selector-class">.text</span> { <span class="hljs-attribute">position</span>: absolute; <span class="hljs-attribute">z-index</span>: <span class="hljs-number">3</span>; <span class="hljs-attribute">display</span>: grid; place-items: center; <span class="hljs-attribute">width</span>: <span class="hljs-number">100%</span>; <span class="hljs-attribute">height</span>: <span class="hljs-number">100%</span>; <span class="hljs-attribute">border-radius</span>: <span class="hljs-number">50%</span>; <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#ffffff</span>; } <span class="hljs-selector-class">.fukidashi-01-11</span> > <span class="hljs-selector-class">.ornament</span> { <span class="hljs-attribute">position</span>: absolute; <span class="hljs-attribute">top</span>: -<span class="hljs-number">30%</span>; <span class="hljs-attribute">left</span>: -<span class="hljs-number">25%</span>; <span class="hljs-attribute">z-index</span>: <span class="hljs-number">1</span>; <span class="hljs-attribute">display</span>: grid; place-items: center; <span class="hljs-attribute">width</span>: <span class="hljs-number">60%</span>; <span class="hljs-attribute">height</span>: <span class="hljs-number">60%</span>; <span class="hljs-attribute">font-size</span>: <span class="hljs-number">16px</span>; <span class="hljs-attribute">border</span>: <span class="hljs-number">2px</span> solid <span class="hljs-number">#333333</span>; <span class="hljs-attribute">border-radius</span>: <span class="hljs-number">50%</span>; <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#ffffff</span>; } <span class="hljs-selector-class">.fukidashi-01-11</span> > <span class="hljs-selector-class">.ornament</span><span class="hljs-selector-pseudo">::before</span> { <span class="hljs-attribute">content</span>: <span class="hljs-string">""</span>; <span class="hljs-attribute">position</span>: absolute; <span class="hljs-attribute">bottom</span>: -<span class="hljs-number">5px</span>; <span class="hljs-attribute">left</span>: <span class="hljs-number">70px</span>; <span class="hljs-attribute">width</span>: <span class="hljs-number">15px</span>; <span class="hljs-attribute">height</span>: <span class="hljs-number">15px</span>; <span class="hljs-attribute">transform</span>: <span class="hljs-built_in">rotate</span>(<span class="hljs-number">135deg</span>); <span class="hljs-attribute">box-sizing</span>: border-box; <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#ffffff</span>; } </code></pre> <h4 id="1-12-%E4%B8%8B%E3%81%8B%E3%82%89%E5%91%BC%E3%81%B3%E3%81%8B%E3%81%91%E3%82%8B%E3%83%95%E3%82%AD%E3%83%80%E3%82%B7" tabindex="-1">1-12 下から呼びかけるフキダシ</h4> <p>2本の線でテキストを挟んだようなフキダシ。セリフのような表現に便利です。 <code>::before</code>&<code>::after</code>疑似要素を<code>display: flex</code>で左右に並べるだけで簡単に実装できます。</p> <iframe loading="lazy" width="960" height="540" sandbox="allow-scripts allow-same-origin" src="https://ics-creative.github.io/240425_fukidashi/01-12/"></iframe> <ul> <li><a href="https://ics-creative.github.io/240425_fukidashi/01-12/" target="_blank">サンプルを別ウインドウで開く</a></li> <li><a href="https://github.com/ics-creative/240425_fukidashi/tree/main/01-12/index.html" target="_blank">ソースコードを確認する</a></li> </ul> <p>▼ HTML</p> <pre><code class="hljs language-html"><span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"fukidashi-01-12"</span>></span> <span class="hljs-tag"><<span class="hljs-name">div</span>></span>かわいいフキダシ<span class="hljs-tag"></<span class="hljs-name">div</span>></span> <span class="hljs-tag"></<span class="hljs-name">div</span>></span> </code></pre> <p>▼ CSS</p> <pre><code class="hljs language-css"><span class="hljs-selector-class">.fukidashi-01-12</span> { <span class="hljs-attribute">display</span>: flex; <span class="hljs-attribute">justify-content</span>: center; <span class="hljs-attribute">align-items</span>: center; <span class="hljs-attribute">gap</span>: <span class="hljs-number">10px</span>; <span class="hljs-attribute">padding</span>: <span class="hljs-number">12px</span> <span class="hljs-number">16px</span>; } <span class="hljs-selector-class">.fukidashi-01-12</span><span class="hljs-selector-pseudo">::before</span> { <span class="hljs-attribute">content</span>: <span class="hljs-string">""</span>; <span class="hljs-attribute">width</span>: <span class="hljs-number">30px</span>; <span class="hljs-attribute">height</span>: <span class="hljs-number">2px</span>; <span class="hljs-attribute">transform</span>: <span class="hljs-built_in">rotate</span>(<span class="hljs-number">60deg</span>); <span class="hljs-attribute">box-sizing</span>: border-box; <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#333333</span>; } <span class="hljs-selector-class">.fukidashi-01-12</span><span class="hljs-selector-pseudo">::after</span> { <span class="hljs-attribute">content</span>: <span class="hljs-string">""</span>; <span class="hljs-attribute">width</span>: <span class="hljs-number">30px</span>; <span class="hljs-attribute">height</span>: <span class="hljs-number">2px</span>; <span class="hljs-attribute">transform</span>: <span class="hljs-built_in">rotate</span>(-<span class="hljs-number">60deg</span>); <span class="hljs-attribute">box-sizing</span>: border-box; <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#333333</span>; } </code></pre> <h4 id="1-13-%E6%A8%AA%E3%81%8B%E3%82%89%E5%91%BC%E3%81%B3%E3%81%8B%E3%81%91%E3%82%8B%E3%83%95%E3%82%AD%E3%83%80%E3%82%B7" tabindex="-1">1-13 横から呼びかけるフキダシ</h4> <p>4本の線で飛び出すようなデザインのフキダシ。こちらもセリフのような表現に便利です。 空の<code>span</code>タグを追加し、外側の2本の線を実装しています。</p> <iframe loading="lazy" width="960" height="540" sandbox="allow-scripts allow-same-origin" src="https://ics-creative.github.io/240425_fukidashi/01-13/"></iframe> <ul> <li><a href="https://ics-creative.github.io/240425_fukidashi/01-13/" target="_blank">サンプルを別ウインドウで開く</a></li> <li><a href="https://github.com/ics-creative/240425_fukidashi/tree/main/01-13/index.html" target="_blank">ソースコードを確認する</a></li> </ul> <p>▼ HTML</p> <pre><code class="hljs language-html"><span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"fukidashi-01-13"</span>></span> <span class="hljs-tag"><<span class="hljs-name">div</span>></span>かわいいフキダシ<span class="hljs-tag"></<span class="hljs-name">div</span>></span> <span class="hljs-tag"><<span class="hljs-name">span</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"ornament"</span>></span><span class="hljs-tag"></<span class="hljs-name">span</span>></span> <span class="hljs-tag"></<span class="hljs-name">div</span>></span> </code></pre> <p>▼ CSS</p> <pre><code class="hljs language-css"><span class="hljs-selector-class">.fukidashi-01-13</span> { <span class="hljs-attribute">position</span>: relative; <span class="hljs-attribute">padding</span>: <span class="hljs-number">12px</span> <span class="hljs-number">16px</span> <span class="hljs-number">12px</span> <span class="hljs-number">30px</span>; } <span class="hljs-selector-class">.fukidashi-01-13</span><span class="hljs-selector-pseudo">::before</span> { <span class="hljs-attribute">content</span>: <span class="hljs-string">""</span>; <span class="hljs-attribute">position</span>: absolute; <span class="hljs-attribute">top</span>: -<span class="hljs-number">12px</span>; <span class="hljs-attribute">left</span>: <span class="hljs-number">0</span>; <span class="hljs-attribute">width</span>: <span class="hljs-number">100px</span>; <span class="hljs-attribute">height</span>: <span class="hljs-number">1px</span>; <span class="hljs-attribute">transform</span>: <span class="hljs-built_in">rotate</span>(-<span class="hljs-number">14deg</span>); <span class="hljs-attribute">box-sizing</span>: border-box; <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#333333</span>; } <span class="hljs-selector-class">.fukidashi-01-13</span><span class="hljs-selector-pseudo">::after</span> { <span class="hljs-attribute">content</span>: <span class="hljs-string">""</span>; <span class="hljs-attribute">position</span>: absolute; <span class="hljs-attribute">bottom</span>: -<span class="hljs-number">14px</span>; <span class="hljs-attribute">left</span>: <span class="hljs-number">0</span>; <span class="hljs-attribute">width</span>: <span class="hljs-number">120px</span>; <span class="hljs-attribute">height</span>: <span class="hljs-number">1px</span>; <span class="hljs-attribute">transform</span>: <span class="hljs-built_in">rotate</span>(<span class="hljs-number">14deg</span>); <span class="hljs-attribute">box-sizing</span>: border-box; <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#333333</span>; } <span class="hljs-selector-class">.fukidashi-01-13</span> > <span class="hljs-selector-class">.ornament</span> { <span class="hljs-attribute">position</span>: absolute; <span class="hljs-attribute">top</span>: <span class="hljs-number">0</span>; <span class="hljs-attribute">left</span>: <span class="hljs-number">0</span>; <span class="hljs-attribute">width</span>: <span class="hljs-number">100%</span>; <span class="hljs-attribute">height</span>: <span class="hljs-number">100%</span>; } <span class="hljs-selector-class">.fukidashi-01-13</span> > <span class="hljs-selector-class">.ornament</span><span class="hljs-selector-pseudo">::before</span> { <span class="hljs-attribute">content</span>: <span class="hljs-string">""</span>; <span class="hljs-attribute">position</span>: absolute; <span class="hljs-attribute">top</span>: -<span class="hljs-number">10px</span>; <span class="hljs-attribute">left</span>: <span class="hljs-number">0</span>; <span class="hljs-attribute">width</span>: <span class="hljs-number">160px</span>; <span class="hljs-attribute">height</span>: <span class="hljs-number">1px</span>; <span class="hljs-attribute">transform</span>: <span class="hljs-built_in">rotate</span>(-<span class="hljs-number">12deg</span>); <span class="hljs-attribute">box-sizing</span>: border-box; <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#333333</span>; } <span class="hljs-selector-class">.fukidashi-01-13</span> > <span class="hljs-selector-class">.ornament</span><span class="hljs-selector-pseudo">::after</span> { <span class="hljs-attribute">content</span>: <span class="hljs-string">""</span>; <span class="hljs-attribute">position</span>: absolute; <span class="hljs-attribute">bottom</span>: -<span class="hljs-number">10px</span>; <span class="hljs-attribute">left</span>: <span class="hljs-number">0</span>; <span class="hljs-attribute">width</span>: <span class="hljs-number">160px</span>; <span class="hljs-attribute">height</span>: <span class="hljs-number">1px</span>; <span class="hljs-attribute">transform</span>: <span class="hljs-built_in">rotate</span>(<span class="hljs-number">12deg</span>); <span class="hljs-attribute">box-sizing</span>: border-box; <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#333333</span>; } </code></pre> <h3 id="2.-%E5%A1%97%E3%82%8A%E3%82%A2%E3%83%AA%E3%81%AE%E3%83%95%E3%82%AD%E3%83%80%E3%82%B7" tabindex="-1">2. 塗りアリのフキダシ</h3> <h4 id="2-1-%E5%A1%97%E3%82%8A-%2B-%E4%B8%89%E8%A7%92%E3%81%A4%E3%81%BE%E3%81%BF%E3%81%AE%E3%83%95%E3%82%AD%E3%83%80%E3%82%B7" tabindex="-1">2-1 塗り + 三角つまみのフキダシ</h4> <p>下線の中央に三角のつまみをつけた、塗りアリの四角いフキダシ。 1-3と同様に、<code>::after</code>疑似要素でつまみ部分を描画していますが、こちらでは<code>clip-path</code>プロパティを使用しています。</p> <p><code>clip-path</code>プロパティは、「要素のどの部分を表示するか」を設定し、クリッピング領域を作るCSSプロパティです。 このCSSプロパティは、以下の記事で詳しく紹介しています。</p> <ul> <li><a href="https://ics.media/entry/210701/#clip-path">変幻自在なグラフィック表現!CSS, SVG, Canvasでマスクを使いこなせ</a></li> </ul> <iframe loading="lazy" width="960" height="540" sandbox="allow-scripts allow-same-origin" src="https://ics-creative.github.io/240425_fukidashi/02-01/"></iframe> <ul> <li><a href="https://ics-creative.github.io/240425_fukidashi/02-01/" target="_blank">サンプルを別ウインドウで開く</a></li> <li><a href="https://github.com/ics-creative/240425_fukidashi/tree/main/02-01/index.html" target="_blank">ソースコードを確認する</a></li> </ul> <p>▼ HTML</p> <pre><code class="hljs language-html"><span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"fukidashi-02-01"</span>></span> <span class="hljs-tag"><<span class="hljs-name">div</span>></span>かわいいフキダシ<span class="hljs-tag"></<span class="hljs-name">div</span>></span> <span class="hljs-tag"></<span class="hljs-name">div</span>></span> </code></pre> <p>▼ CSS</p> <pre><code class="hljs language-css"><span class="hljs-selector-class">.fukidashi-02-01</span> { <span class="hljs-attribute">position</span>: relative; <span class="hljs-attribute">width</span>: fit-content; <span class="hljs-attribute">padding</span>: <span class="hljs-number">12px</span> <span class="hljs-number">20px</span>; <span class="hljs-attribute">color</span>: <span class="hljs-number">#ffffff</span>; <span class="hljs-attribute">border-radius</span>: <span class="hljs-number">10px</span>; <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#333333</span>; } <span class="hljs-selector-class">.fukidashi-02-01</span><span class="hljs-selector-pseudo">::after</span> { <span class="hljs-attribute">content</span>: <span class="hljs-string">""</span>; <span class="hljs-attribute">position</span>: absolute; <span class="hljs-attribute">top</span>: <span class="hljs-number">100%</span>; <span class="hljs-attribute">left</span>: <span class="hljs-number">50%</span>; <span class="hljs-attribute">z-index</span>: -<span class="hljs-number">1</span>; <span class="hljs-attribute">width</span>: <span class="hljs-number">20px</span>; <span class="hljs-attribute">height</span>: <span class="hljs-number">12px</span>; <span class="hljs-attribute">transform</span>: <span class="hljs-built_in">translateX</span>(-<span class="hljs-number">50%</span>); <span class="hljs-attribute">box-sizing</span>: border-box; <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#333333</span>; <span class="hljs-attribute">clip-path</span>: <span class="hljs-built_in">polygon</span>(<span class="hljs-number">0</span> <span class="hljs-number">0</span>, <span class="hljs-number">100%</span> <span class="hljs-number">0</span>, <span class="hljs-number">50%</span> <span class="hljs-number">100%</span>); } </code></pre> <h4 id="2-2-%E3%81%97%E3%81%9A%E3%81%8F%E5%BD%A2%E3%81%AE%E3%83%95%E3%82%AD%E3%83%80%E3%82%B7" tabindex="-1">2-2 しずく形のフキダシ</h4> <p>右下から話しかけているようなフキダシ。 <code>border-radius</code>を右下以外に指定することで実装しています。</p> <p>※テキストの量に応じて、widthやheightを調整してお使いください。</p> <iframe loading="lazy" width="960" height="540" sandbox="allow-scripts allow-same-origin" src="https://ics-creative.github.io/240425_fukidashi/02-02/"></iframe> <ul> <li><a href="https://ics-creative.github.io/240425_fukidashi/02-02/" target="_blank">サンプルを別ウインドウで開く</a></li> <li><a href="https://github.com/ics-creative/240425_fukidashi/tree/main/02-02/index.html" target="_blank">ソースコードを確認する</a></li> </ul> <p>▼ HTML</p> <pre><code class="hljs language-html"><span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"fukidashi-02-02"</span>></span> <span class="hljs-tag"><<span class="hljs-name">div</span>></span>かわいい<span class="hljs-tag"><<span class="hljs-name">br</span>></span>フキダシ<span class="hljs-tag"></<span class="hljs-name">div</span>></span> <span class="hljs-tag"></<span class="hljs-name">div</span>></span> </code></pre> <p>▼ CSS</p> <pre><code class="hljs language-css"><span class="hljs-selector-class">.fukidashi-02-02</span> { <span class="hljs-attribute">display</span>: grid; place-items: center; <span class="hljs-attribute">width</span>: <span class="hljs-number">150px</span>; <span class="hljs-attribute">height</span>: <span class="hljs-number">150px</span>; <span class="hljs-attribute">color</span>: <span class="hljs-number">#ffffff</span>; <span class="hljs-attribute">border-radius</span>: <span class="hljs-number">100%</span> <span class="hljs-number">100%</span> <span class="hljs-number">0</span> <span class="hljs-number">100%</span>; <span class="hljs-comment">/* 右下以外に角丸を指定 */</span> <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#333333</span>; } </code></pre> <h4 id="2-3-%E8%83%8C%E6%99%AF%E8%89%B2%E3%81%AE%E3%81%82%E3%82%8B%E5%86%86%E3%81%AE%E3%83%95%E3%82%AD%E3%83%80%E3%82%B7" tabindex="-1">2-3 背景色のある円のフキダシ</h4> <p>下線のナナメの線を重ねた、背景色のある丸いフキダシ。 こちらは1-10の応用です。</p> <p>ここで使われている<code>mix-blend-mode</code>は、DOM要素を重ねた時の見え方を指定するCSSプロパティです。 このCSSプロパティは、以下の記事で詳しく紹介しています。</p> <ul> <li><a href="https://ics.media/entry/7258/">CSSのブレンドモードが素敵!mix-blend-modeを使いこなそう</a></li> </ul> <p>※テキストの量に応じて、widthやheightを調整してお使いください。</p> <iframe loading="lazy" width="960" height="540" sandbox="allow-scripts allow-same-origin" src="https://ics-creative.github.io/240425_fukidashi/02-03/"></iframe> <ul> <li><a href="https://ics-creative.github.io/240425_fukidashi/02-03/" target="_blank">サンプルを別ウインドウで開く</a></li> <li><a href="https://github.com/ics-creative/240425_fukidashi/tree/main/02-03/index.html" target="_blank">ソースコードを確認する</a></li> </ul> <p>▼ HTML</p> <pre><code class="hljs language-html"><span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"fukidashi-02-03"</span>></span> <span class="hljs-tag"><<span class="hljs-name">div</span>></span>かわいい<span class="hljs-tag"><<span class="hljs-name">br</span>></span>フキダシ<span class="hljs-tag"></<span class="hljs-name">div</span>></span> <span class="hljs-tag"><<span class="hljs-name">span</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"ornament"</span>></span><span class="hljs-tag"></<span class="hljs-name">span</span>></span> <span class="hljs-tag"></<span class="hljs-name">div</span>></span> </code></pre> <p>▼ CSS</p> <pre><code class="hljs language-css"><span class="hljs-selector-class">.fukidashi-02-03</span> { <span class="hljs-attribute">position</span>: relative; <span class="hljs-attribute">display</span>: grid; place-items: center; <span class="hljs-attribute">width</span>: <span class="hljs-number">120px</span>; <span class="hljs-attribute">height</span>: <span class="hljs-number">120px</span>; <span class="hljs-attribute">border</span>: <span class="hljs-number">2px</span> solid <span class="hljs-number">#333333</span>; <span class="hljs-attribute">border-radius</span>: <span class="hljs-number">50%</span>; } <span class="hljs-selector-class">.fukidashi-02-03</span><span class="hljs-selector-pseudo">::before</span> { <span class="hljs-attribute">content</span>: <span class="hljs-string">""</span>; <span class="hljs-attribute">position</span>: absolute; <span class="hljs-attribute">bottom</span>: -<span class="hljs-number">5px</span>; <span class="hljs-attribute">left</span>: <span class="hljs-number">70px</span>; <span class="hljs-attribute">width</span>: <span class="hljs-number">15px</span>; <span class="hljs-attribute">height</span>: <span class="hljs-number">15px</span>; <span class="hljs-attribute">transform</span>: <span class="hljs-built_in">rotate</span>(<span class="hljs-number">135deg</span>); <span class="hljs-attribute">box-sizing</span>: border-box; <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#ffffff</span>; } <span class="hljs-selector-class">.fukidashi-02-03</span><span class="hljs-selector-pseudo">::after</span> { <span class="hljs-attribute">content</span>: <span class="hljs-string">""</span>; <span class="hljs-attribute">position</span>: absolute; <span class="hljs-attribute">top</span>: <span class="hljs-number">108%</span>; <span class="hljs-attribute">left</span>: <span class="hljs-number">68px</span>; <span class="hljs-attribute">width</span>: <span class="hljs-number">20px</span>; <span class="hljs-attribute">height</span>: <span class="hljs-number">2px</span>; <span class="hljs-attribute">transform</span>: <span class="hljs-built_in">rotate</span>(<span class="hljs-number">50deg</span>); <span class="hljs-attribute">box-sizing</span>: border-box; <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#333333</span>; } <span class="hljs-selector-class">.fukidashi-02-03</span> > <span class="hljs-selector-class">.ornament</span> { <span class="hljs-attribute">position</span>: absolute; <span class="hljs-attribute">width</span>: <span class="hljs-number">100%</span>; <span class="hljs-attribute">height</span>: <span class="hljs-number">100%</span>; <span class="hljs-attribute">transform</span>: <span class="hljs-built_in">translateX</span>(<span class="hljs-number">3px</span>) <span class="hljs-built_in">translateY</span>(<span class="hljs-number">3px</span>); <span class="hljs-comment">/* 位置をややズラす */</span> <span class="hljs-attribute">border-radius</span>: <span class="hljs-number">50%</span>; <span class="hljs-attribute">background-color</span>: hotpink; <span class="hljs-attribute">pointer-events</span>: none; <span class="hljs-comment">/* クリック不可にする(下のテキストに触れるように) */</span> <span class="hljs-attribute">mix-blend-mode</span>: multiply; <span class="hljs-comment">/* 乗算 */</span> } </code></pre> <h4 id="2-4-%E3%83%9E%E3%82%B9%E3%82%AD%E3%83%B3%E3%82%B0%E3%83%86%E3%83%BC%E3%83%97%E3%81%AE%E8%B2%BC%E3%82%89%E3%82%8C%E3%81%9F%E3%83%95%E3%82%AD%E3%83%80%E3%82%B7" tabindex="-1">2-4 マスキングテープの貼られたフキダシ</h4> <p>左上、右下にマスキングテープ風のあしらいがついたフキダシ。 こちらのあしらいでも<code>mix-blend-mode</code>の<code>multiply</code>(乗算)を利用することで、透け感を表現しています。</p> <iframe loading="lazy" width="960" height="540" sandbox="allow-scripts allow-same-origin" src="https://ics-creative.github.io/240425_fukidashi/02-04/"></iframe> <ul> <li><a href="https://ics-creative.github.io/240425_fukidashi/02-04/" target="_blank">サンプルを別ウインドウで開く</a></li> <li><a href="https://github.com/ics-creative/240425_fukidashi/tree/main/02-04/index.html" target="_blank">ソースコードを確認する</a></li> </ul> <p>▼ HTML</p> <pre><code class="hljs language-html"><span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"fukidashi-02-04"</span>></span> <span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"text"</span>></span>かわいいフキダシ<span class="hljs-tag"></<span class="hljs-name">div</span>></span> <span class="hljs-tag"><<span class="hljs-name">span</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"ornament"</span>></span><span class="hljs-tag"></<span class="hljs-name">span</span>></span> <span class="hljs-tag"></<span class="hljs-name">div</span>></span> </code></pre> <p>▼ CSS</p> <pre><code class="hljs language-css"><span class="hljs-selector-class">.fukidashi-02-04</span> { <span class="hljs-attribute">position</span>: relative; <span class="hljs-attribute">width</span>: fit-content; } <span class="hljs-selector-class">.fukidashi-02-04</span> > <span class="hljs-selector-class">.text</span> { <span class="hljs-attribute">position</span>: relative; <span class="hljs-attribute">padding</span>: <span class="hljs-number">12px</span> <span class="hljs-number">16px</span>; <span class="hljs-attribute">border-radius</span>: <span class="hljs-number">4px</span>; <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#fff3d1</span>; } <span class="hljs-selector-class">.fukidashi-02-04</span> > <span class="hljs-selector-class">.text</span><span class="hljs-selector-pseudo">::before</span> { <span class="hljs-attribute">content</span>: <span class="hljs-string">""</span>; <span class="hljs-attribute">position</span>: absolute; <span class="hljs-attribute">bottom</span>: -<span class="hljs-number">5px</span>; <span class="hljs-attribute">left</span>: <span class="hljs-number">50%</span>; <span class="hljs-attribute">width</span>: <span class="hljs-number">15px</span>; <span class="hljs-attribute">height</span>: <span class="hljs-number">15px</span>; <span class="hljs-attribute">transform</span>: <span class="hljs-built_in">rotate</span>(<span class="hljs-number">135deg</span>); <span class="hljs-attribute">box-sizing</span>: border-box; <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#fff3d1</span>; } <span class="hljs-selector-class">.fukidashi-02-04</span> > <span class="hljs-selector-class">.ornament</span> { <span class="hljs-attribute">position</span>: absolute; <span class="hljs-attribute">top</span>: <span class="hljs-number">0</span>; <span class="hljs-attribute">width</span>: <span class="hljs-number">100%</span>; <span class="hljs-attribute">height</span>: <span class="hljs-number">100%</span>; } <span class="hljs-selector-class">.fukidashi-02-04</span> > <span class="hljs-selector-class">.ornament</span><span class="hljs-selector-pseudo">::before</span> { <span class="hljs-attribute">content</span>: <span class="hljs-string">""</span>; <span class="hljs-attribute">position</span>: absolute; <span class="hljs-attribute">top</span>: <span class="hljs-number">0</span>; <span class="hljs-attribute">left</span>: -<span class="hljs-number">10px</span>; <span class="hljs-attribute">width</span>: <span class="hljs-number">36px</span>; <span class="hljs-attribute">height</span>: <span class="hljs-number">16px</span>; <span class="hljs-attribute">transform</span>: <span class="hljs-built_in">rotate</span>(-<span class="hljs-number">45deg</span>); <span class="hljs-attribute">box-sizing</span>: border-box; <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#ff57b1</span>; <span class="hljs-attribute">mix-blend-mode</span>: multiply; <span class="hljs-comment">/* 乗算 */</span> } <span class="hljs-selector-class">.fukidashi-02-04</span> > <span class="hljs-selector-class">.ornament</span><span class="hljs-selector-pseudo">::after</span> { <span class="hljs-attribute">content</span>: <span class="hljs-string">""</span>; <span class="hljs-attribute">position</span>: absolute; <span class="hljs-attribute">top</span>: <span class="hljs-built_in">calc</span>(<span class="hljs-number">100%</span> - <span class="hljs-number">15px</span>); <span class="hljs-attribute">right</span>: -<span class="hljs-number">10px</span>; <span class="hljs-attribute">width</span>: <span class="hljs-number">36px</span>; <span class="hljs-attribute">height</span>: <span class="hljs-number">16px</span>; <span class="hljs-attribute">transform</span>: <span class="hljs-built_in">rotate</span>(-<span class="hljs-number">45deg</span>); <span class="hljs-attribute">box-sizing</span>: border-box; <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#64d1ff</span>; <span class="hljs-attribute">mix-blend-mode</span>: multiply; <span class="hljs-comment">/* 乗算 */</span> } </code></pre> <h3 id="%E3%81%BE%E3%81%A8%E3%82%81" tabindex="-1">まとめ</h3> <p>HTMLとCSSで作成する、シンプルなデザインのフキダシを紹介しました。 CSSで実装することには、以下のようなメリットがあります。</p> <ul> <li>文字数の変化に対応しやすい</li> <li>レスポンシブウェブデザインに対応しやすい</li> <li>アニメーションがつけられる</li> </ul> <p>当記事のコードは、コピー&ペーストで自由にご活用いただけます。 お好みの色やサイズに調整して使ってみてください。</p> </section><!----></div><div class="entry-sidebar" data-v-49d92408><div class="sidebar" data-v-49d92408><ol class="sidebarList"><li class="sidebarList_item"><a href="#top">冒頭</a></li><!--[--><li data-index="0" class="sidebarList_item"><a href="#1.-%E7%B7%9A%E3%81%A8%E4%BD%99%E7%99%BD%E3%82%92%E6%B4%BB%E7%94%A8%E3%81%97%E3%81%9F%E3%83%95%E3%82%AD%E3%83%80%E3%82%B7">1. 線と余白を活用したフキダシ</a></li><li data-index="1" class="sidebarList_item sidebarList_item__sub"><a href="#1-1-%E7%B7%9A%E5%8D%8A%E5%88%86%E3%81%AE%E3%83%95%E3%82%AD%E3%83%80%E3%82%B7">1-1 線半分のフキダシ</a></li><li data-index="2" class="sidebarList_item sidebarList_item__sub"><a href="#1-2-%E4%B8%8B%E7%B7%9A-%2B-%E7%B7%9A%E3%81%AE%E3%83%95%E3%82%AD%E3%83%80%E3%82%B7">1-2 下線 + 線のフキダシ</a></li><li data-index="3" class="sidebarList_item sidebarList_item__sub"><a href="#1-3-%E4%B8%8B%E7%B7%9A-%2B-%E4%B8%89%E8%A7%92%E3%81%A4%E3%81%BE%E3%81%BF%E3%81%AE%E3%83%95%E3%82%AD%E3%83%80%E3%82%B7">1-3 下線 + 三角つまみのフキダシ</a></li><li data-index="4" class="sidebarList_item sidebarList_item__sub"><a href="#1-4-%E4%B8%8B%E7%B7%9A-%2B-%E7%B7%9A%EF%BC%88%E9%9A%99%E9%96%93%E3%81%82%E3%82%8A%EF%BC%89%E3%81%AE%E3%83%95%E3%82%AD%E3%83%80%E3%82%B7">1-4 下線 + 線(隙間あり)のフキダシ</a></li><li data-index="5" class="sidebarList_item sidebarList_item__sub"><a href="#1-5-%E4%B8%8B%E7%B7%9A-%2B-%E7%B7%9A-%2B-%E3%83%9D%E3%82%A4%E3%83%B3%E3%83%88%E3%81%AE%E3%83%95%E3%82%AD%E3%83%80%E3%82%B7">1-5 下線 + 線 + ポイントのフキダシ</a></li><li data-index="6" class="sidebarList_item sidebarList_item__sub"><a href="#1-6-%E6%9E%A0-%2B-%E4%B8%89%E8%A7%92%E3%81%A4%E3%81%BE%E3%81%BF%E3%81%AE%E3%83%95%E3%82%AD%E3%83%80%E3%82%B7">1-6 枠 + 三角つまみのフキダシ</a></li><li data-index="7" class="sidebarList_item sidebarList_item__sub"><a href="#1-7-%E6%9E%A0-%2B-%E7%B7%9A%E3%81%AE%E3%83%95%E3%82%AD%E3%83%80%E3%82%B7">1-7 枠 + 線のフキダシ</a></li><li data-index="8" class="sidebarList_item sidebarList_item__sub"><a href="#1-8-%E7%AB%8B%E4%BD%93%E6%84%9F%E3%81%AE%E3%81%82%E3%82%8B%E3%83%95%E3%82%AD%E3%83%80%E3%82%B7">1-8 立体感のあるフキダシ</a></li><li data-index="9" class="sidebarList_item sidebarList_item__sub"><a href="#1-9-%E5%86%86-%2B-%E7%B7%9A%E3%81%AE%E3%83%95%E3%82%AD%E3%83%80%E3%82%B7">1-9 円 + 線のフキダシ</a></li><li data-index="10" class="sidebarList_item sidebarList_item__sub"><a href="#1-10-%E5%86%86-%2B-%E7%B7%9A%EF%BC%88%E9%9A%99%E9%96%93%E3%81%82%E3%82%8A%EF%BC%89%E3%81%AE%E3%83%95%E3%82%AD%E3%83%80%E3%82%B7">1-10 円 + 線(隙間あり)のフキダシ</a></li><li data-index="11" class="sidebarList_item sidebarList_item__sub"><a href="#1-11-%E3%81%B5%E3%81%9F%E3%81%A4%E3%81%AE%E5%86%86-%2B-%E7%B7%9A%E3%81%AE%E3%83%95%E3%82%AD%E3%83%80%E3%82%B7">1-11 ふたつの円 + 線のフキダシ</a></li><li data-index="12" class="sidebarList_item sidebarList_item__sub"><a href="#1-12-%E4%B8%8B%E3%81%8B%E3%82%89%E5%91%BC%E3%81%B3%E3%81%8B%E3%81%91%E3%82%8B%E3%83%95%E3%82%AD%E3%83%80%E3%82%B7">1-12 下から呼びかけるフキダシ</a></li><li data-index="13" class="sidebarList_item sidebarList_item__sub"><a href="#1-13-%E6%A8%AA%E3%81%8B%E3%82%89%E5%91%BC%E3%81%B3%E3%81%8B%E3%81%91%E3%82%8B%E3%83%95%E3%82%AD%E3%83%80%E3%82%B7">1-13 横から呼びかけるフキダシ</a></li><li data-index="14" class="sidebarList_item"><a href="#2.-%E5%A1%97%E3%82%8A%E3%82%A2%E3%83%AA%E3%81%AE%E3%83%95%E3%82%AD%E3%83%80%E3%82%B7">2. 塗りアリのフキダシ</a></li><li data-index="15" class="sidebarList_item sidebarList_item__sub"><a href="#2-1-%E5%A1%97%E3%82%8A-%2B-%E4%B8%89%E8%A7%92%E3%81%A4%E3%81%BE%E3%81%BF%E3%81%AE%E3%83%95%E3%82%AD%E3%83%80%E3%82%B7">2-1 塗り + 三角つまみのフキダシ</a></li><li data-index="16" class="sidebarList_item sidebarList_item__sub"><a href="#2-2-%E3%81%97%E3%81%9A%E3%81%8F%E5%BD%A2%E3%81%AE%E3%83%95%E3%82%AD%E3%83%80%E3%82%B7">2-2 しずく形のフキダシ</a></li><li data-index="17" class="sidebarList_item sidebarList_item__sub"><a href="#2-3-%E8%83%8C%E6%99%AF%E8%89%B2%E3%81%AE%E3%81%82%E3%82%8B%E5%86%86%E3%81%AE%E3%83%95%E3%82%AD%E3%83%80%E3%82%B7">2-3 背景色のある円のフキダシ</a></li><li data-index="18" class="sidebarList_item sidebarList_item__sub"><a href="#2-4-%E3%83%9E%E3%82%B9%E3%82%AD%E3%83%B3%E3%82%B0%E3%83%86%E3%83%BC%E3%83%97%E3%81%AE%E8%B2%BC%E3%82%89%E3%82%8C%E3%81%9F%E3%83%95%E3%82%AD%E3%83%80%E3%82%B7">2-4 マスキングテープの貼られたフキダシ</a></li><li data-index="19" class="sidebarList_item"><a href="#%E3%81%BE%E3%81%A8%E3%82%81">まとめ</a></li><!--]--></ol></div></div></div></article></main><div class="wrap_960" data-v-da421125><div class="SnsButtons" data-v-da421125 data-v-b5cbd36c><p class="SnsButtons-head" data-v-b5cbd36c>\ SNSでシェアしよう /</p><div class="SnsButtons-sns" data-v-b5cbd36c><a href="https://twitter.com/intent/tweet?url=https://ics.media/entry/240425/&text=HTML%E3%83%BBCSS%E3%81%A7%E5%AE%9F%E8%A3%85%E3%81%99%E3%82%8B%E3%81%8B%E3%82%8F%E3%81%84%E3%81%84%E3%83%95%E3%82%AD%E3%83%80%E3%82%B7%E3%81%AE%E3%82%A2%E3%82%A4%E3%83%87%E3%82%A2%20-%20ICS%20MEDIA" target="_blank" class="btn btn-secondary btn-sm share-x" data-v-b5cbd36c><span data-v-b5cbd36c>X(旧Twitter)でポストする</span></a><a href="https://b.hatena.ne.jp/entry/s/ics.media/entry/240425/" target="_blank" class="btn btn-secondary btn-sm share-facebook" data-v-b5cbd36c><span data-v-b5cbd36c>はてなブックマーク</span></a></div></div><div class="author-info" data-v-da421125 style="--475ed944:staff-iwama;" data-v-9742c4dd><div class="author-avatar" data-v-9742c4dd><img src="/_assets/top/staff/ics-staff-iwama.jpg" width="64" height="64" alt="" loading="lazy" data-v-9742c4dd></div><div class="author-desc" data-v-9742c4dd><div class="author-desc-name" data-v-9742c4dd><div data-v-9742c4dd>岩間 日菜</div><div data-v-9742c4dd><!----></div></div><p class="author-desc-script" data-v-9742c4dd>フロントエンドエンジニア。学生時代はグラフィックデザインを専攻。読書と可愛いものが好きです。</p><a href="/entry/staff/iwama/" class="btn btn-secondary" data-v-9742c4dd> この担当の記事一覧 </a></div></div></div><aside class="wrap_960 banners" data-v-da421125 data-v-84d78e6a><ul data-v-84d78e6a><li data-v-84d78e6a><a href="/entry/231120/" data-v-84d78e6a><img width="1200" height="640" class="banner-img" alt="バナー:フロントエンドの知識地図" src="/_assets/top/231120_book_banner.jpg" loading="lazy" data-v-84d78e6a></a></li><li data-v-84d78e6a><a href="https://ics-web.jp/recruit/" data-v-84d78e6a><img width="1200" height="640" class="banner-img" alt="バナー:株式会社ICS 採用サイト" src="/_assets/top/190207_recruit_banner.jpg" loading="lazy" data-v-84d78e6a></a></li></ul></aside><aside class="related" data-v-da421125 data-v-c7eaaedb><div class="related-in" data-v-c7eaaedb><h3 class="related-in-head" data-v-c7eaaedb>よく一緒に読まれている記事</h3><ul class="related-in-ul" data-v-c7eaaedb><!--[--><li data-v-c7eaaedb><a href="/entry/200212/" class="" data-v-c7eaaedb><p class="related-in-ul-li-thumb" data-v-c7eaaedb><img class="related-in-ul-li-thumb-img" src="/entry/200212/images/eyecatch__480.jpg" alt width="1280" height="512" loading="lazy" style="" data-v-c7eaaedb></p><p class="related-in-ul-li-title" data-v-c7eaaedb>1歩踏み込んでみる! CSSグラデーションのマニアックな世界</p></a></li><li data-v-c7eaaedb><a href="/entry/230629/" class="" data-v-c7eaaedb><p class="related-in-ul-li-thumb" data-v-c7eaaedb><img class="related-in-ul-li-thumb-img" src="/entry/230629/images/eyecatch__480.png" alt width="1280" height="512" loading="lazy" style="" data-v-c7eaaedb></p><p class="related-in-ul-li-title" data-v-c7eaaedb>シンプルで使いやすいHTML・CSSボタンデザイン集11選</p></a></li><li data-v-c7eaaedb><a href="/entry/230123/" class="" data-v-c7eaaedb><p class="related-in-ul-li-thumb" data-v-c7eaaedb><img class="related-in-ul-li-thumb-img" src="/entry/230123/images/eyecatch__480.png" alt width="1280" height="512" loading="lazy" style="" data-v-c7eaaedb></p><p class="related-in-ul-li-title" data-v-c7eaaedb>CSSで下線を引く方法まとめ - 様々な装飾方法とアニメーションに適した指定まで</p></a></li><li data-v-c7eaaedb><a href="/entry/15130/" class="" data-v-c7eaaedb><p class="related-in-ul-li-thumb" data-v-c7eaaedb><img class="related-in-ul-li-thumb-img" src="/entry/15130/images/eyecatch__480.png" alt width="1280" height="512" loading="lazy" style="" data-v-c7eaaedb></p><p class="related-in-ul-li-title" data-v-c7eaaedb>CSSアニメーションで実現! コピペで使えるマイクロインタラクション</p></a></li><li data-v-c7eaaedb><a href="/entry/221208/" class="" data-v-c7eaaedb><p class="related-in-ul-li-thumb" data-v-c7eaaedb><img class="related-in-ul-li-thumb-img" src="/entry/221208/images/eyecatch__480.png" alt width="1280" height="512" loading="lazy" style="" data-v-c7eaaedb></p><p class="related-in-ul-li-title" data-v-c7eaaedb>リンク/ボタン/フォームをより良くするHTML・CSS 17選</p></a></li><li data-v-c7eaaedb><a href="/entry/220602/" class="" data-v-c7eaaedb><p class="related-in-ul-li-thumb" data-v-c7eaaedb><img class="related-in-ul-li-thumb-img" src="/entry/220602/images/eyecatch__480.png" alt width="1280" height="512" loading="lazy" style="" data-v-c7eaaedb></p><p class="related-in-ul-li-title" data-v-c7eaaedb>backgruond-imageを使ったCSSのアニメーションテクニック</p></a></li><li data-v-c7eaaedb><a href="/entry/220126/" class="" data-v-c7eaaedb><p class="related-in-ul-li-thumb" data-v-c7eaaedb><img class="related-in-ul-li-thumb-img" src="/entry/220126/images/eyecatch__480.jpg" alt width="1280" height="512" loading="lazy" style="" data-v-c7eaaedb></p><p class="related-in-ul-li-title" data-v-c7eaaedb>HTML・CSSのおさらい! アイコンとテキストを横並びに配置する方法まとめ</p></a></li><li data-v-c7eaaedb><a href="/entry/230327/" class="" data-v-c7eaaedb><p class="related-in-ul-li-thumb" data-v-c7eaaedb><img class="related-in-ul-li-thumb-img" src="/entry/230327/images/eyecatch__480.png" alt width="1280" height="512" loading="lazy" style="" data-v-c7eaaedb></p><p class="related-in-ul-li-title" data-v-c7eaaedb>CSSのoffsetプロパティで、楽しいパスアニメーションを作ろう</p></a></li><!--]--></ul></div></aside><div class="top_link" data-v-da421125><a href="/" class="btn btn-primary" data-v-da421125>トップページに戻る</a></div><div class="header-breadcrumb" data-v-da421125 data-v-b934bba3><div class="header-breadcrumb__inner" data-v-b934bba3><ul itemscope itemtype="http://schema.org/BreadcrumbList" data-v-b934bba3><!--[--><li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem" data-v-b934bba3><a href="/" class="" itemprop="item" data-v-b934bba3><span itemprop="name" data-v-b934bba3>ICS MEDIA</span><meta itemprop="position" content="1" data-v-b934bba3></a></li><li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem" data-v-b934bba3><a href="/entry/category/html5/" class="" itemprop="item" data-v-b934bba3><span itemprop="name" data-v-b934bba3>HTMLコーダー</span><meta itemprop="position" content="2" data-v-b934bba3></a></li><li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem" data-v-b934bba3><a aria-current="page" href="/entry/240425/" class="router-link-active router-link-exact-active" itemprop="item" data-v-b934bba3><span itemprop="name" data-v-b934bba3>HTML・CSSで実装するかわいいフキダシのアイデア</span><meta itemprop="position" content="3" data-v-b934bba3></a></li><!--]--></ul></div></div></div><!--]--><footer class="site_info" data-v-53af800e data-v-63cb43db><div class="site_info-sections" data-v-63cb43db><div class="site_info-sections_item" data-v-63cb43db><h3 data-v-63cb43db>このサイトについて</h3><p data-v-63cb43db><ruby data-v-63cb43db>ICS MEDIA<rt data-v-63cb43db>アイシーエス メディア</rt></ruby>は株式会社<ruby data-v-63cb43db>ICS<rt data-v-63cb43db>アイシーエス</rt></ruby>が運営する<strong title="ICS MEDIAはブログではありません" data-v-63cb43db>オウンドメディア</strong>です。UIデザインやフロントエンドのノウハウや最新技術を掲載しています。UIデザインやフロントエンドのノウハウや最新技術を週1回のペースで掲載しています。 </p><ul data-v-63cb43db><li data-v-63cb43db><a href="/entry/about/" class="" data-v-63cb43db>About</a></li><li data-v-63cb43db><a href="https://docs.google.com/forms/d/e/1FAIpQLSdxYknUt8noNJjuuxAIFgnyNL13XpL4MuwQoOrU_inUz8MhGg/viewform?usp=sf_link" target="_blank" data-v-63cb43db> 記事に関するお問い合わせ </a></li></ul></div><div class="site_info-sections_item" data-v-63cb43db><h3 data-v-63cb43db>運営会社について</h3><p data-v-63cb43db> ICSはインタラクションデザイン専門のウェブ制作会社。最先端のウェブテクノロジーを駆使し、オンスクリーンメディアの表現分野で活動しています。 </p><ul data-v-63cb43db><li data-v-63cb43db><a href="https://ics-web.jp/" target="_blank" data-v-63cb43db> 会社サイト </a></li><li data-v-63cb43db><a href="https://ics-web.jp/contact/" target="_blank" data-v-63cb43db> 会社へのお問い合わせ<br class="tablet" data-v-63cb43db>(仕事の相談等) </a></li></ul><p data-v-63cb43db> インタラクションコンテンツの制作に挑戦しながら、互いにスキルを高め合えるスタッフをICSでは募集しています。 </p><ul data-v-63cb43db><li data-v-63cb43db><a href="https://ics-web.jp/recruit/" rel="noopener noreferrer" data-v-63cb43db>採用情報について</a></li></ul></div><div class="site_info-sections_item" data-v-63cb43db><h3 data-v-63cb43db>常に鮮度の高い情報を</h3><p data-v-63cb43db> ICS MEDIAは古い記事でもメンテナンスし続けることで、常に役立つ情報発信を目指しています。 </p><ul data-v-63cb43db><li data-v-63cb43db><a href="/entry/all/" class="" data-v-63cb43db> すべての記事 </a></li><li data-v-63cb43db><a href="/feed/atom.xml" target="_blank" title="ICS MEDIAのRSSをリーダーに登録しよう" data-v-63cb43db> RSS </a></li><li data-v-63cb43db><a href="https://x.com/icsweb" target="_blank" title="ICSのXをフォローしよう" data-v-63cb43db> Xアカウント </a></li></ul></div></div><div class="copyright" role="contentinfo" data-v-63cb43db data-v-4b34f398> Copyright © 2025 <span itemScope="" itemProp="publisher" itemType="https://schema.org/Organization" data-v-4b34f398> ICS INC. </span><br class="mobile" data-v-4b34f398> All Rights Reserved. <br data-v-4b34f398><span class="raw-pages" data-v-4b34f398><div class="raw-pages-item" data-v-4b34f398><a href="/entry/copyright/" class="" data-v-4b34f398>利用規約・免責・著作権</a></div><div class="raw-pages-item" data-v-4b34f398><a href="/entry/privacy/" class="" data-v-4b34f398>プライバシーポリシー</a></div><div class="raw-pages-item" data-v-4b34f398><a href="/entry/quality/" class="" data-v-4b34f398>品質への取り組み</a></div></span></div></footer></div></div><div id="teleports"></div><script type="application/json" id="__NUXT_DATA__" data-ssr="true">[["ShallowReactive",1],{"data":2,"state":4,"once":6,"_errors":7,"serverRendered":9,"path":10,"prerenderedAt":11,"pinia":12},["ShallowReactive",3],{},["Reactive",5],{},["Set"],["ShallowReactive",8],{},true,"/entry/240425/",1743653744566,["Reactive",13],{"page":14,"transition":20},{"id":15,"title":16,"type":17,"line":18,"useHero":19},"html5","","top","category",false,{"current":16}]</script> <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/",buildId:"49209609-0f80-4f2c-859f-f6c413dc2b6c",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>