お疲れさまです。
チャットサービスを作っているものですが、ユーザーが送信した内容を表示することはできました。
しかし、自分のコメントだけ右寄せにしたいです。
そこでいろいろ試しているのですがなかなか実装できません。
右寄せできない原因がわかる方いらっしゃいましたら、ご回答お願いします。
表示がめんでいう、hayashiyuugoのコメントが右寄せできたら成功です。
宜しくお願いします。。
以下、HTML
<div class="right_text"><!--右寄せの処理--><!--right_textエリアの開始--> <dl> <dt><img src="registrationimage/member_picture/<?php print(htmlspecialchars($row['picture'], ENT_QUOTES));?>" width="40" height="40"></dt> <dd id="<?php print(htmlspecialchars($row['name'], ENT_QUOTES));?>"><?php print(htmlspecialchars($row['name'], ENT_QUOTES)); ?></dd> <dd><?php print(htmlspecialchars($row['message'], ENT_QUOTES)); ?><span><?php print(htmlspecialchars($dt, ENT_QUOTES));?><span></dd> </dl> </div><!--right_textエリアの終了--->
以下、CSS
/*右寄せの処理*/ .right_text{/*message*/ position: relative; margin:35px 0 50px 50px; padding:10px 10px 10px 10px; border-radius: 10px; background: #30e852; max-width:250px; display: table; } .right_text :after{/*吹き出し*/ content: ""; display: inline-block; position: absolute; top: 18px; right: -20px; border: 12px solid transparent; } .right_text span{/*時間*/ color:white; position:absolute; bottom:0px; left:-88px; font-size:0.8em; } .right_text dt{/*プロフィール画像*/ position:absolute; top:0; right:-45px; } .right_text dt img{/*画像本体*/ border-radius:50%; } .right_text dd:nth-of-type(1) {/*名前*/ position:absolute; top:-25px; left:0px; color:white; font-size:0.9em; }
宜しくお願いします。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。