0

I missed 1 question in a code challenge today. When using inline styling in HTML, do we call that style tag or style attribute?

The question was: "The <style> tag can be placed in...?" It had following answers: a. Only <body> b. Both <body> & <head> c. Only <head> d. None of the mentioned tags My choice was (C) & when i reviewed the answers i found out that the answer is option (B). Help me understand.

8th May 2023, 9:48 AM
Ignatius F Kadziwika
Ignatius F Kadziwika - avatar
6 Respuestas
+ 2
The <style> tag is typically placed in the <head> section of an HTML document. However, the <style> tag can also be used inline, by placing it directly inside an HTML element's opening tag. were you looking for this?
8th May 2023, 10:15 AM
Just Some Random Guy
Just Some Random Guy - avatar
+ 1
Yes, as snehil said, you can place <style> tag in the body. Try to put style in the body yourself to see that it works.
8th May 2023, 11:02 AM
Ugulberto Sánchez
Ugulberto Sánchez - avatar
0
So when we put style tag inside body is it still called inline or internal?
8th May 2023, 12:21 PM
Ignatius F Kadziwika
Ignatius F Kadziwika - avatar
0
When it is placed in the body it is called an inline style. There are 3 types of styles. Inline - by using the style attribute inside HTML elements Internal - by using a <style> element in the <head> section External - by using a <link> element to link to an external CSS file Example inline: <h1 style="color:blue;">A Blue Heading</h1>
10th May 2023, 10:03 PM
Chris Coder
Chris Coder - avatar
0
Alright thank you
11th May 2023, 8:02 AM
Ignatius F Kadziwika
Ignatius F Kadziwika - avatar