Advise something to read good on css. My level: read books, watched courses, layered layouts 10 by psd, it was all mostly before the release of css3. From it I use only flex and border-radius. I would like to read something sensible and technical on css, for example, yesterday I installed a horizontal two-level menu.

<li> <a> <ul>...</ul> </li> 

For ul, the following styles are approximately:

 position:absolute; display:none; left:0; top:100% 

Everything is good, except that li in ul'e is 0 px high. I wonder why

1 answer 1

Because ul is given display: none. This means that it does not exist in the flow of the document. Therefore, li is an empty element, therefore it does not have height. Read advise http://htmlbook.ru

  • Well, with a hover on li, I ul'u assign display: block. - Edward
  • @Edward give a complete code example. - Vadizar
  • @Edward add code to your question and make it executable. - Vadizar
  • aaa, figured out, because there is a link inside, but it has float: left. Thanks for the tips - Edward
  • @Edward if helped - vote for my answer. - Vadizar