|
发表于 2021-2-3 15:44:41
|
显示全部楼层
css:
- @charset "utf-8";
- html, body {
- height: 100%;
- color: #FF0088;
- font-family: "华康少女文字W5";
- }
- h1 {
- font-size: 66px;
- margin-bottom: 22px;
- }
- p {
- font-size: 33px;
- margin-bottom: 22px;
- }
- a {
- font-size: 55px;
- background: #33FFFF;
- color: #FFF;
- border: 1px solid #33FFFF;
- border-radius: 10px;
- padding: 10px 66px;
- text-decoration: none;
- }
- body {
- background: url(12.jpg) center center;
- background-size: cover;
- margin: 0;
- padding: 0;
- position: relative;
- }
-
- #container {
- width: 100%;
- text-align: center;
- position: absolute;
- top: 50%;
- transform: translateY(-50%);
- }
复制代码
html:
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>我的HTML世界</title>
- <link rel="stylesheet" href="styles.css" type="text/css">
- </head>
- <body>
- <div id="container">
- <h1>我爱鱼C</h1>
- <p>www.fishc.com - 让编程改变世界</p>
- <a href="http://bbs.fishc.com">传送门</a>
- </div>
- </body>
- </html>
复制代码
|
|