Home >Web Front-end >HTML Tutorial >[Advice]What to use if HTML5 does not have font tag_html/css_WEB-ITnose

[Advice]What to use if HTML5 does not have font tag_html/css_WEB-ITnose

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-24 12:24:571693browse

As in the title, I want to change a word to red. HTML5 does not have a font. What should I use? span?div?or use some other tag?


Reply to discussion (solution)

If color="red" doesn't work, replace it with style="color:red"

No, I mean what to use Label.

Use span for ordinary text blocks

span seems to become a block.

Then use the style to change

The default span is inline

The tag is very arbitrary, just follow the default. span is not a block. If you use it, it becomes a block. It's because it's controlled. You can use b, var, strong, p, etc. It depends on your situation, and then look at the semantics of the label, and then see if it's fully controlled.

2e1cf0710519d5598b1f0f14c36ba674

Use styles to change...

45a2772a6b6107b401db3c9b82c049c2 Set display

Use span at row level
Use div p at block level

The tag is very Feel free to use it according to the default. span is not a block. If you use it to become a block, it is because it is controlled. You can use b, var, strong, p, etc. It depends on your situation, and then look at the label. Semantics, let’s see if it’s all under control

7# has revealed the true meaning, LZ will post it as soon as possible.


I use span, for example:

<p>我很<span style="color:red">丑</span>,但是我很<span style="font-weight:700;">温柔</span>。</p>

I am ugly, but I am gentle.

What does changing a word to red have to do with what tag to use? Just use CSS to change the color attribute.

Use styles to change it! Font is rarely used now!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn