|
发表于 2017-4-17 22:20:32
|
显示全部楼层
交作业
- <html lang="en">
- <!DOCTYPE html>
- <head>
- <meta charset="UTF-8">
- <title>center</title>
- <style type="text/css">
- html,body{
- height: 100%;
- width: 100%;
- color: red;
- font-family: sans-serif, serif,cursive,fantasy,monospace;
- /*font-family 规定元素的字体系列。
- font-family 可以把多个字体名称作为一个“回退”系统来保存。如果浏览器不支持第一个字体,则会尝试下一个。*/
- }
- body{
- background: url("background.jpg") center center;
- background-size: cover;
- margin: 0;
- padding: 0;
- position: relative;
- }
- #container{
- width: inherit;
- text-align: center;
- position: absolute;
- top:50%;
- transform:translateY(-50%);
- }
- h1{
- font-size: 33px;
- margin-bottom: 22px;
- }
- p{
- font-size: 18px;
- margin-bottom: 22px; /*margin-bottom 属性设置元素的下外边距。注释:允许使用负值。*/
- }
- a{
- font-size: 22px; /*该属性设置元素的字体大小。注意,实际上它设置的是字体中字符框的高度;实际的字符字形可能比这些框高或矮*/
- }
- </style>
- </head>
- <body>
- <div id="container">
- <h1>我爱鱼C</h1>
- <p>让编程改变世界!<br/>Change the world by program!</p>
- <a href="http://www.fishc.com/" style="color: blue">传送门</a><br/>
- <a href="http://bbs.fishc.com/forum.php?mod=collection&action=view&ctid=539" style="color: blue">HTML5-庖丁解牛</a>
- </div>
- </body>
- </html>
复制代码 |
-
|