- Progressive Web Apps with React
- Scott Domes
- 247字
- 2021-07-08 09:36:14
CSS and assets
Our good friend at the start-up (now dubbed Chatastrophe--what have you done?) has tapped a designer to provide some basic assets for us. These include a send icon for our chat box, and a logo for the application. You're not a fan of the style, but c'est la vie.
Let's go ahead and download the image files from https://github.com/scottdomes/chatastrophe-assets. You can download them by clicking on the Clone or Download button, and then selecting Download as Zip. Then, unzip those into the public folder, in a new folder called assets (all asset files should thus be in chatastrophe/public/assets).
Before we continue, we can ensure that our assets look okay by testing them in our index.html. Above <h1>, let's put in an img tag, with the src set to /img/logo.png, and an ID as test-image:
<img src=”assets/icon.png” id=”test-image”/>
Here's what it should look like:

This is even more beautiful.
The last thing we need to do is add our CSS. By the luck of the gods, all of our CSS has been mysteriously prepared for us, saving us the cumbersome task of styling our application. All we have to do is pull in assets/app.css.
We include it in our index.html with a link tag:

We should see an immediate change to our page. The background should be a gradiant, and the image should now have a slightly pulsing animation:

It worked! That does it for our main assets. Let's move on to some improvements to our HTML.
- Oracle WebLogic Server 12c:First Look
- Mastering Objectoriented Python
- MATLAB 2020 從入門到精通
- bbPress Complete
- iOS開發(fā)實(shí)戰(zhàn):從入門到上架App Store(第2版) (移動(dòng)開發(fā)叢書)
- Kubernetes進(jìn)階實(shí)戰(zhàn)
- 零基礎(chǔ)學(xué)Scratch 3.0編程
- 進(jìn)入IT企業(yè)必讀的324個(gè)Java面試題
- Practical Predictive Analytics
- H5+移動(dòng)營(yíng)銷設(shè)計(jì)寶典
- Yii2 By Example
- 例說FPGA:可直接用于工程項(xiàng)目的第一手經(jīng)驗(yàn)
- 零基礎(chǔ)學(xué)Java(第5版)
- 川哥教你Spring Boot 2實(shí)戰(zhàn)
- 計(jì)算機(jī)視覺實(shí)戰(zhàn):基于TensorFlow 2