Java教程

【金秋打卡】第20天 继续模板标签的使用 当前时间的显示

本文主要是介绍【金秋打卡】第20天 继续模板标签的使用 当前时间的显示,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

1.课程名称:模板标签的使用


课程章节:当前时间的显示


2.课程内容:


https://img2.sycdn.imooc.com/636fabf60001863b14930659.jpg


html循环渲染对象的方法

添加测试对象

https://img4.sycdn.imooc.com/636faf9100016a8f07640428.jpg



记得加上 items 不然会报错

https://img3.sycdn.imooc.com/636fafb30001c40b09180285.jpg



在for 循环里帮商品排序

倒序 添加关键字 reversed 就可以了


原本顺序  葡萄  苹果 菠萝

https://img4.sycdn.imooc.com/636fb1660001b6be05060267.jpg


设置倒序

https://img2.sycdn.imooc.com/636fb17c0001014407600388.jpg


就会显示变倒序了

https://img2.sycdn.imooc.com/636fb18a00016fe108640533.jpg


添加变量属性 添加下标


forloop .counter


https://img2.sycdn.imooc.com/636fb22c0001613207630457.jpg





https://img2.sycdn.imooc.com/636fb2340001a42207430549.jpg



设置为0开头也可以 这里就

https://img1.sycdn.imooc.com/636fb26900015fbb07430441.jpg

https://img2.sycdn.imooc.com/636fb2730001c3ed04730342.jpg



如果在循环中为商品添加颜色背景,那么颜色背景也会跟着循环下去

添加变量名字 row1 row2

https://img4.sycdn.imooc.com/636fb8290001952606110334.jpg

https://img4.sycdn.imooc.com/636fb83d0001b6e406510416.jpg

会一直红绿红绿这样。。。

https://img1.sycdn.imooc.com/636fb8580001f65111150388.jpg


url标签的使用

https://img2.sycdn.imooc.com/636fbbc00001800507760308.jpg


https://img2.sycdn.imooc.com/636fbbdc00010f9306070385.jpg

点击打印后自动跳转  根据nama进行解释url

https://img1.sycdn.imooc.com/636fbbfc00011eba06980220.jpg





带参数的url

https://img1.sycdn.imooc.com/636fbda80001f26c09070486.jpg



https://img3.sycdn.imooc.com/636fbd8700014c0403690289.jpg



这样子就会把2022 传到url里面


https://img2.sycdn.imooc.com/636fbdd60001e4dc05850183.jpg


当前时间的显示


https://img2.sycdn.imooc.com/636fc0490001582a07470465.jpg



https://img1.sycdn.imooc.com/636fc05c0001f44306520434.jpg

本节完!! ,又是及时打卡的一天





















这篇关于【金秋打卡】第20天 继续模板标签的使用 当前时间的显示的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!