這篇文章主要介紹CSS怎么實(shí)現(xiàn)對(duì)話框效果,文中介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們一定要看完!
創(chuàng)新互聯(lián)公司服務(wù)緊隨時(shí)代發(fā)展步伐,進(jìn)行技術(shù)革新和技術(shù)進(jìn)步,經(jīng)過(guò)10多年的發(fā)展和積累,已經(jīng)匯集了一批資深網(wǎng)站策劃師、設(shè)計(jì)師、專業(yè)的網(wǎng)站實(shí)施團(tuán)隊(duì)以及高素質(zhì)售后服務(wù)人員,并且完全形成了一套成熟的業(yè)務(wù)流程,能夠完全依照客戶要求對(duì)網(wǎng)站進(jìn)行做網(wǎng)站、成都網(wǎng)站設(shè)計(jì)、建設(shè)、維護(hù)、更新和改版,實(shí)現(xiàn)客戶網(wǎng)站對(duì)外宣傳展示的首要目的,并為客戶企業(yè)品牌互聯(lián)網(wǎng)化提供全面的解決方案。
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>CSS實(shí)現(xiàn)對(duì)話框效果</title> <style> /*CSS實(shí)現(xiàn)對(duì)話框效果一*/ .test1{width:300px;height: 30px; padding:30px 20px; margin-left:100px; background: #eb7956; position:relative;} .test1 p{ width:0; height:0; position:absolute;} .test1 .bot{ border-width:20px; border-style:solid; border-color:#ffffff #eb7956 #eb7956 #ffffff; left:-40px; top:40px; } .test1 .top{ border-width:10px 20px; border-style:solid; border-color: transparent #ffffff #ffffff transparent ; left:-40px; top:60px; } /*CSS實(shí)現(xiàn)對(duì)話框效果二*/ .test2{width:300px; padding:30px 20px; border:5px solid #beceeb; position:relative; margin-top: 10px;} .test2 p{width:0; height:0; font-size:0; overflow:hidden; position:absolute;} .test2 p.bot{ border-width:20px; border-style:solid dashed dashed; border-color:#beceeb transparent transparent; left:80px; bottom:-40px; } .test2 p.top{ border-width:20px; border-style:solid dashed dashed; border-color:#ffffff transparent transparent; left:80px; bottom:-33px; } /*CSS實(shí)現(xiàn)對(duì)話框效果三*/ .test3{width:300px; height: 30px; border-radius: 160px/45px; padding:30px 20px; margin-left:100px; background: #eb7956; position:relative; margin-top: 10px;} .test3 p{ width:0; height:0; position:absolute;} .test3 .bot{ border-width:20px; border-style:solid; border-color:transparent #eb7956 #eb7956 transparent; left:-30px; top:40px; } .test3 .top{ border-width:10px 20px; border-style:solid; border-color: transparent #ffffff #ffffff transparent ; left:-30px; top:60px; } </style> </head> <body> <p class="test1"> <p class="bot"> </p> <p class="top"> </p> CSS實(shí)現(xiàn)對(duì)話框效果一 </p> <p class="test2"> <p class="bot"></p> <p class="top"></p> CSS實(shí)現(xiàn)對(duì)話框效果e二 </p> <p class="test3"> <p class="bot"> </p> <p class="top"> </p> CSS實(shí)現(xiàn)對(duì)話框效果三 </p> </body> <!-- IE6下有些bug需要做下兼容 1. IE6的奇偶bug 如果定位外框高度或是寬度為奇數(shù),則IE6下,絕對(duì)定位元素的低定位和右定位會(huì)有1像素的誤差。所以,盡量保證外框的高度或?qū)挾葹榕紨?shù)值。 2. IE6的空p莫名高度bug IE6下,空p會(huì)有莫名的高度,也就是說(shuō)height:0;不頂用,此時(shí)形成的尖角的實(shí)際占高于其他瀏覽器是有差異的??墒褂胒ont-size:0; + overflow:hidden;修復(fù)此問(wèn)題。 3. IE6不支持實(shí)線邊框透明transparent屬性 IE6不支持實(shí)線邊框透明transparent屬性,當(dāng)某邊框設(shè)置為transparent屬性,且有寬度的話,那么透明會(huì)以默認(rèn)的黑色顯示的。解決方法有兩個(gè),一是將需要隱藏的顏色設(shè)置為背景色,這樣與透明效果一樣,此法有局限性,在復(fù)雜“邊框法”應(yīng)用下是行不通的;二是可以使用dashed代替solid,可以實(shí)現(xiàn)IE6下邊框transparent透明。 --> </html>
以上是CSS怎么實(shí)現(xiàn)對(duì)話框效果的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對(duì)大家有幫助,更多相關(guān)知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!
本文題目:CSS怎么實(shí)現(xiàn)對(duì)話框效果
轉(zhuǎn)載注明:http://bm7419.com/article40/ppheho.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供小程序開發(fā)、企業(yè)建站、網(wǎng)站收錄、關(guān)鍵詞優(yōu)化、商城網(wǎng)站、ChatGPT
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)