Create a Chatbox UI Template using HTML and CSS Last Updated : 13 Dec, 2023 Comments Improve Suggest changes Like Article Like Report Real-time chat applications are designed to provide a responsive and interactive experience, where messages are delivered and displayed immediately as they are sent. This means that users can engage in conversations and receive updates in real-time, without significant delays. In the chat application UI, received messages display left aligned and sent messages display right aligned. Also, the avatar image (or image) is displayed before the sent and received messages. Here, we will design a Chatbox UI using HTML and CSS. Example: HTML <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content= "width=device-width, initial-scale=1.0"> <style> .chat-container { max-width: 600px; margin: 50px auto; background-color: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); } .message-container { display: flex; flex-direction: column; } .message { padding: 10px; margin: 10px; border-radius: 5px; max-width: 70%; word-wrap: break-word; display: flex; align-items: center; } .sender-message { background-color: #e0e0e0; color: #000; align-self: flex-start; } .receiver-message { background-color: #4CAF50; color: #fff; align-self: flex-end; } .avatar { width: 30px; height: 30px; border-radius: 50%; margin-right: 10px; } .message input { width: calc(100% - 20px); padding: 8px; margin: 10px; border: 1px solid #ddd; border-radius: 5px; } .message button { padding: 8px; margin: 10px; background-color: #4CAF50; color: #fff; border: none; border-radius: 5px; cursor: pointer; } </style> <title>Chat Template UI using HTML and CSS</title> </head> <body> <div class="chat-container"> <div class="message-container"> <div class="message sender-message"> <img src= "https://media.geeksforgeeks.org/wp-content/uploads/20220123013311/gfg.png" alt="Sender Avatar" class="avatar"> Hello there! </div> <div class="message receiver-message"> <img src= "https://media.geeksforgeeks.org/wp-content/uploads/20210511160813/g4g.jpg" alt="Receiver Avatar" class="avatar"> Hi! How can I help you today? </div> <div class="message sender-message"> <img src= "https://media.geeksforgeeks.org/wp-content/uploads/20220123013311/gfg.png" alt="Sender Avatar" class="avatar"> I have a question about your products. </div> <div class="message receiver-message"> <img src= "https://media.geeksforgeeks.org/wp-content/uploads/20210511160813/g4g.jpg" alt="Receiver Avatar" class="avatar"> Sure, feel free to ask! </div> </div> <div class="message"> <input type="text" placeholder="Type your message..."> <button>Send</button> </div> </div> </body> </html> Output: Comment More infoAdvertise with us Next Article Create a Chatbox UI Template using HTML and CSS V vkash8574 Follow Improve Article Tags : Project Web Technologies Geeks Premier League Web Templates Geeks Premier League 2023 +1 More Similar Reads How to Create iPod Template using HTML and CSS ? The iPod template will create the look and feel of a classic iPod, with a sleek design and functional layout. The code creates a visually appealing iPod-like template with responsive design features and FontAwsome icons are used to enhance the look of the project. PreviewApproachFirst, create the st 3 min read Create ChatGPT Template using HTML CSS & JavaScript Create a customizable ChatGPT interface using HTML, CSS, and JavaScript. Implement features like message input, display area, and toggle buttons for themes. Customize styles and interactions to suit your preferences and requirements. Prerequisites:HTMLCSSJavaScriptApproachCreate a new HTML file and 7 min read How To Create an Alert Message Box using CSS? An alert message box using CSS is a styled container that displays important messages or notifications to users. It is often used for warnings, errors, or success messages, and typically includes styles like background colors, borders, and icons to attract attention.ApproachBasic Structure: Use divs 2 min read Design a Google Chrome Page Template using HTML and CSS Google Chrome Page Template is a replica of Google Chrome Page which can be built with the help of HTML and CSS. This project has fundamental features and design elements, a search option, along with using the FontAwsome Icons, and various CSS styling, which offer you hands-on experience in web desi 4 min read Design a Video Calling Website UI Template using HTML and CSS In this tutorial, we will learn the process of building a UI template for a Video Calling Website using HTML and CSS. Our goal is to create an attractive and user-friendly interface that makes video calls an enjoyable experience. The website will have a navigation bar with quick-access icons, a main 4 min read Like