css3チャットバブルスタイル

php中世界最好的语言
リリース: 2018-03-16 14:23:04
オリジナル
5310 人が閲覧しました

今回はcss3チャットバブルスタイルをお届けします。css3チャットバブルスタイルを作成する際の注意点は何ですか?実際の事例を見てみましょう。

チャットシーンでは、以下に示すように、チャットの内容をバブルで変更する必要があります。以下で一つずつ説明していきましょう。

写真スタイル:

最初のスタイルはJDカスタマーサービスです。バブルの丸い角とフックはすべて写真で作られています。テーブルを使用して丸いフレームを形成します。 lm スタイルでフックを説明します。

 

                

                                                                                                                     

很抱歉,现在人工客服忙,让小JIMI为您解答吧。

            

            

                

                    

                

                
你好,我是stoneniqiu
            

ログイン後にコピー

スタイル:

 .jimi_lists {
    margin: 0 -10px 20px 10px;
    position: relative;
}
 .jimi_lists .header_img.jimi3 {
    background: url(../img/jimi_50_3.png) no-repeat 0 0;
}
 .jimi_lists .header_img {
    width: 50px;
    height: 50px;
    position: absolute;
    top: 0;
    left: 0;
}.fl {
    float: left;
}
 .jimi_lists .msg {
    margin-left: 59px;
    margin-right: 40px;
    margin-top: 2px;
    float: left;
    display: inline;
}
 .jimi_lists .lt {
    background: url(../img/msg_bg_lr.png) no-repeat 0 0;
    width: 26px;
    height: 10px;
}
 .jimi_lists .tt {
    background: url(../img/msg_bg_tb.png) repeat-x 0 -23px;
    height: 10px;
}.jimi_lists .rt {
    background: url(../img/msg_bg_lr.png) no-repeat -35px 0;
    width: 10px;
    height: 10px;
}.jimi_lists .lm {
    background: url(../img/msg_bg_lr.png) repeat-y -94px 0;
    width: 26px;
    vertical-align: top;
    position: relative;
}.jimi_lists .mm {
    padding: 0 5px;
    background-color: #FFF;
    word-break: break-all;
    word-wrap: break-word;
    color: #333;
    line-height: 20px;
}.jimi_lists .lm span {
    background: url(../img/msg_bg_lr.png) no-repeat 0 -14px;
    display: inline-block;
    width: 26px;
    height: 16px;
    position: absolute;
    top: 5px;
}.jimi_lists .rm {
    background: url(../img/msg_bg_lr.png) repeat-y -113px 0;
    width: 10px;
}.jimi_lists .lb {
    background: url(../img/msg_bg_lr.png) no-repeat 0 -43px;
    width: 10px;
    height: 10px;
}.jimi_lists .bm {
    background: url(../img/msg_bg_tb.png) repeat-x 0 -25px;
    height: 10px;
}.jimi_lists .rb {
    background: url(../img/msg_bg_lr.png) no-repeat -35px -43px;
    width: 10px;
    height: 10px;
}.customer_lists {
    position: relative;
    margin: 0 12px 20px 20px;
}.customer_lists .msg {
    float: right;
    margin-right: 73px;
    _margin-right: 38px;
    margin-top: 2px;
}.customer_lists .lt {
    background: url(../img/msg_bg_lr.png) no-repeat -47px -0;
    width: 10px;
    height: 10px;
}.customer_lists .tt {
    background: url(../img/msg_bg_tb.png) repeat-x 0 0;
    height: 10px;
}.customer_lists .rt {
    background: url(../img/msg_bg_lr.png) no-repeat -63px 0;
    width: 26px;
    height: 10px;
}.customer_lists .lm {
    background: url(../img/msg_bg_lr.png) repeat-y -126px 0;
    width: 10px;
}.customer_lists .mm {
    padding: 1px 8px;
    background-color: #3897E7;
    word-break: break-all;
    word-wrap: break-word;
    color: #FFF;
}.customer_lists .rm {
    background: url(../img/msg_bg_lr.png) repeat-y -129px 0;
    width: 26px;
    vertical-align: top;
    position: relative;
}.customer_lists .lb {
    background: url(../img/msg_bg_lr.png) no-repeat -47px -36px;
    width: 10px;
    height: 10px;
}.customer_lists .bm {
    background: url(../img/msg_bg_tb.png) repeat-x -106px -4px;
    height: 10px;
}.customer_lists .rb {
    background: url(../img/msg_bg_lr.png) no-repeat -63px -36px;
    width: 26px;
    height: 10px;
}.customer_lists .rm span {
    background: url(../img/msg_bg_lr.png) no-repeat -63px -14px;
    display: inline-block;
    width: 26px;
    height: 16px;
    position: absolute;
    top: 5px;
}.customer_lists .header_img_hover {
    position: absolute;
    background: url(../img/avatar_mask_01.png);
    top: 0;
    width: 50px;
    height: 50px;
}.customer_lists .header_img {
    position: absolute;
    top: 0;
    right: 14px;
    width: 50px;
    height: 50px;
}
 .clearfix:after {
    content: " .";
    display: block;
    clear: both;
    visibility: hidden;
    height: 0;
}
ログイン後にコピー

