Yesterday I went for an interview with a technology company in Haidian District, Beijing. They gave me a set of test papers. I secretly wrote down a question that I didn’t know how to do and asked friends on the forum to help me answer it. Thank you!
Question: Please read the following html code carefully and write css code to implement the following two functions?
span
/span>
div2
; The height of the div is all 1px pixels)?
2. Let the three span elements with id equal to one, two, and three be displayed equally in the div with id equal to bigDiv?
Reply to the discussion (solution)
1 2 divs with id equal to oneDiv and twoDiv The heights are all 1px pixels This is wrong. The height of these two divs is determined by the content, that is, the text content.
1 The height of the two divs with id equal to oneDiv and twoDiv are both 1px pixels
This is wrong. The height of these two divs is determined by the content, that is, the text content.
-------------------------------
Sorry, I made a mistake, id equals oneDiv The two divs with twoDiv have no content.
The correct code is:
span id="one">First span
="two">Second span
three">The third span
Isn’t it just 3 lines of content with a dividing line in the middle
html tag structure Wrong
Don’t do it
Isn’t it just 3 lines of content with a dividing line in the middle The html tag structure is wrong
Don’t do it
-------- -------
When adding a dividing line, there is no way to control the width of the dividing line. The dividing lines are all the same width as the browser and cannot achieve the effect I mentioned
However, your "No. "One span", "second span", and "third span" are not centered horizontally and vertically.
Although it didn’t solve my problem, I still posted it.
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn