最近写一个功能,要求在页面以不同颜色的块来展示,这个颜色的搭配对于一个后台搞代码的人来说,着实有些困难,搭配的不好就会显的很突兀
研究一番以后,发现一些很柔和的颜色,基本上都是aaf,ffc这种搭配,我就都给显示了一下,下面贴截图和代码
<!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>便签</title> <style type="text/css"> *{ margin:0; padding:0; } body{ font-family:arial,sans-serif; font-size:100%; margin:3em; background:#666 ; color:#fff ; } h2,p{ font-size:100%; font-weight:normal; } ul,li{ list-style:none; } ul{ overflow:hidden; padding:3em; } ul li a{ text-decoration:none; color:#000 ; background:#ffc ; display:block; height:10em; width:10em; padding:1em; } ul li{ margin:1em; float:left; } ul li h2 { font-size: 140%; font-weight: bold; padding-bottom: 10px; } ul li p { font-family: “Reenie Beanie” ,arial,sans-serif,微软雅黑; font-size: 110%; } ul li a { text-decoration: none; color: #000 ; background: #ffc ; display: block; height: auto; width: auto; padding: 1em; /* Firefox */ -moz-box-shadow: 5px 5px 7px rgba(33,33,33,1) ; /* Safari+Chrome */ -webkit-box-shadow: 5px 5px 7px rgba(33,33,33,.7) ; /* Opera */ box-shadow: 5px 5px 7px rgba(33,33,33,.7) ; } ul li:nth-child(5n) a{ position:relative; top:-10px; } ul li:nth-child(3n) a{ position:relative; top:-5px; } ul li:nth-child(even) a{ position:relative; top:5px; } ul li:nth-child(3n) a{ position:relative; top:-5px; background:#ccf ; } ul li:nth-child(even) a{ position:relative; top:5px; background:#cfc ; } ul li a:hover,ul li a:focus{ -moz-box-shadow:10px 10px 7px rgba(0,0,0,.7) ; -webkit-box-shadow: 10px 10px 7px rgba(0,0,0,.7) ; box-shadow:10px 10px 7px rgba(0,0,0,.7) ; position:relative; z-index:99; } </style> <link href=”http://fonts.googleapis.com/css?family=Reenie+Beanie:regular” rel=”stylesheet” type=”text/css”> </head> <body> <ul> <li><a style="background: #aaa;"><h2>aaa</h2></a></li> <li><a style="background: #bbb;"><h2>bbb</h2></a></li> <li><a style="background: #ccc;"><h2>ccc</h2></a></li> <li><a style="background: #ddd;"><h2>ddd</h2></a></li> <li><a style="background: #eee;"><h2>eee</h2></a></li> <li><a style="background: #fff;"><h2>fff</h2></a></li> <br/><br/><br/><br/><br/><br/><br/><br/> <li><a style="background: #aaf;"><h2>aaf</h2></a></li> <li><a style="background: #bbf;"><h2>bbf</h2></a></li> <li><a style="background: #ccf;"><h2>ccf</h2></a></li> <li><a style="background: #ddf;"><h2>ddf</h2></a></li> <li><a style="background: #eef;"><h2>eef</h2></a></li> <br/><br/><br/><br/><br/><br/><br/><br/> <li><a style="background: #afa;"><h2>afa</h2></a></li> <li><a style="background: #bfb;"><h2>bfb</h2></a></li> <li><a style="background: #cfc;"><h2>cfc</h2></a></li> <li><a style="background: #dfd;"><h2>dfd</h2></a></li> <li><a style="background: #efe;"><h2>efe</h2></a></li> <br/><br/><br/><br/><br/><br/><br/><br/> <li><a style="background: #faa;"><h2>faa</h2></a></li> <li><a style="background: #fbb;"><h2>fbb</h2></a></li> <li><a style="background: #fcc;"><h2>fcc</h2></a></li> <li><a style="background: #fdd;"><h2>fdd</h2></a></li> <li><a style="background: #fee;"><h2>fee</h2></a></li> <br/><br/><br/><br/><br/><br/><br/><br/> <li><a style="background: #ffa;"><h2>ffa</h2></a></li> <li><a style="background: #ffb;"><h2>ffb</h2></a></li> <li><a style="background: #ffc;"><h2>ffc</h2></a></li> <li><a style="background: #ffd;"><h2>ffd</h2></a></li> <li><a style="background: #ffe;"><h2>ffe</h2></a></li> <br/><br/><br/><br/><br/><br/><br/><br/> <li><a style="background: #faf;"><h2>faf</h2></a></li> <li><a style="background: #fbf;"><h2>fbf</h2></a></li> <li><a style="background: #fcf;"><h2>fcf</h2></a></li> <li><a style="background: #fdf;"><h2>fdf</h2></a></li> <li><a style="background: #fef;"><h2>fef</h2></a></li> <br/><br/><br/><br/><br/><br/><br/><br/> <li><a style="background: #aff;"><h2>aff</h2></a></li> <li><a style="background: #bff;"><h2>bff</h2></a></li> <li><a style="background: #cff;"><h2>cff</h2></a></li> <li><a style="background: #dff;"><h2>dff</h2></a></li> <li><a style="background: #eff;"><h2>eff</h2></a></li> </ul> </body> </html>