我们知道CSS为HTML标记语言提供了一种样式描述,定义了其中元素的显示方式。CSS在Web设计领域是一个突破。利用它可以实现修改一个小的样式更新与之相关的所有页面元素。大家在学习前端编程的时候肯定会用到HTML和css,那么这篇文章我们将教大家两种不同的方式制作QQ企鹅。
html制作QQ企鹅代码:
<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>绘制腾讯QQ</title><link type="text/css" rel="stylesheet" href="qq.css" ></head><body> <img src="meigui.png" id="flower" width="10%"></img> <div id="qq"> <div class="head"> <div class="leftEye"></div> <div class="leftEyes"></div> <div class="eyeCenter"></div> <div class="rightEye"></div> <div class="rightEyes"></div> <div class="rightEyess"></div> <div class="mouthTop"> <div class="mouthCenter"></div> <div class="mouthBottom"></div> </div> <div class="mandible"></div> </div> <div class="weibo"></div> <div class="weiboleft"></div> <div class="weiRightGang"></div> <div class="weiLeftGang"></div> <div class="dudu"></div> <div class="waidudu"></div> <div class="leftarm"> <div id="top"></div> </div> <div id="leftArmBottom"></div> </div> <div class="rightArm"></div> <div class="leftFoot"></div> <div class="rightFoot"></div> <div class="tailLeft"></div> <div class="tailRight"></div></body></html>
css制作QQ企鹅代码:
*{margin:0;padding:0;}#qq{ position:relative; margin-left:40%; margin-top:5%; }.head{ position:absolute; width:270px; height:250px; overflow:hidden; background-color:#000; border:1px #000 solid; border-top-left-radius:50% 50%; border-top-right-radius:50% 50%; border-bottom-left-radius:50% 50%; border-bottom-right-radius:50% 50%; border-bottom-color:#FFF; display:block;}.mandible{ position:absolute; width:362px; height:300px; top:-110px; left:-46px; background-color:#000; border:1px #000 solid; border-radius:50% 50%; z-index:6; border-top-color:#FFF; border-left-color:#FFF; border-right-color:#FFF;}.leftEye{ position:absolute; width:40px; height:70px; background-color:#FFF; left:80px; top:50px; border:1px #666 solid; border-radius:50% 50%; z-index:10;}.leftEyes{ position:absolute; width:20px; height:25px; left:93px; top:70px; border:1px #666 solid; border-radius:50% 50%; z-index:11; background-color:#000;}.rightEye{ position:absolute; width:40px; height:70px; left:140px; top:50px; border:1px #666 solid; border-radius:50% 50%; z-index:10; background-color:#FFF;}.rightEyes{ position:absolute; width:20px; height:25px; left:148px; top:70px; border:1px #666 solid; border-radius:50% 50%; z-index:11; background-color:#000;}.rightEyess{ position:absolute; width:18px; height:25px; left:150px; top:77px; border:1px #FFF solid; border-radius:50% 50%; z-index:11; background-color:#FFF;}.eyeCenter{ position:absolute; width:6px; height:6px; left:102px; top:77px; border:1px #FFF solid; border-radius:50% 50%; background-color:#FFF; z-index:12;}.mouthTop{ position:absolute; width:200px; height:150px; left:38px; top:127px; overflow:hidden; border:1px #FFA600 solid; border-radius:50% 45%; z-index:10; border-left-color: transparent; border-right-color:transparent;}.mouthBottom{ position:absolute; width:185px; height:100px; left:5PX; top:-59px; border:1px #FFA600 solid; border-radius:50% 50%; z-index:11; border-left-color:#FFF; border-right-color:#FFF; border-top-color:#FFF; background-color:#FFA600;}.mouthCenter{ position:absolute; width:100px; heigt:28px; z-index:15; left:55PX; top:26px; border:1px #FFA600 solid; border-bottom-left-radius:50% 35%; border-bottom-right-radius:50% 35%; background-color:#FFA600;}.leftZui{ position:absolute; left:118px; top:150px; z-index:20; height:5px; width:5px; border-radius:50% 50%; background-color:#FFF;}.rightZui{ position:absolute; left:200px; top:150px; z-index:20; height:5px; width:5px; border-radius:50% 50%; background-color:#FFF;}.weibo{ position:absolute; width:290px; height:150px; left:-10px; top:80px; border:5px #000 solid; border-radius:50% 50%; background-color:#FF0008; z-index:4;}.weiboleft{ position:absolute; width:60px; height:80px; left:50px; top:200px; border:3px #000 solid; background-color:#FF0008; z-index:3; border-bottom-left-radius:40%; border-bottom-right-radius:20%; border-top-left-radius:50%;}.weiLeftGang{position:absolute;}.weiRightGang{ position:absolute; left:89px; top:124px; border-right: 7px solid black; width: 180px; height: 65px; border-bottom-right-radius: 70px 70px; transform:rotate(3deg); z-index:20;}.weiLeftGang{ position:absolute; left:2px; top:140px; border-left: 5px solid black; width: 70px; height: 45px; border-bottom-left-radius: 70px 70px; transform:rotate(-1deg); z-index:20;}.dudu{ position:absolute; left:17px; top:90px; width:250px; height:300px; border:1px #000 solid; border-radius:50% 50%; background-color:#FFF; z-index:2;}.waidudu{ position:absolute; width:300px; height:360px; background-color:#000; border:1px #000 solid; left:-10px; top:35px; border-radius:50% 50%; z-index:1;}.leftarm{ position:absolute; width:40px; height:160px; left:-53px; top:153px; overflow:hidden; transform:rotate(30deg); z-index:1;}#top{ position:absolute; width:30px; height:130px; border:1px #000 solid; border-top-left-radius:40% 50%; border-bottom-left-radius:90% 40%; background-color:#000;}#leftArmBottom{ position:absolute; width:40px; height:120px; left:-43px; top:164px; border:1px #000 solid; border-bottom-right-radius:100% 90%; border-top-left-radius:90% 90%; transform:rotate(6deg); background-color:#000; z-index:0;}.rightArm{ position:absolute; width:30px; height:40px; left:783px; top:213px; background-color:#000; border:1px #000 solid; border-radius:50% 50%; transform:rotate(-20deg);}.leftFoot{ position:absolute; width:110px; height:70px; left:533px; top:414px; border:5px #000 solid; background:#FFA600; border-radius:50% 50%;}.rightFoot{ position:absolute; width:110px; height:70px; left:663px; top:414px; border:5px #000 solid; background:#FFA600; border-radius:50% 50%;}.tailLeft{ position:absolute; left:537px; top:440px; border-right: 5px solid black; width: 30px; height: 25px; border-bottom-right-radius: 70px 70px; transform:rotate(210deg)}.tailRight{ position:absolute; left:744px; top:442px; border-left: 5px solid black; width: 30px; height: 25px; border-bottom-left-radius: 70px 70px; transform:rotate(150deg)}#flower{ position:absolute; left:480px; z-index:-1; transform:rotate(-20deg)}
提示由于没有做兼容性处理:这些代码适用于Firefox来观看效果。
以上就是两种不同的代码方式实现的QQ企鹅,大家可以尝试一下。
相关推荐:
以上是html和css制作QQ企鹅教程的详细内容。更多信息请关注PHP中文网其他相关文章!

