gpt-4-0613· OpenAI
Arena Human Preference 55K
Show me HTML/CSS to make a notification badge on a button with a number in it
- User
Show me HTML/CSS to make a notification badge on a button with a number in it
- Assistant
Sure, you can achieve that using HTML and CSS. Here's a simple example:
HTML:
<button class="notification"> Notifications <span class="badge">5</span> </button>CSS:
.notification { padding: 10px 20px; background-color: #f44; color: white; border: none; cursor: pointer; font-size: 20px; position: relative; } .badge { position: absolute; top: -10px; right: -10px; padding: 5px 10px; border-radius: 50%; background-color: #ff0; color: black; font-size: 14px; }In this example, the
.notificationclass is the button, and the.badgeclass is the notification badge. The badge is positioned absolutely relative to the button, so it appears on the top-right corner of the button. The number inside the badge is the number of notifications, which you can change as per your needs.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.