WordPressで吹き出しを使用したく、ある方のサイトを参考に以下のCSSコードを追加してみました。
結果、上手く表示されたものの、吹き出しの枠の高さをもう少し低く(つまり、細長く)したいのですが、それにはどこをどう変更すれば良いのでしょうか?
初心者なので、とりあえず色々いじってみて、画像のボーダーをなくしたり、画像のサイズを変更することはできたのですが、吹き出し部分の枠のサイズの変更がどうしても出来ないでいます。
アドバイス頂けますと助かります、よろしくお願い致します。
該当のソースコード
CSS
1/*-------------------- 2 吹き出しを作る 3--------------------*/ 4.balloon { 5margin-bottom: 2em; 6position: relative; 7} 8.balloon:before,.balloon:after { 9clear: both; 10content: ""; 11display: block; 12} 13.balloon figure { 14width: 60px; 15height: 60px; 16} 17.balloon-image-left { 18float: left; 19margin-right: 20px; 20} 21.balloon-image-right { 22float: right; 23margin-left: 20px; 24} 25.balloon figure img { 26width: 100%; 27height: 100%; 28border: 1px solid #aaa; 29border-radius: 50%; 30margin: 0; 31} 32.balloon-image-description { 33padding: 5px 0 0; 34font-size: 10px; 35text-align: center; 36} 37.balloon-text-right,.balloon-text-left { 38position: relative; 39padding: 10px; 40border: 1px solid; 41border-radius: 10px; 42max-width: -webkit-calc(100% - 120px); 43max-width: calc(100% - 120px); 44display: inline-block; 45} 46.balloon-text-right { 47border-color: #aaa; 48} 49.balloon-text-left { 50border-color: #aaa; 51} 52.balloon-text-right { 53float: left; 54} 55.balloon-text-left { 56float: right; 57} 58.balloon p { 59margin: 0 0 20px; 60} 61.balloon p:last-child { 62margin-bottom: 0; 63} 64/* 三角部分 */ 65.balloon-text-right:before { 66position: absolute; 67content: ''; 68border: 10px solid transparent; 69border-right: 10px solid #aaa; 70top: 15px; 71left: -20px; 72} 73.balloon-text-right:after { 74position: absolute; 75content: ''; 76border: 10px solid transparent; 77border-right: 10px solid #fff; 78top: 15px; 79left: -19px; 80} 81.balloon-text-left:before { 82position: absolute; 83content: ''; 84border: 10px solid transparent; 85border-left: 10px solid #aaa; 86top: 15px; 87right: -20px; 88} 89.balloon-text-left:after { 90position: absolute; 91content: ''; 92border: 10px solid transparent; 93border-left: 10px solid #fff; 94top: 15px; 95right: -19px; 96} 97/* 考え毎 */ 98.think .balloon-text-right,.think .balloon-text-left { 99border-radius: 30px; 100} 101.think .balloon-text-right:before { 102border: 1px solid #aaa; 103border-radius: 50%; 104width: 8px; 105height: 8px; 106top: 15px; 107left: -12px; 108} 109.think .balloon-text-right:after { 110border: 1px solid #aaa; 111border-radius: 50%; 112width: 4px; 113height: 4px; 114top: 20px; 115left: -19px; 116} 117.think .balloon-text-left:before { 118border: 1px solid #aaa; 119border-radius: 50%; 120width: 8px; 121height: 8px; 122top: 15px; 123right: -12px; 124} 125.think .balloon-text-left:after { 126border: 1px solid #aaa; 127border-radius: 50%; 128width: 4px; 129height: 4px; 130top: 20px; 131right: -19px; 132}
HTML
1<div class="balloon"> <figure class="balloon-image-left"> <img src="dummy.jpg" alt="dummy"> <figcaption class="balloon-image-description">名前</figcaption> </figure> <div class="balloon-text-right"> <p>吹き出しテキスト</p> </div> </div>
回答1件
あなたの回答
tips
プレビュー