I always forget the difference between the grouping selector and the descendant selector. grouping selector: h1,h2 {…} descendant selector: h1 em {…} child selector(like descendant selector but only selects the […]

You must have encountered such case that an image is larger than its container div and can not be restricted in the div area. <div><img src=”image.png” alt=”” /></div> In the […]

At this time, you must have read a lot of tutorials about css float. I bet all you know is something like “floating elements makes the elements float to the […]

Padding and margin often cause misunderstandings. <div style=”width:100;height:100;background-color:#ff0000;”></div> The above html displays a 100×100 red block. What do you think the effects of the html below? <div style=”padding: 20px; width: […]

Today it turns out I  got a big misunderstanding of HTML checkbox. I thought <input type=”checkbox”  value=”1″> will check the box, while <input type=”checkbox”  value=”0″> will uncheck the box. Unfortunately, […]