index.html

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Sass:Syntactiically Awesome Style Sheets</title>
<link rel="stylesheet" href="css/demo1.css">
</head>
<body>
<div class="test">
<div class="color1"></div>
<div class="color2"></div>
<div class="color3"></div>
<div class="color4"></div>
<div class="color5"></div>
<div class="color6"></div>
<div class="color7"></div>
<div class="color8"></div>
</div>
<div style="clear:both;"></div>
<div class="test2"></div>
</body>
</html>

scss

$list: red orange yellow green grey blue purple black;

$len: length($list);

$width: percentage(1 / $len);
@for $i from 1 through $len{
.test .color#{$i}{
width: $width;
background-color: nth($list, $i);
height: 10px;
float: left;
}
}
.test{
width: 100%;
} .test2{
height: 10px;
width: 100%;
background-image: linear-gradient(to right, red 0%, red $width, orange $width, orange $width * 2);//渐变,to right从左到右
}

css

.test .color1 {
width: 12.5%;
background-color: red;
height: 10px;
float: left;
} .test .color2 {
width: 12.5%;
background-color: orange;
height: 10px;
float: left;
} .test .color3 {
width: 12.5%;
background-color: yellow;
height: 10px;
float: left;
} .test .color4 {
width: 12.5%;
background-color: green;
height: 10px;
float: left;
} .test .color5 {
width: 12.5%;
background-color: grey;
height: 10px;
float: left;
} .test .color6 {
width: 12.5%;
background-color: blue;
height: 10px;
float: left;
} .test .color7 {
width: 12.5%;
background-color: purple;
height: 10px;
float: left;
} .test .color8 {
width: 12.5%;
background-color: black;
height: 10px;
float: left;
} .test {
width: 100%;
} .test2 {
height: 10px;
width: 100%;
background-image: linear-gradient(to right, red 0%, red 12.5%, orange 12.5%, orange 25%);
} /*# sourceMappingURL=demo1.css.map */

sass10 demo1的更多相关文章

  1. struts2 基础demo1

    我们都知道 struts2 是基于webframework 出现的 优秀的mvc 框架, 他和struts1 完全没有联系.struts2 是一个框架, 啥叫框架呢?是一个优秀的半成品 . web的框 ...

  2. struts2&&Hibernate Demo1

    这篇文章和<struts1&&Hibernate Demo1>基本类似,我这里只是拷贝代码了. 最核心的代码:LoginAction.java package action ...

  3. 通用窗口类 Inventory Pro 2.1.2 Demo1(上)

    插件功能 按照Demo1的实现,使用插件来实现一个装备窗口是很easy的,虽然效果还很原始但是也点到为止了,本篇涉及的功能用加粗标出,具体的功能如下: 1.实现了两个窗口,通过点击键盘I来,打开或者关 ...

  4. (23)unity4.6学习Ugui中国文档-------非官方Demo1

    大家好,我是广东太阳.   转载请注明出处:http://write.blog.csdn.net/postedit/38922399 更全的内容请看我的游戏蛮牛地址:http://www.unitym ...

  5. 20ViewPager demo1,2:接收ViewPager展示View的使用

    Demo1 MainActivity .JAVA package com.qf.day20_viewpager_demo1; import java.util.ArrayList; import ja ...

  6. WPF Demo1

    <Window x:Class="Demo1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/ ...

  7. [模拟回调] demo1模拟用字符串调用js函数 demo2模拟springmvc controller回调页面js函数

    demo1. 模拟用字符串调用js 函数 function dataQuery() { var strFun = "testCallBack"; var strParam = &q ...

  8. JS-以鼠标位置为中心的滑轮放大功能demo1

    以鼠标位置为中心的滑轮放大功能demo1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" &qu ...

  9. oracle--分页过程demo1

    oracle分页过程demo1: --ROWNUM用法 select o.*,rownum rn from (select * from emp) o where rownum<=10; sel ...

随机推荐

  1. CodeForces 362E Petya and Pipes

    Petya and Pipes Time Limit: 1000ms Memory Limit: 262144KB This problem will be judged on CodeForces. ...

  2. 解决ORA-28002: 密码7天之后过期办法

    https://www.douban.com/group/topic/46177516/ https://yq.aliyun.com/ziliao/42484 http://blog.csdn.net ...

  3. ZOJ 3435

    求(1,1,1)至(x,y,z)的互质个数. 即求(0,0,0)到(x-1,y-1,z-1)互质个数. 依然如上题那样做.但很慢...好像还有一个分块的思想,得学学. #include <ios ...

  4. eclipse project文件夹下 删除不掉文件夹或者文件的解决的方法

    对于新手来说,有时操作失误就会导致eclipse文件夹中的某些子文件夹或者文件无法删除. 这种原因是,在project文件夹中(不是eclipse上显示的.是真实的物理磁盘上的)这个文件夹或者文件已经 ...

  5. Detours改动段属性漏洞

    v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VM ...

  6. [Maven实战](5)Archetype生成项目骨架

    Hello World项目中有一些Maven的约定:在项目根文件夹中放置pom.xml,在src/main/java文件夹下放置项目的主代码,在sc/test/java中放置项目的測试代码.之所以一步 ...

  7. Android之——自己定义TextView

    转载请注明出处:http://blog.csdn.net/l1028386804/article/details/47082241 在这一篇博文中,将向大家介绍怎样以最简单的方式,来自己定义Andro ...

  8. Linux内核编译測试

    内核编译: Step 1:配置内核编译选项. make menuconfig Optional Step :排除编译结果文件(.o)等之间的依赖性. make mrproper Optional St ...

  9. HDU 5616 Jam's balance 背包DP

    Jam's balance Problem Description Jim has a balance and N weights. (1≤N≤20)The balance can only tell ...

  10. 将hexo的评论系统由gitment改为Valine

    title: 将hexo的评论系统由gitment改为Valine toc: false date: 2018-09-13 15:10:56 categories: methods tags: hex ...