Using native html vs css elements

I am working on some outdated PHP code that contains a ton of inline style, one of our goals is to use CSS, so the code will be cleaner. The only thing I thought of was using my own VS HTML elements using CSS, such as bold and italics.

For instance,

<b>this is foo</b>

Or in css

.bold { font-weight: bold;}
<span class="bold">this is foo</span>

So far, these two are doing the same thing you guys prefer and why?

+3
source share
8 answers

HTML, , . I <strong>love</strong> cheese ( "" ), <strong> . CSS .

CSS, . - <h1>...</h1> ( ), , , CSS.

, , . , , , , , .

+7

, , <b> .bold. , <b>, .

, , strong, , span.bold, , b, , , . .

+1

, ( span class= bold, ), , , , . ? em (). , .

, - CSS , .

+1

W3C HTML , . , <strong>, <em> HTML <span> .

HTML- <div> s, , .

<b>, <i> , .

+1

IMHO, CSS - .

:

1 - .

2 - / - css.

3 - , ,

+1

span, . , , .

0

, html . <b> <strong> . , css :

strong { font-size: whatever; }

<strong>this is foo</strong>
0

, , html, SEO. , Bold Italic, , , . html ( ) ( , ).

0

Source: https://habr.com/ru/post/1769020/


All Articles