#HTML ## Basic - **Block elements vs inline elements.** https://www.w3schools.com/html/html_blocks.asp - **Checkbox** https://www.tunnelsup.com/jquery-checkbox-checked-reading-and-setting/ ## add favicon to website ``` ``` ## insert html code from another file ref: https://stackoverflow.com/questions/8988855/include-another-html-file-in-a-html-file Solution 1. Use jQuery.js ```
``` Solution 2. Use a custom javascript a.html: ```And whatever content you want afterwards.
``` b.js: ``` document.write('\Notice however, that you have to escape LF's with a '\', just like\ demonstrated in this code listing.\
\ '); ``` Or just use the following handy bash script published as a Gist on Github, that automates all necessary work, converting b.html to b.js: https://gist.github.com/Tafkadasoh/334881e18cbb7fc2a5c033bfa03f6ee6 {{ ::html_to_js.zip |}} Solution 3. Use htm file and ```frameset``` #CSS ##在html中使用external stylesheet: `````` ##不同的vhost共用stylesheet的方法:在每个vhost里面建立symbolic link ```ln -s /home/wwwroot/LSstyle.css LSstyle.css``` ### Class vs ID: 1. define an **id** 例如定义一个圆角id ```#fixWidthBlockRound { border-radius: 4px; }``` 2. deine a **class** 例如定义img tag的一个圆角class ```img.roundedCorner6px{ border-radius:6px; overflow:hidden; }``` class可以用于各种元素,但id只针对一个元素:[[https://www.htmldog.com/guides/css/intermediate/classid/]] ++++ Code Example| ``` #navlist { position: relative; } li.home { left: 0px; width: 46px; background: url('img_navsprites_hover.gif') 0 0; } #prev { left: 63px; width: 43px; background: url('img_navsprites_hover.gif') -47px 0; } li.home a:hover { background: url('img_navsprites_hover.gif') 0 -45px; } #prev a:hover { background: url('img_navsprites_hover.gif') -47px -45px; } ``` ++++