Useful jQuery .eq() method
I want to mark a specific li
tag in the ul
, the HTML code is like this:
<ul>
<li>li-1</li>
<li>li-2</li>
<li>li-3</li>
<li>li-4</li>
</ul>
继续阅读
I want to mark a specific li
tag in the ul
, the HTML code is like this:
<ul>
<li>li-1</li>
<li>li-2</li>
<li>li-3</li>
<li>li-4</li>
</ul>
继续阅读
Sometimes, when we browse the website pages, we want to control it, and let it do somethings by our expectation, such as close the advertisement doms automatically. As we known that JavaScript can fulfill it, so we should inject a JavaScript file and execute our own command.
继续阅读Long time ago, I used vs code to write my blog, because it support markdwon syntax and can view the post immediately. Recently, I found vs code is not so useful, and sometimes, it is so slowly when start. So I switch to Vim, and use Vim to write posts.
继续阅读前文 关于CSS中box-sizing属性的一点心得 中介绍了关于box-sizing 并顺带写了一下盒模型,突发奇想了一个问题:使用 JavaScript 和 jQuery 获取的宽度是盒模型中的哪一部分的宽和高呢?
继续阅读最近需要写这样一个布局:一个父元素,里面有两个子元素,两个子元素的宽度为父元素的一半。这在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>
继续阅读