gpt-3.5-turbo-0301· openai
Suzhen/CodeChat
write a code in html and creat a Horizontal icons bar for website
- User
write a code in html and creat a Horizontal icons bar for website
- Assistant
Here is an example code for a horizontal icons bar in HTML:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Horizontal Icons Bar</title> <style> body { font-family: Arial, sans-serif; padding: 0; margin: 0; } /* container for icon bar */ .icon-bar { background-color: #333; width: 100%; overflow: auto; } /* individual icons */ .icon-bar a { float: left; width: 20%; text-align: center; padding: 12px 0; transition: all 0.3s ease; color: white; font-size: 36px; } /* color change on hover */ .icon-bar a:hover { background-color: #555; } /* active state */ .active { background-color: #4CAF50; } </style> </head> <body> <div class="icon-bar"> <a class="active" href="#"><i class="fa fa-home"></i></a> <a href="#"><i class="fa fa-search"></i></a> <a href="#"><i class="fa fa-envelope"></i></a> <a href="#"><i class="fa fa-globe"></i></a> <a href="#"><i class="fa fa-user"></i></a> </div> </body> </html> - User
remove the commant
- Assistant
Certainly, here is the HTML code for a horizontal icons bar without comments:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Horizontal Icons Bar</title> <style> body { font-family: Arial, sans-serif; padding: 0; margin: 0; } .icon-bar { background-color: #333; width: 100%; overflow: auto; } .icon-bar a { float: left; width: 20%; text-align: center; padding: 12px 0; transition: all 0.3s ease; color: white; font-size: 36px; } .icon-bar a:hover { background-color: #555; } .active { background-color: #4CAF50; } </style> </head> <body> <div class="icon-bar"> <a class="active" href="#"><i class="fa fa-home"></i></a> <a href="#"><i class="fa fa-search"></i></a> <a href="#"><i class="fa fa-envelope"></i></a> <a href="#"><i class="fa fa-globe"></i></a> <a href="#"><i class="fa fa-user"></i></a> </div> </body> </html>