CSS to Base64
This online converter allows you to encode CSS to Base64. In most cases, you do not need to do this because you can use the <style> tag to embed CSS as “source code”. Perhaps, it may be useful if you need to embed a user CSS into an HTML page, but you do not want to deal with its escaping and validating. If you need to encode images from CSS to Base64 encoded data URI, use the CSS Data URI Converter.
Output formats
If you do not know what output format you need, check the following examples to see how will look the result of the same Base64-encoded CSS formatted in each of the available formats:
• Plain text:Ym9keSB7DQogIGNvbG9yOnJlZA0KfQ==
• Data URI:data:text/css;base64,Ym9keSB7DQogIGNvbG9yOnJlZA0KfQ==
• HTML Hyperlink:<a href="data:text/css;base64,Ym9keSB7DQogIGNvbG9yOnJlZA0KfQ=="></a>
• HTML Style:<style type="text/css">
@import url("data:text/css;base64,Ym9keSB7DQogIGNvbG9yOnJlZA0KfQ==");
</style>
• HTML Stylesheet:<link rel="stylesheet" type="text/css" href="data:text/css;base64,Ym9keSB7DQogIGNvbG9yOnJlZA0KfQ==" />
If I missed an important output format for Base64-encoded CSS strings, please let me know — I would love to implement it.
Comments (2)
I hope you enjoy this discussion. In any case, I ask you to join it.