I had tried to align the text “Front-End Developer, based in London” and “Portfolio” to the center using “text-align” but for some reason that I do not understand, it remains aligned to the left.
Please help, really appreciate any help I can get.
If you want to keep the display as is, you can use the “<center>” html balise to force center an element regardless of the display. Just nest the element you want to center inside a “<center></center>”
The problem with using the <center> tag is that you’re using HTML instead of CSS to style something. The <center> tag provides no semantics - it doesn’t tell us if the element is block level or if it’s a header or anything. That’s why it’s no longer used. Similarly, <bold> and <italics> are discouraged, being replaced by <strong> and <em> which provide a better sense of the nature of the content within the tags, with corresponding styles set in the CSS.
Well, converting <b> and <i> to <strong> and <em> tags is not really semantically correct either.
<i> tag is meant for content that has a different mood from the context, but not really emphasis. For instance, you might want to run italics on words that are taken from another language (most commonly expressions from Latin), which doesn’t carry an emphasis , so <em> would be semantically wrong. In that case it’s recommended to use a lang attribute to the <i> element.
Same thing for a technical term, taxonomy, or any part of a text that normally gets italicized to show a change on the flow, for instance, separate the dialog between characters from the narrator.
It’s also common to use italics on the attribution for a quote, which should be coded as <cite> tags for <q> elements.
Same thing for <b> and <strong>. Sometimes you just want to make text bold without indicating extra “weight” to it.
So rule of thumb: know your text-level semantics, and use <i> and <b> when you want to make something italicized or bold by a semantic reason not covered by other tags.
Now going back to the OP, you might want to check flexbox