闻心阁

一蓑烟雨看苍生,半壶浊酒笑红尘

标签:前端开发

共 64 篇文章

Inject jQuery into Any Webpage

2016-10-08 约 2 分钟读完 搬砖秘籍

Even MVVM framework is more and more popular in the web front developments, but the strength of jQuery cannot be replaceable. Sometimes, we need the jQuery's useful APIs to achieve some complex actions, but many webpages give up jQuery, so some skills is needed to inject the jQuery into the webpages which had abandon the jQuery library.

继续阅读

关于CSS中box-sizing属性的一点心得

2016-05-15 约 6 分钟读完 搬砖秘籍

最近需要写这样一个布局:一个父元素,里面有两个子元素,两个子元素的宽度为父元素的一半。这在CSS中倒是一个很简单的问题,所以很容易就有如下代码。

<style type="text/css">
  *{
    padding : 0;
    margin  : 0;
  }
  #outer{
    width      : 600px;
    height     : 300px;
    background : red;
    color      : white;
  }
  #outer:after{
    content : "";
    clear   : both;
  }
  #in1{
    width      : 50%;
    height     : 80%;
    float      : left;
    background : blue;
  }
  #in2{
    width      : 50%;
    height     : 80%;
    float      : right;
    background : green;
  }
</style>
<div id="outer">
  <div id="in1">
    IN1
  </div>
  <div id="in2">
    IN2
  </div>
</div>
继续阅读
较新 更早