发表于: 2018-11-21 22:24:56
1 739
今天完成的事情:今天完成了任务12,接受了任务13,目前的话任务13正在解决左侧滑动栏的问题,
明天计划的事情:明天的计划把这个侧面滑动的给解决了,目前的话自己已经找到样式自己正在尝试修改
遇到的问题:
1,这个主要的还是左侧滑动的问题吧,网上找到的样式入下
。代码如下
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CSS3点击显示</title>
<style>
*{ margin:0; padding:0; }
html{ height:100%; }
p{ padding:10px 0; }
body{ min-height:100%; font-family:arial; position:relative; }
body.sideMenu{ margin:0; -webkit-transform:none; transform:none; }
#footer {
position:relative;
bottom:0; left:0;
width:100%;
height:600px;
background-image:-webkit-gradient(linear, 0 0, 0 100%, color-stop(0, #999), color-stop(0.02, #666), color-stop(1, #222));
background-image:-moz-linear-gradient(top, #999, #666 2%, #222);
background-image:-o-linear-gradient(top, #999, #666 2%, #222);
padding:0;
border-top:1px solid #444; transition:0.25s ease-out; -webkit-transition:0.25s ease-out;
}
#sideToggle{ display:none; }
#sideToggle:checked + aside{ left:0; }
#sideToggle:checked ~ #wrap{ padding-left:220px; }
#sideToggle:checked ~ #footer{margin-left:200px; }
body > aside{ position:absolute; top:0; bottom:0; left:-200px; width:200px; background:#f1103a; transition:0.2s ease-out; -webkit-transition:0.2s ease-out; }
body > aside > h2{ color:#FFF; text-align:center; font-weight:normal; padding:10px; }
#wrap{ margin-left:20px; padding:10px; transition:0.25s ease-out; -webkit-transition:0.25s ease-out; }
#wrap > label{ display:inline-block; }
#wrap > label{
background:#f1103a;
border-radius:50px;
color: #FFF;
cursor: pointer;
display: block;
font-family: Courier New;
font-size: 25px;
font-weight: bold;
width: 30px;
height: 30px;
line-height: 35px;
text-align: center;
text-shadow: 0 -4px;
}
#wrap > label:hover{ background:#000; }
</style>
</head>
<body>
<input type='checkbox' id='sideToggle'>
<aside><h2>Side Menu</h2></aside>
<div id='wrap'>
<label id='sideMenuControl' for='sideToggle'>=</label>
<p>HTML5/CSS3点击显示侧边框 </p>
</div>
<div id="footer">
fdsfjdhsjkflhjdkslhfjklhdsjklhfjkdlshjklds
</div>
</body>
</html>
,html的内容不算事很多,主要的还是左侧滑动的问题。
收获:对css的样式重置有了认识,也从网站上了解了任务13 的一些知识点,网址如下
IT 修真院: 前端开发 css-task-13-sass 混合器, 一起来学编程吧!!!(https://www.bilibili.com/video/av13765875)。了解了混合参数的使用,
任务12总结
任务耗时1天
总结 任务12使用sass重构任务5和任务6的页面,这个页面中对于sass的一些基础,常用的属性有了更加频繁的使用及理解,自己在这个任务中熟悉了@import的用法及引用格式,对之前的代码又进行了一次优化,对于sass的使用更加得心应手。
1. 开发过程中应该遵守哪些编码规范和 class 命名规范?
页面的第一行添加标准模式声明! DOCTYPEhtml
代码缩进:tab 键设置四个空格(通常在软件右下角设置相应空格大小)
html 中除了开头的 DOC 和'UTF-8'或者 head 里特殊情况可以大写外,其他都为小写,css 类都为小写
建议为 html 根元素指定 lang 属性,从而为文档设置正确的语言
不同 doctype 在不同浏览器下会触发不同的渲染模式
尽可能减少 div 嵌套.
在页面中尽量避免使用 style 属性, 即 style="…"; 写在相应的样式文件中
对于属性的定义,确保全部使用双引号,绝不要使用单引号
背景图片请尽可能使用 sprite 技术, 减小 http 请求
给区块代码及重要功能 (比如循环) 加上注释, 方便后台添加功能
不要使用 @import, 与 <link> 标签相比,@import 指令要慢很多, 不光增加了额外的请求次数, 还会导致不可预料的问题。
class命名的话精良使用bem命名法则,对于属性的命名有条理
2. 那种规范才是最好的规范?
规范的话便于自己后期后期维护,便于他人看懂的应该是最好的规范,比如bem的命名法则,有时候嵌套的多的话变量的命名也会很长,有人感觉适合,有人感觉很臃肿。但我们应该遵守的是大部分人都能认同的规则,比如前一个问题所说的一些编码规范和命名规范。
评论