11.10 作业

来源:互联网 发布:非线性优化计算方法 编辑:程序博客网 时间:2024/04/25 02:14
<html>    <head>        <title>coding coffee</title>        <meta charset="UTF-8">        <style type="text/css">            h1{                text-align:center;            }            .a{                /*border:2px solid red;*/                width:800;                margin:0 auto;            }            .b{                float:left;            }            .c{                float:right;                width:50%;            }        </style>    </head>    <body>        <h1>Coding Coffee Mennu</h1>        <hr>        <div>            <script type="text/javascript">                var items=[{product:'蓝山咖啡',img_url:'../咖啡图片/c2.jpg',descreption:'源自三地的咖啡豆,为周年纪念综合咖啡豆带来了特别的馥郁醇厚。如今推出三种不同包装,让你用自己喜爱的方式体验这别具风味的一杯。'},                {product:'拿铁咖啡',img_url:'../咖啡图片/c3.jpg',descreption:'作为在中国上市的第一款单一产地系列咖啡,东帝汶塔塔迈劳咖啡豆将当地的风味浓缩其中,一起来星巴克门店,感受它那平衡的草本风味吧。'},                {product:'意式浓缩',img_url:'../咖啡图片/c5.jpg',descreption:'每一款臻选咖啡豆,都有着自己的个性和故事。它因人因地因天气而有着别样的风味。当你来到星巴克臻选门店,这场相遇才刚开始。和我们的黑围裙大师一起,用不同煮制方式,走进原产地的风情中。'},                {product:'卡布奇诺',img_url:'../咖啡图片/c7.jpg',descreption:'A smooth, lild blend of coffees from Mexico. Bolivia and Guatemala.'}];                console.log(items)                for (var i=0;i<items.length ;i++)                    {document.write('<div class="a"><div class="b"><img src="'+items[i]['img_url']+'"></div>');                    document.write('<div class="c"><h2>'+items[i]['product']+'</h2>');                    document.write('<p>'+items[i]['descreption']+'</p></div><div style="clear:both"></div></div><hr>')                }            </script>        </div>    </body><html>
原创粉丝点击