前端工程学习日记第4天

#使用 margin(向外)、padding(向内) 来推挤距离
css:
.box{border:10px solid #000;
padding-left:30px;
padding-right:30px;}
https://ithelp.ithome.com.tw/upload/images/20201105/20132398oLzIOyshVT.png
向内留白30px
!
https://ithelp.ithome.com.tw/upload/images/20201105/20132398TPwEB4oEXZ.png

.box p{margin-bottom: 50px;} 推下边界50pixal
https://ithelp.ithome.com.tw/upload/images/20201105/20132398Fs5QL5q7pr.png
向外留白50px
https://ithelp.ithome.com.tw/upload/images/20201105/20132398G2DocUYhBS.png
向外留白後box2被往外推
https://ithelp.ithome.com.tw/upload/images/20201105/20132398R1Krjj59Hz.png

精诚所至,金石为开!大浪掏沙,是金子够质量才能留下

#Box Model(盒模型)
CSS:
.box{width:300px;height:300px;background:#000}
https://ithelp.ithome.com.tw/upload/images/20201105/201323980tv3tHzHCb.png
滑鼠滑到.box会看到对应高度是300px
https://ithelp.ithome.com.tw/upload/images/20201105/20132398jMWEiFKvNc.png
border padding 内部 画实线黑色;外部margin是在实线之外画虚线所以上下两个box中间白色的30px就是margin造成的
https://ithelp.ithome.com.tw/upload/images/20201105/20132398QcUqEV0M8N.png
https://ithelp.ithome.com.tw/upload/images/20201105/20132398quPILGmHyt.png
https://ithelp.ithome.com.tw/upload/images/20201105/20132398CZ6bJ8FCUb.png

#使用 margin: auto 让版型置中
yahoo首页,视窗拉右,中间的内容会保持致中随着视窗移动而变化还是保持致中
html:

<body>
<div class="header"></div>
<div class="content"></div>
</body>
CSS:
.header{width:900px;heith
}
.content{width:900px;}

以上这样是不够的 不会致中

 <body>
     <div class="wrap">
        <div class="header"></div>
        <div class="content"></div>
</body>

CSS:
.wrap{width:900px;
margin-left:auto;
margin-right:auto;} 自动外推左右 就会自动致中了
.header{width:900px;heith
}
.content{width:900px;}
https://ithelp.ithome.com.tw/upload/images/20201105/20132398KH4Mc8sW20.png
![https://ithelp.ithome.com.tw/upload/images/20201105/20132398gwcVgOcD8B.png]
*如果拿掉宽度,只有margin-left:auto;margin-right:auto是不够的 (https://ithelp.ithome.com.tw/upload/images/20201105/20132398gwcVgOcD8B.png)

再加个footer
html:

https://ithelp.ithome.com.tw/upload/images/20201105/20132398ly6yFtTWT2.png

margin:0 auto 0 auto 这个代表 上右下左
https://ithelp.ithome.com.tw/upload/images/20201105/20132398toUG6tiIuA.png


<<:  【Youtube影片】Windows 不用滑鼠快速搜寻/安装 Chocolatey 平台上软件

>>:  前端工程学习日记第二天

Install Filebeat

Filebeat是用於转发和集中日志数据的轻量级传送程序。作为服务器上的代理安装,Filebeat监...

【Day19】用Bootstrap和Fontawesome来刻我们的计数器吧 (´∀`)!!

我们先来画我们的计数器吧! 为了让我们的计数器精美一点点点, 我们先来安装React的fontAwe...

Day-21 物件与原型链

JavaScript的物件基於「原型」的继承,可以令一个物件「继承另一个物件的属性」。具体上,以 O...

[自然语言处理基础] 文本预处理(I):断开文本的锁练

前言 上次我们提到原始文本往往夹带大量无意义的字符,於是我们利用了正则表达式来清理资料。然而此时的文...

Day7: IAM users、group建立

上一篇定义了IAM里面会看到的名词,今天我们来看一下AWS Console里面要怎麽建置IAM Us...