<style>
The <style>
tag is used to stylize page elements using the CSS language. Simply put, it tells the browser how the page should look. Unlike the <link> tag which loads external stylesheets, the <style>
tag embeds CSS as source code of the HTML page. And this is the only difference, because it does not matter how styles are defined: externally, internally, or inline.
Good to know that some CSS properties support data URIs. Below I want to provide a simple example of how to embed a one-pixel red GIF within <style>
contents and use it as <body>
background.
<style>
body {
background: url("data:image/gif;base64,R0lGODdhAQABAPAAAP8AAAAAACwAAAAAAQABAAACAkQBADs");
}
</style>
For more information, please read How to embed Base64 encoded images in CSS.
Comments (15)
I hope you enjoy this discussion. In any case, I ask you to join it.