2017届西安思沃大讲堂

CSS:UML试卷

2016-12-07  本文已影响41人  Josaber

需求

之前的任务中,我们得到了一张这样的页面:

UML

现在我们要在原来的基础上,添加CSS样式,修改为这样:

UML测试

这个时候,我才发现自己没有好好的为网页布局,仅仅是做好了页面而已。

这就很尴尬了

分析

编码

本人使用纯手工方式写的CSS样式表,有很多不足之处望指出:

*{margin:0 auto;}

div, section, footer{padding: 5px 15px; border-radius: 5px;}
.content{width: 960px;}
input[type=text]{width: 150px;}

/*header*/
form > .header h2{text-align: center;}
form > .header div{border: 1px solid darkgray; height: 40px; line-height: 40px; margin-top: 10px;}
form > .header div span{display: block; float: left; width: 295px; font-weight: bold;}

/*section*/
.center section{padding: 0; border: 1px solid darkgray; line-height: 30px; padding-bottom: 20px; margin-top: 10px;}
.center section header{background-color: lightgray; width: 100%; border-top-left-radius: 5px; border-top-right-radius: 5px;}
.center section header h4{line-height: 45px; padding-left: 15px;}
.center section ol{margin-left: 15px;}
.center section span{line-height: 40px; font-weight: bold;}

#correct+span{color: green;}
#incorrect+span{color: red;}
textarea{height: 80px; width: 98%;}

/*footer*/
footer{text-align: center;}
footer input{background-color: royalblue; color: white; padding: 5px 10px; border-radius: 5px;}

效果

top middle bottom

详细的HTML和CSS,请点这里
PS:按钮截图出来貌似有些色差,请见谅!

上一篇 下一篇

猜你喜欢

热点阅读