手机页面操作栏的创建及WebFont的使用

一、手机界面底部操作栏的创建。

 1 <style>
 2 .opers{
 3     position:absolute;
 4     bottom:0px;
 5     left:0px;
 6     right:0px;
 7     height:3rem;
 8     background-color:#fbfbfb;
    display:flex;
display:-webkit-box; 9 }
  .opers a:BEFORE{
    font-size:1.25rem;
    display:block;
  }
  .opers a{
    flex:1;
    text-align:center;
    -webkit-box-flex:1;
    font-size:0.75rem;
  }
10 .list{ 11 position:absolute; 12 top:1.5rem; 13 left:0; 14 right:0; 15 bottom:3rem; 16 background-color:#fefefe; 17 overflow:hidden; 18 } 19 20 </style> 21 22 <div class="opers"> 23 <a>新建文件夹</a> 24 <a>复制</a> 25 <a>删除</a> 26 </div>

css flexbox(可伸缩盒模型):面向的场景,容器的大小是可变的,在容器内部的子节点,也要随着容器的变动,进行大小的调整和次序的变更,并且能够自动填满容器,

伸缩容器,伸缩项目,主轴和方向

二、使用WebFont实现操作栏图标

     图片矢量化,可以无限的伸缩,通过修改font-size的大小,可以修改图片的大小,修改font-color的颜色,就可以修改图片的颜色。

  通过WebFont定制图标的网站:http://fontello.com

  下载选中的图标,引入fontello.css文件,

@font-face {
  font-family: 'fontello';
  src: url('../font/fontello.eot?83914508');
  src: url('../font/fontello.eot?83914508#iefix') format('embedded-opentype'),
       url('../font/fontello.woff?83914508') format('woff'),
       url('../font/fontello.ttf?83914508') format('truetype'),
       url('../font/fontello.svg?83914508#fontello') format('svg');
  font-weight: normal;
  font-style: normal;
}
/* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */
/* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */
/*
@media screen and (-webkit-min-device-pixel-ratio:0) {
  @font-face {
    font-family: 'fontello';
    src: url('../font/fontello.svg?83914508#fontello') format('svg');
  }
}
*/
 
 [class^="icon-"]:before, [class*=" icon-"]:before {
  font-family: "fontello";
  font-style: normal;
  font-weight: normal;
  /* Font smoothing. That was taken from TWBS */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
 
  /* Uncomment for 3D effect */
  /* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
}
 
.icon-plus:before { content: 'e800'; } /* '�' */
.icon-attention-circled:before { content: 'e801'; } /* '�' */
.icon-trash-empty:before { content: 'e802'; } /* '�' */

打开,demo.html文件,找到类名。

原文地址:https://www.cnblogs.com/baixuemin/p/4718775.html