本篇文章带大家了解一下HTML(超文本标记语言),介绍一下HTML的本质,HTML文档的结构、HTML文档的基本标签和图像标签、列表、表格标签、媒体元素、表单,希望对大家有所帮助!

不算。html是一种用来告知浏览器如何组织页面的标记语言,而CSS是一种用来表现HTML或XML等文件样式的样式设计语言;html和css不具备很强的逻辑性和流程控制功能,缺乏灵活性,且html和css不能按照人类的设计对一件工作进行重复的循环,直至得到让人类满意的答案。

总结了一些web前端面试(笔试)题分享给大家,本篇文章就先给大家分享HTML部分的笔试题(附答案),大家可以自己做做,看看能答对几个!

HTML5中画布标签是“<canvas>”。canvas标签用于图形的绘制,它只是一个矩形的图形容器,绘制图形必须通过脚本(通常是JavaScript)来完成;开发者可利用多种js方法来在canvas中绘制路径、盒、圆、字符以及添加图像等。

html5废弃了dir列表标签。dir标签被用来定义目录列表,一般和li标签配合使用,在dir标签对中通过li标签来设置列表项,语法“<dir><li>列表项值</li>...</dir>”。HTML5已经不支持dir,可使用ul标签取代。

在html中,document是文档对象的意思,代表浏览器窗口的文档;document对象是window对象的子对象,所以可通过“window.document”属性对其进行访问,每个载入浏览器的HTML文档都会成为Document对象。

html5支持boolean值属性;boolean值属性指是属性值为true或者false的属性,如input元素中的disabled属性,不使用该属性表示值为flase,不禁用元素,使用该属性可以不设置属性值表示值为true,禁用元素。


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

安全考试浏览器
Safe Exam Browser是一个安全的浏览器环境,用于安全地进行在线考试。该软件将任何计算机变成一个安全的工作站。它控制对任何实用工具的访问,并防止学生使用未经授权的资源。

SublimeText3 Linux新版
SublimeText3 Linux最新版

SublimeText3汉化版
中文版,非常好用

记事本++7.3.1
好用且免费的代码编辑器

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)