官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 林西县| 宁蒗| 聂拉木县| 崇义县| 通海县| 扶沟县| 维西| 凌源市| 资中县| 阜城县| 太保市| 大姚县| 准格尔旗| 呼伦贝尔市| 佛教| 福贡县| 商都县| 墨江| 松潘县| 同心县| 商河县| 社旗县| 石狮市| 永定县| 湘阴县| 灵武市| 理塘县| 玉屏| 五莲县| 佳木斯市| 明水县| 阜新| 电白县| 喀什市| 新化县| 南召县| 遂昌县| 赣州市| 容城县| 新宁县| 镇平县|