Home>

I want to add a light gray color to the text only.
I only want the text part to be gray anddo not color between the lines.I don't know which part of the code should be changed.
Thank you very much.

Error message

When the background-color of the text is gray, the entire text is united and becomes a lump of gray.

Applicable source code

HTML

Payment

■ PayPal


We accept PayPal only.
We usually ship within 5 business days of receiving cleared
payment.
Our return policy, In the only case of unopened item package.
We ships from Japan
This
product. Import duties, taxes, and charges are not
included charges in the item price or shipping cost. These charges are the buyer ’s responsibility.

CSS
.text {
font-size: 16px;
background-color: #EEE;
font-family: Verdana, "Hiragino Kaku GoNic ProN W3", "Hiragino Kaku Gothic ProN", "Meiryo", "Meiryo", sans-serif;

.content p {
color: # 333;
font-size: 16px;
margin: 0 0 10px 0;
font-family: Verdana, "Hiragino Kaku GoNic ProN W3", "Hiragino Kaku Gothic ProN", "Meiryo", "Meiryo", sans-serif;
line-height: 1.5;

When I set line-height to 1.5 for font-size16px, I thought that the line spacing would be free, but the line spacing was free, but the color was all gray for both the text part and the line spacing. I ended up.

Supplemental information (FW/tool version etc.)

Use VSCode

  • Answer # 1

    Since

    tags are block elements,
    If you add a background color to the

    tag, it becomes the background color of the block itself.

    If you enclose the text with inline elements and specify a background color,
    I think that only inline elements have a background color.