Add 2. Outside the body

conzer12 2024-12-06 06:32:11 +00:00
parent e5cb43dc8c
commit a1c16eff88

23
2.-Outside-the-body.md Normal file

@ -0,0 +1,23 @@
Say you would want something like a footer. Tags outside an element are ignored. You must create a custom element for them.
```html
<hylia>
<element name="body">
I am in the body element.
</element>
<p>I am not in the body element.</p>
<element name="outside">
I am outside the body element, but inside the outside element.
</element>
</hylia>
```
See how we created an "outside" element? The text inside it will be placed outside the body element, in our output html:
```html
<!DOCTYPE html>
<html>
<body>
I am in the body element.
</body>
I am outside the body element, but inside the outside element.
</html>
```
Therefore, you could create a `footer` element and have `<footer>I'm a little footer, short and stout</footer>` and it would act as a footer when it's compiled.