{"id":10592,"date":"2024-03-03T10:30:00","date_gmt":"2024-03-03T10:30:00","guid":{"rendered":"https:\/\/codehim.com\/?p=10592"},"modified":"2024-03-04T08:30:43","modified_gmt":"2024-03-04T03:30:43","slug":"floating-chat-box-ui-in-html-css","status":"publish","type":"post","link":"https:\/\/codehim.com\/forms\/floating-chat-box-ui-in-html-css\/","title":{"rendered":"Floating Chat Box UI in HTML CSS"},"content":{"rendered":"<p>This HTML and CSS code snippet helps you to create a chat box UI with toggle functionality. Users can send messages, and the chat logs automatically scroll to the bottom for easy tracking. The UI includes a ChatBot with a close option. Helpful for implementing a user-friendly chat feature on websites.<\/p>\n<h2>How to Create Floating Chat Box UI in HTML CSS<\/h2>\n<p>1. First of all, load the <a href=\"https:\/\/getbootstrap.com\/\" target=\"_blank\" rel=\"noopener\">Bootstrap<\/a> and <a href=\"https:\/\/fonts.google.com\/icons?selected=Material+Icons\" target=\"_blank\" rel=\"noopener\">Material Icons CSS<\/a> by adding the following CDN links into the head tag of your HTML document.<\/p>\n<pre class=\"prettyprint linenums lang-html\">&lt;link rel='stylesheet' href='https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/twitter-bootstrap\/4.0.0-alpha.6\/css\/bootstrap.min.css'&gt;\r\n&lt;link rel='stylesheet' href='https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/bootstrap-material-design\/4.0.2\/bootstrap-material-design.css'&gt;\r\n&lt;link rel='stylesheet' href='https:\/\/fonts.googleapis.com\/icon?family=Material+Icons'&gt;\r\n<\/pre>\n<p>2. After that, create the HTML structure. Copy and paste the provided HTML code into your HTML file. This code defines the chat box layout, including the chat circle button and the chat logs.<\/p>\n<pre class=\"prettyprint linenums lang-html\">&lt;div id=\"center-text\"&gt;\r\n    &lt;h2&gt;ChatBox UI&lt;\/h2&gt;\r\n    &lt;p&gt;Message send and scroll to bottom enabled &lt;\/p&gt;\r\n  &lt;\/div&gt; \r\n&lt;div id=\"body\"&gt; \r\n  \r\n&lt;div id=\"chat-circle\" class=\"btn btn-raised\"&gt;\r\n        &lt;div id=\"chat-overlay\"&gt;&lt;\/div&gt;\r\n\t\t    &lt;i class=\"material-icons\"&gt;speaker_phone&lt;\/i&gt;\r\n\t&lt;\/div&gt;\r\n  \r\n  &lt;div class=\"chat-box\"&gt;\r\n    &lt;div class=\"chat-box-header\"&gt;\r\n      ChatBot\r\n      &lt;span class=\"chat-box-toggle\"&gt;&lt;i class=\"material-icons\"&gt;close&lt;\/i&gt;&lt;\/span&gt;\r\n    &lt;\/div&gt;\r\n    &lt;div class=\"chat-box-body\"&gt;\r\n      &lt;div class=\"chat-box-overlay\"&gt;   \r\n      &lt;\/div&gt;\r\n      &lt;div class=\"chat-logs\"&gt;\r\n       \r\n      &lt;\/div&gt;&lt;!--chat-log --&gt;\r\n    &lt;\/div&gt;\r\n    &lt;div class=\"chat-input\"&gt;      \r\n      &lt;form&gt;\r\n        &lt;input type=\"text\" id=\"chat-input\" placeholder=\"Send a message...\"\/&gt;\r\n      &lt;button type=\"submit\" class=\"chat-submit\" id=\"chat-submit\"&gt;&lt;i class=\"material-icons\"&gt;send&lt;\/i&gt;&lt;\/button&gt;\r\n      &lt;\/form&gt;      \r\n    &lt;\/div&gt;\r\n  &lt;\/div&gt;\r\n&lt;\/div&gt;<\/pre>\n<p>3. Copy and paste the CSS code into your stylesheet or within a <code>&lt;style&gt;<\/code> tag in your HTML file. This CSS code styles the chat box, giving it a visually appealing and responsive design. Feel free to customize the colors, dimensions, or any other styles according to your preferences.<\/p>\n<pre class=\"prettyprint linenums lang-css\">html, body {\r\n  background: #efefef;      \r\n  height:100%;  \r\n}\r\n#center-text {          \r\n  display: flex;\r\n  flex: 1;\r\n  flex-direction:column; \r\n  justify-content: center;\r\n  align-items: center;  \r\n  height:100%;\r\n  \r\n}\r\n#chat-circle {\r\n  position: fixed;\r\n  bottom: 50px;\r\n  right: 50px;\r\n  background: #5A5EB9;\r\n  width: 80px;\r\n  height: 80px;  \r\n  border-radius: 50%;\r\n  color: white;\r\n  padding: 28px;\r\n  cursor: pointer;\r\n  box-shadow: 0px 3px 16px 0px rgba(0, 0, 0, 0.6), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12);\r\n}\r\n\r\n.btn#my-btn {\r\n     background: white;\r\n    padding-top: 13px;\r\n    padding-bottom: 12px;\r\n    border-radius: 45px;\r\n    padding-right: 40px;\r\n    padding-left: 40px;\r\n    color: #5865C3;\r\n}\r\n#chat-overlay {\r\n    background: rgba(255,255,255,0.1);\r\n    position: absolute;\r\n    top: 0;\r\n    left: 0;\r\n    width: 100%;\r\n    height: 100%;\r\n    border-radius: 50%;\r\n    display: none;\r\n}\r\n\r\n\r\n.chat-box {\r\n  display:none;\r\n  background: #efefef;\r\n  position:fixed;\r\n  right:30px;\r\n  bottom:50px;  \r\n  width:350px;\r\n  max-width: 85vw;\r\n  max-height:100vh;\r\n  border-radius:5px;  \r\n\/*   box-shadow: 0px 5px 35px 9px #464a92; *\/\r\n  box-shadow: 0px 5px 35px 9px #ccc;\r\n}\r\n.chat-box-toggle {\r\n  float:right;\r\n  margin-right:15px;\r\n  cursor:pointer;\r\n}\r\n.chat-box-header {\r\n  background: #5A5EB9;\r\n  height:70px;\r\n  border-top-left-radius:5px;\r\n  border-top-right-radius:5px; \r\n  color:white;\r\n  text-align:center;\r\n  font-size:20px;\r\n  padding-top:17px;\r\n}\r\n.chat-box-body {\r\n  position: relative;  \r\n  height:370px;  \r\n  height:auto;\r\n  border:1px solid #ccc;  \r\n  overflow: hidden;\r\n}\r\n.chat-box-body:after {\r\n  content: \"\";\r\n  background-image: url('data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgdmlld0JveD0iMCAwIDIwMCAyMDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAgOCkiIGZpbGw9Im5vbmUiIG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bottom: 0;\r\n  right: 0;\r\n  height:100%;\r\n  position: absolute;\r\n  z-index: -1;   \r\n}\r\n#chat-input {\r\n  background: #f4f7f9;\r\n  width:100%; \r\n  position:relative;\r\n  height:47px;  \r\n  padding-top:10px;\r\n  padding-right:50px;\r\n  padding-bottom:10px;\r\n  padding-left:15px;\r\n  border:none;\r\n  resize:none;\r\n  outline:none;\r\n  border:1px solid #ccc;\r\n  color:#888;\r\n  border-top:none;\r\n  border-bottom-right-radius:5px;\r\n  border-bottom-left-radius:5px;\r\n  overflow:hidden;  \r\n}\r\n.chat-input &gt; form {\r\n    margin-bottom: 0;\r\n}\r\n#chat-input::-webkit-input-placeholder { \/* Chrome\/Opera\/Safari *\/\r\n  color: #ccc;\r\n}\r\n#chat-input::-moz-placeholder { \/* Firefox 19+ *\/\r\n  color: #ccc;\r\n}\r\n#chat-input:-ms-input-placeholder { \/* IE 10+ *\/\r\n  color: #ccc;\r\n}\r\n#chat-input:-moz-placeholder { \/* Firefox 18- *\/\r\n  color: #ccc;\r\n}\r\n.chat-submit {  \r\n  position:absolute;\r\n  bottom:3px;\r\n  right:10px;\r\n  background: transparent;\r\n  box-shadow:none;\r\n  border:none;\r\n  border-radius:50%;\r\n  color:#5A5EB9;\r\n  width:35px;\r\n  height:35px;  \r\n}\r\n.chat-logs {\r\n  padding:15px; \r\n  height:370px;\r\n  overflow-y:scroll;\r\n}\r\n\r\n.chat-logs::-webkit-scrollbar-track\r\n{\r\n\t-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);\r\n\tbackground-color: #F5F5F5;\r\n}\r\n\r\n.chat-logs::-webkit-scrollbar\r\n{\r\n\twidth: 5px;  \r\n\tbackground-color: #F5F5F5;\r\n}\r\n\r\n.chat-logs::-webkit-scrollbar-thumb\r\n{\r\n\tbackground-color: #5A5EB9;\r\n}\r\n\r\n\r\n\r\n@media only screen and (max-width: 500px) {\r\n   .chat-logs {\r\n        height:40vh;\r\n    }\r\n}\r\n\r\n.chat-msg.user &gt; .msg-avatar img {\r\n  width:45px;\r\n  height:45px;\r\n  border-radius:50%;\r\n  float:left;\r\n  width:15%;\r\n}\r\n.chat-msg.self &gt; .msg-avatar img {\r\n  width:45px;\r\n  height:45px;\r\n  border-radius:50%;\r\n  float:right;\r\n  width:15%;\r\n}\r\n.cm-msg-text {\r\n  background:white;\r\n  padding:10px 15px 10px 15px;  \r\n  color:#666;\r\n  max-width:75%;\r\n  float:left;\r\n  margin-left:10px; \r\n  position:relative;\r\n  margin-bottom:20px;\r\n  border-radius:30px;\r\n}\r\n.chat-msg {\r\n  clear:both;    \r\n}\r\n.chat-msg.self &gt; .cm-msg-text {  \r\n  float:right;\r\n  margin-right:10px;\r\n  background: #5A5EB9;\r\n  color:white;\r\n}\r\n.cm-msg-button&gt;ul&gt;li {\r\n  list-style:none;\r\n  float:left;\r\n  width:50%;\r\n}\r\n.cm-msg-button {\r\n    clear: both;\r\n    margin-bottom: 70px;\r\n}<\/pre>\n<p>4. Now, load the<a href=\"https:\/\/jquery.com\" target=\"_blank\" rel=\"noopener\"> jQuery<\/a> and Bootstrap JS by adding the following CDN links just before closing the body element:<\/p>\n<pre class=\"prettyprint linenums lang-html\">&lt;script src='https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/jquery\/3.1.1\/jquery.min.js'&gt;&lt;\/script&gt;\r\n&lt;script src='https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/twitter-bootstrap\/4.0.0-alpha.6\/js\/bootstrap.min.js'&gt;&lt;\/script&gt;<\/pre>\n<p>5. Finally, include the following JavaScript code in your HTML file or an external script. This code adds interactivity to the chat box. Users can submit messages, and the chat logs automatically scroll to show the latest messages. The code also includes a ChatBot feature with buttons for different user actions.<\/p>\n<pre class=\"prettyprint linenums lang-js\">$(function() {\r\n  var INDEX = 0; \r\n  $(\"#chat-submit\").click(function(e) {\r\n    e.preventDefault();\r\n    var msg = $(\"#chat-input\").val(); \r\n    if(msg.trim() == ''){\r\n      return false;\r\n    }\r\n    generate_message(msg, 'self');\r\n    var buttons = [\r\n        {\r\n          name: 'Existing User',\r\n          value: 'existing'\r\n        },\r\n        {\r\n          name: 'New User',\r\n          value: 'new'\r\n        }\r\n      ];\r\n    setTimeout(function() {      \r\n      generate_message(msg, 'user');  \r\n    }, 1000)\r\n    \r\n  })\r\n  \r\n  function generate_message(msg, type) {\r\n    INDEX++;\r\n    var str=\"\";\r\n    str += \"&lt;div id='cm-msg-\"+INDEX+\"' class=\\\"chat-msg \"+type+\"\\\"&gt;\";\r\n    str += \"          &lt;span class=\\\"msg-avatar\\\"&gt;\";\r\n    str += \"            &lt;img src=\\\"https:\\\/\\\/image.crisp.im\\\/avatar\\\/operator\\\/196af8cc-f6ad-4ef7-afd1-c45d5231387c\\\/240\\\/?1483361727745\\\"&gt;\";\r\n    str += \"          &lt;\\\/span&gt;\";\r\n    str += \"          &lt;div class=\\\"cm-msg-text\\\"&gt;\";\r\n    str += msg;\r\n    str += \"          &lt;\\\/div&gt;\";\r\n    str += \"        &lt;\\\/div&gt;\";\r\n    $(\".chat-logs\").append(str);\r\n    $(\"#cm-msg-\"+INDEX).hide().fadeIn(300);\r\n    if(type == 'self'){\r\n     $(\"#chat-input\").val(''); \r\n    }    \r\n    $(\".chat-logs\").stop().animate({ scrollTop: $(\".chat-logs\")[0].scrollHeight}, 1000);    \r\n  }  \r\n  \r\n  function generate_button_message(msg, buttons){    \r\n    \/* Buttons should be object array \r\n      [\r\n        {\r\n          name: 'Existing User',\r\n          value: 'existing'\r\n        },\r\n        {\r\n          name: 'New User',\r\n          value: 'new'\r\n        }\r\n      ]\r\n    *\/\r\n    INDEX++;\r\n    var btn_obj = buttons.map(function(button) {\r\n       return  \"              &lt;li class=\\\"button\\\"&gt;&lt;a href=\\\"javascript:;\\\" class=\\\"btn btn-primary chat-btn\\\" chat-value=\\\"\"+button.value+\"\\\"&gt;\"+button.name+\"&lt;\\\/a&gt;&lt;\\\/li&gt;\";\r\n    }).join('');\r\n    var str=\"\";\r\n    str += \"&lt;div id='cm-msg-\"+INDEX+\"' class=\\\"chat-msg user\\\"&gt;\";\r\n    str += \"          &lt;span class=\\\"msg-avatar\\\"&gt;\";\r\n    str += \"            &lt;img src=\\\"https:\\\/\\\/image.crisp.im\\\/avatar\\\/operator\\\/196af8cc-f6ad-4ef7-afd1-c45d5231387c\\\/240\\\/?1483361727745\\\"&gt;\";\r\n    str += \"          &lt;\\\/span&gt;\";\r\n    str += \"          &lt;div class=\\\"cm-msg-text\\\"&gt;\";\r\n    str += msg;\r\n    str += \"          &lt;\\\/div&gt;\";\r\n    str += \"          &lt;div class=\\\"cm-msg-button\\\"&gt;\";\r\n    str += \"            &lt;ul&gt;\";   \r\n    str += btn_obj;\r\n    str += \"            &lt;\\\/ul&gt;\";\r\n    str += \"          &lt;\\\/div&gt;\";\r\n    str += \"        &lt;\\\/div&gt;\";\r\n    $(\".chat-logs\").append(str);\r\n    $(\"#cm-msg-\"+INDEX).hide().fadeIn(300);   \r\n    $(\".chat-logs\").stop().animate({ scrollTop: $(\".chat-logs\")[0].scrollHeight}, 1000);\r\n    $(\"#chat-input\").attr(\"disabled\", true);\r\n  }\r\n  \r\n  $(document).delegate(\".chat-btn\", \"click\", function() {\r\n    var value = $(this).attr(\"chat-value\");\r\n    var name = $(this).html();\r\n    $(\"#chat-input\").attr(\"disabled\", false);\r\n    generate_message(name, 'self');\r\n  })\r\n  \r\n  $(\"#chat-circle\").click(function() {    \r\n    $(\"#chat-circle\").toggle('scale');\r\n    $(\".chat-box\").toggle('scale');\r\n  })\r\n  \r\n  $(\".chat-box-toggle\").click(function() {\r\n    $(\"#chat-circle\").toggle('scale');\r\n    $(\".chat-box\").toggle('scale');\r\n  })\r\n  \r\n})<\/pre>\n<p>That&#8217;s all! hopefully, you have successfully created Floating Chat Box UI in HTML CSS. If you have any questions or suggestions, feel free to comment below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This HTML and CSS code snippet helps you to create a chat box UI with toggle functionality. Users can send&#8230;<\/p>\n","protected":false},"author":1,"featured_media":10594,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[232],"tags":[],"class_list":["post-10592","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-forms"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Floating Chat Box UI in HTML CSS &#8212; CodeHim<\/title>\n<meta name=\"description\" content=\"Here is a free code snippet to create a Floating Chat Box UI in HTML CSS. You can view demo and download the source code.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/codehim.com\/forms\/floating-chat-box-ui-in-html-css\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Floating Chat Box UI in HTML CSS &#8212; CodeHim\" \/>\n<meta property=\"og:description\" content=\"Here is a free code snippet to create a Floating Chat Box UI in HTML CSS. You can view demo and download the source code.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/codehim.com\/forms\/floating-chat-box-ui-in-html-css\/\" \/>\n<meta property=\"og:site_name\" content=\"CodeHim\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/codehimofficial\" \/>\n<meta property=\"article:published_time\" content=\"2024-03-03T10:30:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-04T03:30:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/codehim.com\/wp-content\/uploads\/2024\/01\/Floating-Chat-Box-UI-in-HTML-CSS.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"980\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Asif Mughal\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@CodeHimOfficial\" \/>\n<meta name=\"twitter:site\" content=\"@CodeHimOfficial\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Asif Mughal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/codehim.com\/forms\/floating-chat-box-ui-in-html-css\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/codehim.com\/forms\/floating-chat-box-ui-in-html-css\/\"},\"author\":{\"name\":\"Asif Mughal\",\"@id\":\"https:\/\/codehim.com\/#\/schema\/person\/cc48f1dbe072a89a62a98171b7db43ed\"},\"headline\":\"Floating Chat Box UI in HTML CSS\",\"datePublished\":\"2024-03-03T10:30:00+00:00\",\"dateModified\":\"2024-03-04T03:30:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/codehim.com\/forms\/floating-chat-box-ui-in-html-css\/\"},\"wordCount\":268,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/codehim.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/codehim.com\/forms\/floating-chat-box-ui-in-html-css\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/codehim.com\/wp-content\/uploads\/2024\/01\/Floating-Chat-Box-UI-in-HTML-CSS.png\",\"articleSection\":[\"Forms\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/codehim.com\/forms\/floating-chat-box-ui-in-html-css\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/codehim.com\/forms\/floating-chat-box-ui-in-html-css\/\",\"url\":\"https:\/\/codehim.com\/forms\/floating-chat-box-ui-in-html-css\/\",\"name\":\"Floating Chat Box UI in HTML CSS &#8212; CodeHim\",\"isPartOf\":{\"@id\":\"https:\/\/codehim.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/codehim.com\/forms\/floating-chat-box-ui-in-html-css\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/codehim.com\/forms\/floating-chat-box-ui-in-html-css\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/codehim.com\/wp-content\/uploads\/2024\/01\/Floating-Chat-Box-UI-in-HTML-CSS.png\",\"datePublished\":\"2024-03-03T10:30:00+00:00\",\"dateModified\":\"2024-03-04T03:30:43+00:00\",\"description\":\"Here is a free code snippet to create a Floating Chat Box UI in HTML CSS. You can view demo and download the source code.\",\"breadcrumb\":{\"@id\":\"https:\/\/codehim.com\/forms\/floating-chat-box-ui-in-html-css\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/codehim.com\/forms\/floating-chat-box-ui-in-html-css\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codehim.com\/forms\/floating-chat-box-ui-in-html-css\/#primaryimage\",\"url\":\"https:\/\/codehim.com\/wp-content\/uploads\/2024\/01\/Floating-Chat-Box-UI-in-HTML-CSS.png\",\"contentUrl\":\"https:\/\/codehim.com\/wp-content\/uploads\/2024\/01\/Floating-Chat-Box-UI-in-HTML-CSS.png\",\"width\":1280,\"height\":980,\"caption\":\"Floating Chat Box UI in HTML CSS\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/codehim.com\/forms\/floating-chat-box-ui-in-html-css\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/codehim.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Forms\",\"item\":\"https:\/\/codehim.com\/category\/forms\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Floating Chat Box UI in HTML CSS\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/codehim.com\/#website\",\"url\":\"https:\/\/codehim.com\/\",\"name\":\"CodeHim\",\"description\":\"Web Design Code Snippets\",\"publisher\":{\"@id\":\"https:\/\/codehim.com\/#organization\"},\"alternateName\":\"Web Design Codes\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/codehim.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/codehim.com\/#organization\",\"name\":\"CodeHim - Web Design Code & Scripts\",\"url\":\"https:\/\/codehim.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codehim.com\/#\/schema\/logo\/image\/\",\"url\":\"http:\/\/codehim.com\/wp-content\/uploads\/2023\/06\/Codehim-short-logo.jpg\",\"contentUrl\":\"http:\/\/codehim.com\/wp-content\/uploads\/2023\/06\/Codehim-short-logo.jpg\",\"width\":280,\"height\":280,\"caption\":\"CodeHim - Web Design Code & Scripts\"},\"image\":{\"@id\":\"https:\/\/codehim.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/codehimofficial\",\"https:\/\/x.com\/CodeHimOfficial\",\"https:\/\/www.instagram.com\/codehim\/\",\"https:\/\/www.linkedin.com\/company\/codehim\",\"https:\/\/co.pinterest.com\/codehim\/\",\"https:\/\/www.youtube.com\/@codehim\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/codehim.com\/#\/schema\/person\/cc48f1dbe072a89a62a98171b7db43ed\",\"name\":\"Asif Mughal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codehim.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b25bfcd7d4e341c2c6f785a88d8ad2a4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b25bfcd7d4e341c2c6f785a88d8ad2a4?s=96&d=mm&r=g\",\"caption\":\"Asif Mughal\"},\"description\":\"I code and create web elements for amazing people around the world. I like work with new people. New people new Experiences. I truly enjoy what I'm doing, which makes me more passionate about web development and coding. I am always ready to do challenging tasks whether it is about creating a custom CMS from scratch or customizing an existing system.\",\"sameAs\":[\"https:\/\/codehim.com\"],\"url\":\"https:\/\/codehim.com\/author\/asif-mughal\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Floating Chat Box UI in HTML CSS &#8212; CodeHim","description":"Here is a free code snippet to create a Floating Chat Box UI in HTML CSS. You can view demo and download the source code.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/codehim.com\/forms\/floating-chat-box-ui-in-html-css\/","og_locale":"en_US","og_type":"article","og_title":"Floating Chat Box UI in HTML CSS &#8212; CodeHim","og_description":"Here is a free code snippet to create a Floating Chat Box UI in HTML CSS. You can view demo and download the source code.","og_url":"https:\/\/codehim.com\/forms\/floating-chat-box-ui-in-html-css\/","og_site_name":"CodeHim","article_publisher":"https:\/\/www.facebook.com\/codehimofficial","article_published_time":"2024-03-03T10:30:00+00:00","article_modified_time":"2024-03-04T03:30:43+00:00","og_image":[{"width":1280,"height":980,"url":"https:\/\/codehim.com\/wp-content\/uploads\/2024\/01\/Floating-Chat-Box-UI-in-HTML-CSS.png","type":"image\/png"}],"author":"Asif Mughal","twitter_card":"summary_large_image","twitter_creator":"@CodeHimOfficial","twitter_site":"@CodeHimOfficial","twitter_misc":{"Written by":"Asif Mughal","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/codehim.com\/forms\/floating-chat-box-ui-in-html-css\/#article","isPartOf":{"@id":"https:\/\/codehim.com\/forms\/floating-chat-box-ui-in-html-css\/"},"author":{"name":"Asif Mughal","@id":"https:\/\/codehim.com\/#\/schema\/person\/cc48f1dbe072a89a62a98171b7db43ed"},"headline":"Floating Chat Box UI in HTML CSS","datePublished":"2024-03-03T10:30:00+00:00","dateModified":"2024-03-04T03:30:43+00:00","mainEntityOfPage":{"@id":"https:\/\/codehim.com\/forms\/floating-chat-box-ui-in-html-css\/"},"wordCount":268,"commentCount":0,"publisher":{"@id":"https:\/\/codehim.com\/#organization"},"image":{"@id":"https:\/\/codehim.com\/forms\/floating-chat-box-ui-in-html-css\/#primaryimage"},"thumbnailUrl":"https:\/\/codehim.com\/wp-content\/uploads\/2024\/01\/Floating-Chat-Box-UI-in-HTML-CSS.png","articleSection":["Forms"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/codehim.com\/forms\/floating-chat-box-ui-in-html-css\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/codehim.com\/forms\/floating-chat-box-ui-in-html-css\/","url":"https:\/\/codehim.com\/forms\/floating-chat-box-ui-in-html-css\/","name":"Floating Chat Box UI in HTML CSS &#8212; CodeHim","isPartOf":{"@id":"https:\/\/codehim.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/codehim.com\/forms\/floating-chat-box-ui-in-html-css\/#primaryimage"},"image":{"@id":"https:\/\/codehim.com\/forms\/floating-chat-box-ui-in-html-css\/#primaryimage"},"thumbnailUrl":"https:\/\/codehim.com\/wp-content\/uploads\/2024\/01\/Floating-Chat-Box-UI-in-HTML-CSS.png","datePublished":"2024-03-03T10:30:00+00:00","dateModified":"2024-03-04T03:30:43+00:00","description":"Here is a free code snippet to create a Floating Chat Box UI in HTML CSS. You can view demo and download the source code.","breadcrumb":{"@id":"https:\/\/codehim.com\/forms\/floating-chat-box-ui-in-html-css\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/codehim.com\/forms\/floating-chat-box-ui-in-html-css\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codehim.com\/forms\/floating-chat-box-ui-in-html-css\/#primaryimage","url":"https:\/\/codehim.com\/wp-content\/uploads\/2024\/01\/Floating-Chat-Box-UI-in-HTML-CSS.png","contentUrl":"https:\/\/codehim.com\/wp-content\/uploads\/2024\/01\/Floating-Chat-Box-UI-in-HTML-CSS.png","width":1280,"height":980,"caption":"Floating Chat Box UI in HTML CSS"},{"@type":"BreadcrumbList","@id":"https:\/\/codehim.com\/forms\/floating-chat-box-ui-in-html-css\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/codehim.com\/"},{"@type":"ListItem","position":2,"name":"Forms","item":"https:\/\/codehim.com\/category\/forms\/"},{"@type":"ListItem","position":3,"name":"Floating Chat Box UI in HTML CSS"}]},{"@type":"WebSite","@id":"https:\/\/codehim.com\/#website","url":"https:\/\/codehim.com\/","name":"CodeHim","description":"Web Design Code Snippets","publisher":{"@id":"https:\/\/codehim.com\/#organization"},"alternateName":"Web Design Codes","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/codehim.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/codehim.com\/#organization","name":"CodeHim - Web Design Code & Scripts","url":"https:\/\/codehim.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codehim.com\/#\/schema\/logo\/image\/","url":"http:\/\/codehim.com\/wp-content\/uploads\/2023\/06\/Codehim-short-logo.jpg","contentUrl":"http:\/\/codehim.com\/wp-content\/uploads\/2023\/06\/Codehim-short-logo.jpg","width":280,"height":280,"caption":"CodeHim - Web Design Code & Scripts"},"image":{"@id":"https:\/\/codehim.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/codehimofficial","https:\/\/x.com\/CodeHimOfficial","https:\/\/www.instagram.com\/codehim\/","https:\/\/www.linkedin.com\/company\/codehim","https:\/\/co.pinterest.com\/codehim\/","https:\/\/www.youtube.com\/@codehim"]},{"@type":"Person","@id":"https:\/\/codehim.com\/#\/schema\/person\/cc48f1dbe072a89a62a98171b7db43ed","name":"Asif Mughal","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codehim.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/b25bfcd7d4e341c2c6f785a88d8ad2a4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b25bfcd7d4e341c2c6f785a88d8ad2a4?s=96&d=mm&r=g","caption":"Asif Mughal"},"description":"I code and create web elements for amazing people around the world. I like work with new people. New people new Experiences. I truly enjoy what I'm doing, which makes me more passionate about web development and coding. I am always ready to do challenging tasks whether it is about creating a custom CMS from scratch or customizing an existing system.","sameAs":["https:\/\/codehim.com"],"url":"https:\/\/codehim.com\/author\/asif-mughal\/"}]}},"views":5562,"_links":{"self":[{"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/posts\/10592","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/comments?post=10592"}],"version-history":[{"count":1,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/posts\/10592\/revisions"}],"predecessor-version":[{"id":11272,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/posts\/10592\/revisions\/11272"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/media\/10594"}],"wp:attachment":[{"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/media?parent=10592"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/categories?post=10592"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/tags?post=10592"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}