[02] inline and line-height to CSS, float, absolute story

Preface

It is a long story... Before I always thought that CSS is the most important layout, a picture of the good to webpage display is king.

However, after then slowly after the introduction, they found that the layout is not feeling very difficult, it is in this guy hidden elements.

Inline elements belong to the kind of very gracious Lord, you know you can do better, you don't know him, your page will not too messy, so we ignore his power, so today we are going to take a good look at it

That year, you have not married before I was married

In that year I will write code like this:

<p>
One of the most well known pili in the movie. Ye Xiaochai life pathos, ill fated family friends, who left him one by one, was sad, but also so practice the transcendent meditation.
Upright and single-minded, the faith of the knight, although the boy was born, but refuse to be cowed or submit personality, rich life experience, let it become a member of the Central Plains martial arts an integral,
Enjoy<span style=" width: 200px; height: 200px; margin: 10px; padding: 10px; border: 1px solid black;">「Knife crazy sword Chi」</span>
The famous hero scar, shawls hair and face, with silent features, creating the role of unique style. </p>

Then, I'll do a little demo, thought to grasp the essence:

1 set width is invalid

2 set height is invalid

3 margin is invalid, or so effectively

4 padding is invalid, the effective (or range of elements increases, but the content of the element is invalid)

This is me a long time to inline elements understand, just superficial, and for a period of time without any problems.

A little later, grow in all aspects, I discovered that in fact they are overlooked something.

Strange phenomenon

In the above we found that set the height and width is of no significance, especially high and let us become more confused, look at the example.:

In this picture we should feel surprised, because he gave me a slap in the face (really picture is truth.).

He explains, the text is not open div, control div height is line-height, but why no words when he no height.?

In the inline box model, A line boxes, He is a text box (CSS inside what things will have a box), A line of text with a line boxes, The above “ space ” has a line boxes (each character will have inline box's own internal frame, The two man was too similar, Easily misunderstood), When the div is empty there is no line boxes, But the word, This guy is line boxes., So he is very arrogant “ &rdquo expansion; up.

The line boxes is not the final boss, the final boss is inside the element in row, because in fact is in elements of the inline boxes formation for high, to a walk:

The element with the vertical-algin line

The above a pile of things, I'm here on the matter, but you must remember:

<input type="checkbox" style=" vertical-align: -2px;"/>

This code have what use.

We sometimes use vertical-align for block level elements, this is not work, he can only be used for block level element or row, it will make a whole relative to the baseline drift.

We are here this may not too deep, here not go. We next to an example of the end of this paper.

Reference material

Dugu Qiubai was enlightened lonely nine sword spent 10 years, Linghu Chong in less than 1 years to learn, this is the teacher's power, so we must study, draw lessons from, even copying others thought, then assemble all the long form their own idea or theory, how the process is not important, it is important not to stop learning. In this paper, the reference (legendary Masters):

Conclusion

Do not sleep at noon, afternoon collapse!!! Behind the time we study together bootstrap and CSS related things.