美文网首页
css-试卷

css-试卷

作者: heheheyuanqing | 来源:发表于2017-05-24 22:38 被阅读32次

经归对css的学习之后,通过对之前使用纯HTML实现考试页面进行添加样式,进行美化试卷达到一下效果:



1.将每一个部分通过class命名,然后再head中进行样式的设置

<section class="head">
<tr class="info">
<tr class="top">……

2.使用margin使每一块进行居中设置
      margin-left: auto;
        margin-right: auto;  //使每一个块居中
        margin-bottom: 20px;
        padding-bottom: 10px;// 让相邻之间的块能够有一定的距离

3.使用table标签设置试卷的基本信息,使基本信息对齐,对table及tr进行样式的设置,使其更加美观

table {
width: 900px;
border-collapse: collapse;//添加边框
}

    tr {
        text-indent: 30px;//设置文本缩进
        margin-top: 10px;
    }

4.在每道题使用table进行样式的设置,对题目题号进行特殊样式设置

.top {
height: 40px;//设置高度
background-color: darkgray;//设置背景颜色
text-indent: 2px;//设置文本缩进
}

相关文章

网友评论

      本文标题:css-试卷

      本文链接:https://www.haomeiwen.com/subject/tptaxxtx.html