コード表示

背景スタイル:

2 番目のものは主に、疑似クラスの前で三角形を描画し、位置決めを使用して三角形をまとめます。

  

                

                

                     

换个气泡如何

                

            

            

                

                    

                

                

                    

这个不错

                

            

ログイン後にコピー

スタイル:

  .bkbubble.right p:before, .bkbubble.left p:before {
      width: 0;
    position: absolute;
    top: 12px;
    border-style: solid;
    content: "";
  }
  .bkbubble.left {
      text-align: right;
  }
 .bkbubble.right p:before {
     left: -12px;
    border-color: transparent #00bfff;
    border-width: 0 12px 12px 0; }
 .bkbubble.left p:before {
     right: -12px;
    border-color: transparent #00bfff;
    border-width: 0 0 12px 12px ; }
ログイン後にコピー

その他の三角形: http://www.cnblogs.com/lhb25/p/css-and-css3-triangle.html

境界線のスタイル:

境界線の色と背景色が異なる場合必須 同じですか? :before を使用して三角形を描画する場合、上記の方法は機能しません。つまり、上記の方法では、バブルの端にある小さな三角形には 2 つの色が表示されません。これは、境界線が 1 つしかないためです。 。 色。次に、境界線のある三角形を作成する方法を見つけなければなりません。

  

                

                

您好,请问有什么可以帮到您?

                

            

ログイン後にコピー

1. まず小さな長方形を描きます。

.lim_operator .lim_tale {
    left: -1px;
    background-color: #c8f064;
    border-color: #a5d01b;
    margin-left: 70px;
}.lim_tale {
    position: absolute;
    width: 12px;
    height: 8px;
    overflow: hidden !important;
    top: 10px;
    z-index: 2;
    border-top-style: solid;
    border-top-width: 1px;
}
ログイン後にコピー

2. 対角線を描きます。

CSS にはスラッシュはありません。ここでは円弧を使用して記述しています。大きな円では、円弧を横切るのが対角線になります。

.lim_operator .radiusborder {
    position: absolute;
    background-color: #EFF0F2;
    top: -29px;
    left: -94px;
    height: 160px;
    width: 160px;
    border-top-style: solid;
    border-top-width: 1px;
    border-right-style: solid;
    border-right-width: 1px;
    border-top-right-radius: 154px;
    border-color: #a5d01b;
}
ログイン後にコピー

オーバーレイタイプ:

原理は、beforeを使用して色付きの背景を描画し、次にafterを使用して白い背景を描画し、上部の1〜2ピクセルをオーバーレイしてずらして配置することと同じです。背景が表示されます。これが Web WeChat のやり方です

.expression:before {
    content: '';
    position: absolute;
    left: 16px;
    top: 100%;
    margin-left: -7px;
    border: 7px solid transparent;
    border-top-color: #CFCFCF}.expression:after {
    content: '';
    position: absolute;
    left: 16px;
    top: 100%;
    margin-left: -7px;
    margin-top: -1px;
    border: 7px solid transparent;
    border-top-color: #FFF}
ログイン後にコピー

この記事の事例を読んだ後は、この方法を習得したと思います。さらに興味深い情報については、php 中国語 Web サイトの他の関連記事に注目してください。

推奨読書:

JavaScriptのvarとthis、{}とfunction

ss3のグラデーションの使い方

以上がcss3チャットバブルスタイルの詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。

関連ラベル:
ソース:php.cn
このウェブサイトの声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。
最新の問題
人気のチュートリアル
詳細>
最新のダウンロード
詳細>
ウェブエフェクト
公式サイト
サイト素材
フロントエンドテンプレート
私たちについて 免責事項 Sitemap
PHP中国語ウェブサイト:福祉オンライン PHP トレーニング,PHP 学習者の迅速な成長を支援します!