CSS實現頭像右上角訊息數字提示
今天寫個簡單的小demo,關於CSS實現頭像右上角訊息數字提示,樣式如下如圖所示,在微信和扣扣訊息裡面比較常見。

<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <style> .alarm { position: relative; width: 60px; height: 60px; margin: 60px; } .alarm img { width: 60px; height: 60px; } .divright { position: absolute; color: white; font-size: 17px; background-color: red; width: 23px; height: 23px; line-height: 23px; left: 80%; top: -12px; text-align: center; -webkit-border-radius: 24px; border-radius: 24px; } </style> </head> <body> <div class="alarm"> <img src="img/1.png" /> <div class="divright"> 3 </div> </div> </body> </html>
原文作者:祈澈姑娘 技術部落格: https://www.jianshu.com/u/05f416aefbe1
90後前端妹子,愛程式設計,愛運營,文藝與程式碼齊飛,魅力與智慧共存的程式媛一枚。
堅持總結工作中遇到的技術問題,堅持記錄工作中所所思所見,對於部落格上面有不會的問題,可以加入qq技術交流群聊:649040560。