HTML+CSS编写静态网站-33 创建Contact页面

视频教程观看地址:http://study.163.com/course/courseMain.htm?courseId=1003879015

到目前为止,我们已经完成了我们的Vedio和About页面。现在我们需要制作contact页面。

首先,和我们制作“About”页面一样。我们需要创建一个名为contact.html的新文件。所以:文件=》新建。删除掉所有的内容,将编码格式改为Unicode,然后保存,它与index.html同级,然后命名为Contact.html。

现在,让我们从“About”页面复制所有代码,然后将其粘贴我们的HTML中。

接下来,我们需要将选定的导航项更改为contact。所以,剪切,然后我将它粘贴过来:

 
 
                            <li><a href = "index.html">Vedio</a></li> <li><a href = "about.html">About</a></li> <li><a href = "contact.html" class = "selected">Contact</a></li>
所以现在,保存,刷新,我来到Contact页面。你看,Contact导航项将被选中。 但是,Contact页面与“About”页面完全相同,因为我们尚未对其进行任何修改。所以让我们回到Contact页面。类似于我们以前做的,我们将删除section内的所有内容:
              <section>   </section>
接下来,我们需要在这里创建第二个section,我们希望页面是一个2列的布局:
              <section>   </section>               <section>                 </section>
现在,第一个section很简单。我只是要添加第三级标题。然后:General Information,然后我要添加一个段落。我会说:“虚幻大学希望能够让每个人享受编程的乐趣,没有编程经验的人能够通过学习找到工作,有编程经验的人能够通过学习全面自己的技术“。如果你有任何问题,请随时与我联系。
              <section>                      <h3>General Information</h3>                      <p>虚幻大学希望能够让每个人享受编程的乐趣,没有编程经验的人能够通过学习找到工作,有编程经验的人能够通过学习全面自己的技术“。如果您有任何问题,请随时与我联系</p> </section>
现在第二个section也从h3开始。内容是:Contact Details, 然后我将创建一个无序的列表,其中包括几种与我们联系的方式。在无序列表中,我将添加联系信息。所以我们来创建这个无序列表。Class = “contact-info”。
              <section>                      <h3>Contact Details</h3>                      <ul class="contact-info"></ul> </section>
现在我们来填写这个无序列表。里面我想要三种联系方式,手机邮箱和Twitter。对于手机,我们class = “phone”
                     <ul class="contact-info"> <li class="phone"><a href="tel:8888888">88888888</a></li> </ul>
你可以看到,我们用了一个不同于前使用过的链接。我们在href属性中添加了电话专用的tel,后跟电话号码。在智能手机上,这将告诉浏览器它是一个可以拨打的电话号码。因此,如果您在智能手机浏览器上启动此网站,您可以点击此链接,并直接拨打此电话号码,或者,它至少会显示一个窗口,询问您是否要拨打此电话号码。 接下来,我们添加电子邮件项。我将创建一个新的列表项,class = “mail”。然后创建一个anchor元素到Gmail:
<li class="phone"><a href="tel:17090403915">17090403915</a></li> <li class="mail"><a href="mailto:huangbangqing12@gmail.com">huangbangqing12@gmail.com</a></li>
与电话号码类似,我使用了关键字mailto。这将告诉浏览器这里我要发送邮件到这个电子邮件地址。通常这将打开网站访问者的计算机上的默认电子邮件客户端;例如Outlook或Foxmail等。 最后,我们添加一个Twitter链接。Class=”Twitter”,然后,创建一个新的列表项。添加一个Google开发者的Twitter链接:
<li class="twitter"><a href="https://twitter.com/googledevs">https://twitter.com/googledevs</a></li>
让我们保存并刷新浏览器,看看它是什么样的。 切换到Contact页面。这是我们的两个三级标题。这是我们添加的两个段落。最后,这里是无序的列表,其中包含联系人详细信息。 更多精彩内容尽在视频中! 本文固定链接:http://www.oxox.work/web/html-css/contact-page/ | 虚幻大学

