MGMtips > 固定ページ用テンプレート振り分け
WEB and GRAPHIC
CREATIBE STUDIO
© COPYRIGHT MGM DESIGN TIPS ALL RIGHTS RESERVED.
TEMPLATE
最終更新:2021/07/16
参考:http://refo.mark1974.com/
上のボタンのhtmlとcssです。
元々リフォーム工房様用に作成したボタンで、1列に3つ以上ボタンが並ぶことを想定して作成しています。
html
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
<div class="container2 res_mb"> <div class="re_bgf"> <ul> <li class="rn1"> <a href="http://mgm.moo.jp/cms010/template-page/t-iris/"> <p class="remo_jtit"><span>テンプレート/</span>アイリス</p> <p class="remo_etit"><span>TEMPLATE </span>iris</p> <p class="remo_order">0<span>1</span></p> </a> </li> <li class="rn2"> <a href="http://mgm.moo.jp/cms010/template-page/t-lig/"> <p class="remo_jtit"><span>テンプレート/</span>リグ</p> <p class="remo_etit"><span>TEMPLATE </span>lig</p> <p class="remo_order">0<span>2</span></p> </a> </li> </ul> </div> </div> |
css
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
/*re_bgf*/ .re_bgf{ position: relative; margin-right: -5px; margin-left: -5px; } .re_bgf ul{ margin-bottom: 0; display: flex; flex-wrap: wrap; width: 100%; } .re_bgf ul li{ list-style: none; margin-bottom: 10px; width: calc(50% - 10px); margin-right: 5px; margin-left: 5px; background-position: right center; background-repeat: no-repeat; background-size: cover; position: relative; min-height: 170px; } .re_bgf ul li::before{ content: " "; display: block; position: absolute; left: 0; bottom: 0; width: 100%; height: 20%; background-color: #333; transition: .3s; } .re_bgf ul li:hover::before{ height: 100%; background-color: rgba(51,51,51,0.50); } .re_bgf ul li a{ display: flex; flex-direction: column; color: #fff; position: relative; z-index: 1; height: 100%; width: 100%; padding: 20px 5%; background-color: rgba(0,0,0,0.10); } .re_bgf ul li a:hover{ text-decoration: none; } @media screen and (min-width: 768px){ .re_bgf ul li::before{ width: 35%; height: 100%; } .re_bgf ul li:hover::before{ width: 100%; } .re_bgf ul li a{ background-color: transparent; flex-direction: row; flex-wrap: wrap; align-items: center; align-content: center; padding: 0 8%; } } @media screen and (min-width: 992px){ .re_bgf{ margin-right: -15px; margin-left: -15px; } .re_bgf ul li{ list-style: none; margin-bottom: 30px; width: calc(50% - 30px); margin-right: 15px; margin-left: 15px; } } @media screen and (min-width: 1200px){ .re_bgf ul li{ width: calc(33.333% - 30px); min-height: 210px; } } /*remo_no*/ .remo_jtit{ font-size: 1.2rem; flex-grow: 1; font-weight: bold; line-height: 1.4; margin-bottom: 5px; width: 100%; } .remo_jtit span{ display: block; } .remo_etit{ font-family: 'Fjalla One', sans-serif; font-weight: 500; line-height: 1.4; margin-bottom: 5px; width: 100%; } .remo_etit span{ display: block; } .remo_order{ font-family: 'Fjalla One', sans-serif; margin-bottom: 0; padding-left: 0.4rem; font-size: 2rem; font-weight: 500; letter-spacing: 0.2rem; line-height: 1; position: relative; width: 100%; } .remo_order span{ color: #aaa; } .remo_order::before{ content: " "; display: block; width: 35px; height: 1px; background-color: #fff; margin-bottom: 5px; } @media screen and (min-width: 768px){ .remo_jtit{ font-size: 1.4rem; letter-spacing: 0.25rem; } .remo_jtit span{ display: inline; } .remo_etit{ font-size: 1.2rem; } .remo_etit span{ display: inline; } .remo_order{ padding-left: 0.2rem; font-size: 3rem; } .remo_order::before{ width: 46px; } } @media screen and (min-width: 1200px){ .remo_etit{ margin-bottom: 8px; } .remo_order::before{ margin-bottom: 8px; } } /*bgimg*/ .re_bgf ul li.rn1{ background-image: url("../images/page/remo01.jpg"); } .re_bgf ul li.rn2{ background-image: url("../images/page/remo02.jpg"); } |