Dynamically changing height of div element based on content

前端 未结 3 1751
有刺的猬
有刺的猬 2021-01-14 05:28

I\'m working on a Facebook-like toolbar for my website.

There\'s a part of the toolbar where a user can click to see which favorite members of theirs are online.

3条回答
  •  青春惊慌失措
    2021-01-14 05:34

    You should take out the CSS height:25px property in the toolbar, the contents will expand the container. Also, ID selector tags are unique and you can specify directly to them without having to reference the ancestor:

    INCORRECT:

     #toolbar #popUpAction  { /*some css */ }
    
     #toolbar #popUpAction a  { /*some css */ }
    

    CORRECT:

     #popUpAction  { /*some css */ }
    
     #popUpAction a  { /*some css */ }
    

提交回复
热议问题