看了几天的视频教学,只是做了这样的简单网页,适合小白做做练习,大佬可以的话给我提点建议,感谢!
以下是相关代码:
1、布局
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>123</title>
<link rel="stylesheet" type="text/css" href="./css/reset.css"/>
<link rel="stylesheet" type="text/css" href="css/page-index.css"/>
</head>
<body>
<div class="background">
<div class="content">
<form action="#">
<input type="text" placeholder="ahmadfiroz" />
<input class="in1" type="text" placeholder="Password" />
<button>SIGN IN</button>
</form>
</div>
</div>
</body>
</html>
2、清除浏览器默认样式(网上找的,目前好像没看懂)
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
3、页面样式
/* 总体背景大小 */
body{
width: 100%;
height: 100%;
}
/* 设置背景 */
.background{
/* 大小 */
width: 800px;
height: 600px;
background: url(../img/bg.jpg) no-repeat;
margin: auto;
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
left: 0px;
}
/* 设置中间内容部分 */
.content{
width: 375px;
height: 461px;
background: url(../img/content.png);
margin: auto;
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
left: 0px;
}
/* 第一个文本输入框 */
.content input{
/* 设置大小 */
width: 195px;
height: 40px;
/* 无边框 */
border: none;
/* 定位 */
position: relative;
left: 62px;
top: 207px;
/* 背景 */
background: url(../img/text1.png) no-repeat 0px 4px;
/* 内边距 */
padding-left: 8px;
padding-right: 45px;
}
/* 第二个文本输入框 */
.content .in1{
background: url(../img/text2.png) no-repeat 0px 3px;
margin-top: 15px;
}
/* 设置提交按钮 */
.content button{
width: 120px;
height: 25px;
text-align: left;
border: none;
color: #3eb18b;
font: 18px Tahoma;
background: url(../img/go.png) no-repeat 0px 4px;
position: relative;
left: 136px;
top: 267px;
cursor: pointer;/* 鼠标移入样式 */
}
图片链接(内含PSD图片,需要的话可以自己截图)
链接:https://pan.baidu.com/s/1V-CUHv9Cy7jlf_ps4AfEag
提取码:6sjn