Register to Better Coder! It's free.
Enjoy the premium features and succeed at every job interview.
What is a <style> tag?
Experience Level: Junior
<style> tag is used to define styles for the HTML document. It usually contains CSS styles.
- It is a best practice to put the
<style>tag to the
<head>element. It can be present in the
<body>element as well, but placing it to
<head>element is preferred.
- The content of the
<style>tag can be present either directly in the document (embedded) or it can be linked from the external file.
- Linking the styles from the external file is the preferred method as the external file can be downloaded just once and then cached, so less data need to be transferred on subsequent web page loads.
- There can be multiple
<style>tags present in the HTML page.
Related HTML job interview questions
What is a <html> tag?HTML Junior
What are <h1>...<h6> tags?HTML Junior
What is a <title> tag?HTML Junior
What is a <head> tag?HTML Junior
What is a <button> tag?HTML Junior