查看原文:http://www.oxox.work/web/html-css/contact-page/
好的,下面我会为你介绍一下如何使用 HTMLCSS 设计一个简单的点餐系统静态页面。 首先,我们需要确定页面的布局和功能。一个简单的点餐系统静态页面包括以下几个部分: 1. 头部:包括网站的 Logo、导航栏和搜索框等; 2. 菜单:包括菜品的图片、名称、描述和价格等; 3. 购物车:显示用户已选菜品和总价; 4. 底部:包括网站的版权信息、联系方式和社交媒体链接等。 接下来,我们就可以开始编写 HTMLCSS 代码了。 HTML 代码: ``` <!DOCTYPE html> <html> <head> <title>点餐系统</title> <link rel="stylesheet" type="text/css" href="style.css"> </head> <body> <header> <div class="logo">点餐系统</div> <nav> <ul> <li><a href="#">首页</a></li> <li><a href="#">菜单</a></li> <li><a href="#">购物车</a></li> <li><a href="#">联系我们</a></li> </ul> </nav> <div class="search"> <input type="text" placeholder="请输入菜品名称"> <button>搜索</button> </div> </header> <main> <div class="menu-item"> <img src="menu1.jpg"> <h3>招牌红烧肉</h3> <p>这是一道非常美味的红烧肉</p> <span class="price">¥30</span> <button class="add-to-cart">加入购物车</button> </div> <div class="menu-item"> <img src="menu2.jpg"> <h3>麻辣香锅</h3> <p>这是一道非常辣的香锅</p> <span class="price">¥40</span> <button class="add-to-cart">加入购物车</button> </div> <div class="menu-item"> <img src="menu3.jpg"> <h3>清炒时蔬</h3> <p>这是一道非常健康的时蔬</p> <span class="price">¥20</span> <button class="add-to-cart">加入购物车</button> </div> <div class="cart"> <h3>购物车</h3> <ul> <li>招牌红烧肉 ¥30</li> <li>麻辣香锅 ¥40</li> <li>清炒时蔬 ¥20</li> <li>总价:¥90</li> </ul> <button class="checkout">结算</button> </div> </main> <footer> <div class="contact"> <p>联系我们</p> <p>地址:xxxxxx</p> <p>电话:xxxxxx</p> <p>邮箱:xxxxxx</p> </div> <div class="social-media"> <p>关注我们</p> <a href="#"><img src="weibo.png"></a> <a href="#"><img src="wechat.png"></a> <a href="#"><img src="qq.png"></a> </div> <p class="copyright">© 2021 点餐系统</p> </footer> </body> </html> ``` CSS 代码: ``` body { margin: 0; padding: 0; font-family: Arial, sans-serif; } header { background-color: #333; color: #fff; padding: 10px; display: flex; justify-content: space-between; align-items: center; } .logo { font-size: 28px; font-weight: bold; } nav ul { list-style: none; display: flex; } nav li { margin-right: 20px; } nav a { color: #fff; text-decoration: none; } .search { display: flex; } .search input { padding: 5px; border: 1px solid #ccc; border-right: none; } .search button { padding: 5px 10px; background-color: #ccc; color: #fff; border: none; cursor: pointer; } main { display: flex; flex-wrap: wrap; justify-content: space-between; padding: 20px; } .menu-item { width: calc(33.33% - 20px); margin-bottom: 20px; text-align: center; background-color: #f3f3f3; padding: 10px; box-shadow: 0 0 5px #ccc; } .menu-item img { max-width: 100%; } .menu-item h3 { font-size: 20px; margin-top: 10px; margin-bottom: 5px; } .menu-item p { font-size: 14px; color: #666; margin-bottom: 10px; } .menu-item .price { display: block; font-size: 18px; color: #f00; margin-bottom: 10px; } .menu-item .add-to-cart { padding: 5px 10px; background-color: #f00; color: #fff; border: none; cursor: pointer; } .cart { width: 30%; background-color: #f3f3f3; padding: 10px; box-shadow: 0 0 5px #ccc; } .cart h3 { font-size: 20px; margin-top: 0; margin-bottom: 10px; } .cart ul { list-style: none; padding: 0; margin: 0; } .cart li { margin-bottom: 10px; } .cart .checkout { padding: 5px 10px; background-color: #f00; color: #fff; border: none; cursor: pointer; } footer { background-color: #333; color: #fff; padding: 10px; display: flex; justify-content: space-between; align-items: center; } .contact { font-size: 14px; } .social-media { display: flex; align-items: center; } .social-media img { max-width: 30px; margin-right: 10px; } .social-media p { font-size: 14px; margin-right: 10px; } footer p { margin: 0; } footer a { color: #fff; text-decoration: none; } footer a:hover { text-decoration: underline; } ``` 以上就是一个简单的点餐系统静态页面HTMLCSS 代码。你可以根据自己的需要进行修改和调整。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

虚坏叔叔

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值