GithubHelp home page GithubHelp logo

1px's Introduction

1px Border Demo

ios7 下 1px 线的几种实现方式

  • 1px-1.html (background-color + scaleY)

      .list li {
      	position: relative;
      	font-size: 16px;
      	font-weight: bold;
      	padding: 15px;
      	-webkit-box-sizing: border-box;
      	background: -webkit-linear-gradient(top, #fafafa 0%, #f9f9f9 50%, #fafafa 100%);
      }
      
      .list li::after {
      	content: '';
      	position: absolute;
      	left: 0;
      	background: #aaa;
      	width: 100%;
      	height: 1px;
      	-webkit-transform: scaleY(0.5);
      }
      
      .list li::after {
      	bottom: 0;
      	-webkit-transform-origin: 0 bottom;
      }
    
  • 1px-2.html (border + scale)

      .list li {
      	position: relative;
          display: inline-block;
          width: 140px;
          padding: 20px 0;
          font-size: 16px;
          font-weight: bold;
          margin: 0 10px 10px 0;
          -webkit-border-radius: 5px;
      	-webkit-box-sizing: border-box;
      	background: -webkit-linear-gradient(top, #fafafa 0%, #f0f0f0 50%, #fafafa 100%);
      }
    
      .list li::after {
      	content: '';
          position: absolute;
          top: 0;
          left: 0;
          width: 200%;
          height: 200%;
          border: 1px solid #aaa;
          -webkit-border-radius: 10px;
          -webkit-box-sizing: border-box;
          -webkit-transform: scale(0.5);
          -webkit-transform-origin: left top;
      }
    
  • 1px-3.html (background)

      .list li {
      	position: relative;
          display: inline-block;
          width: 140px;
          padding: 20px 0;
          font-size: 16px;
          font-weight: bold;
          text-align: center;
          margin: 0 10px 10px 0;
      	-webkit-box-sizing: border-box;
      	background: -webkit-linear-gradient(top, #fafafa 0%, #f0f0f0 50%, #fafafa 100%);
      }
    
      .list li::after {
          content: '';
          position: absolute;
          top: 0;
          left: 0;
          width: 100%;
          height: 100%;
          background-image: -webkit-linear-gradient(top, #aaa, #aaa 60%, transparent 60%),
              -webkit-linear-gradient(right, #aaa, #aaa 60%, transparent 60%),
              -webkit-linear-gradient(bottom, #aaa, #aaa 60%, transparent 60%),
              -webkit-linear-gradient(left, #aaa, #aaa 60%, transparent 60%);
          background-size: 100% 1px, 1px 100%;
          background-position: top, right top, bottom, left top;
          background-repeat: no-repeat;
      }
    

1px's People

Contributors

songxc avatar

Stargazers

Jun avatar

Watchers

 avatar

Forkers

ccppchen

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.