Home > Web Front-end > CSS Tutorial > You don't need external assets in an HTML file

You don't need external assets in an HTML file

Jennifer Aniston
Release: 2025-03-20 10:56:12
Original
852 people have browsed it

You don't need external assets in an HTML file

A fun exercise from Terence Eden. You can send an HTML file over the wire including anything a website might need without requesting any other files. CSS and JavaScript are easy, because there are <script> and <style> tags. Images and fonts (and pretty much whatever other kind of asset) aren’t too hard because Data URLs exist. See Terence’s post for an extra-tricky final version including .zip files.</script>

Reminds me of a couple of other tricks…

  • You don’t have to include CSS in your HTML, you can force an HTML file to load the styles via header.
  • You can use that trick above, literally send zero HTML, and still make a thing that looks like a website because of how the browser implies certain HTML, which you can then append content via CSS pseudo elements. Read: “Using CSS without HTML”

The above is the detailed content of You don't need external assets in an HTML file. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template