Skip to content

Commit 20397d3

Browse files
Add: CodeSandbox 107.
1 parent f9065a3 commit 20397d3

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3927,6 +3927,24 @@ h1 {
39273927
</html>
39283928
```
39293929

3930+
In `script.js`, write a simple script and take note of the minified code, which can be achieved using multiple JavaScript minifiers:
3931+
3932+
```javascript
3933+
document.addEventListener("DOMContentLoaded",function(){alert("Welcome to My First Website!")});
3934+
```
3935+
3936+
In `styles.css`, add simple styling and take note of the minified code, which can be achieved using multiple CSS minifiers:
3937+
3938+
```css
3939+
body{font-family:Arial,sans-serif}h1{color:navy}
3940+
```
3941+
3942+
[![Edit 107-CSS and JavaScript Optimization](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/p/sandbox/107-css-and-javascript-optimization-nz9jsn)
3943+
3944+
- [^107]CodeSandbox: CSS and JavaScript Optimization.
3945+
3946+
[^107]:[CodeSandbox: CSS and JavaScript Optimization.](https://nz9jsn.csb.app/), last access: September 29, 2024.
3947+
39303948
- In this example, CSS and JavaScript files are minified and combined into single files (`styles.min.css` and `scripts.min.js`) to minimize the number of HTTP requests required for fetching external resources, thereby improving page load times.
39313949

39323950
### Conclusion: HTML Best Practices and Perfomance Optimization

0 commit comments

Comments
 (0)