Sentence with different HTML5 formatting

1

What is the best way to write a code with a phrase that contains several font formatting.

EX:

This phrase (bold and blue color) that I'm writing as an example (italic not bold and red) contains in parentheses the formatting of each word, however as it would be a good code written using html and css. (the rest of the text I want font 50 and white color)

Detail I know that if I stay tag-by-tag it would work, however in html this text would not be on the same line as if it were part of a single paragraph. Related to good practices how could I write a code for this example?

Can I use the span tag for this?

    
asked by anonymous 09.11.2017 / 13:16

1 answer

2

Always use the <p> tag in the paragraphs and whenever you change the formatting in the middle of the paragraph use the <span> tag. Try to avoid inline css, type <span style="color: #d9d9db; font-weight: bold; font-style: normal;"> use classes (try to give consistent names) css to do this, because it reduces the size of your html pages and css is in the browser's cache. the code with inline css would be <span class="cinza-negrito">

Another tip I suggest is to use some css framework such as bootstrap for your initial formatting.

    
09.11.2017 / 13:23