Snippet Name: Gray_Background_and_Font
Tags:
Created Date: 2025-06-16 13:12:50
Last Modified Date: 2025-05-31 10:31:39
Dependencies:
DBA Notes:
Sample Output:
Title: Gray Background and Font
Author: user
in HTML, i want to create a <div> element with a gray background and smaller fond; what does the markup look like
Author: ChatGPT
To create a `<div>` element with a gray background and smaller font in HTML, you can use the following markup:
```html
<div style="background-color: gray; font-size: 12px;">
Your content goes here
</div>
```
In this example:
- `background-color: gray;` sets the background color of the `<div>` to gray.
- `font-size: 12px;` sets the font size to a smaller value. You can adjust the `12px` to any size you prefer.