Why does overflow-x:hidden clip my descenders?

后端 未结 2 722
甜味超标
甜味超标 2021-02-12 16:51

I would like to have a title element with overflow-x:hidden and overflow-y:visible. However, for some reason the overflow-y property does

2条回答
  •  Happy的楠姐
    2021-02-12 17:28

    It seems changing the H1 element into an inline element will get you the desired results:

    h1 {
        margin: 10px;
        padding: 0;        
        overflow-x: hidden;
        overflow-y: visible;
        line-height: 0.5em;
        display:inline;
    }
    

    Just make sure the following element is a block element so it doesn't start in the same line. That or use the correct line-height and then use negative margins. After all, I can only guess what you're trying to do... Good luck!

提交回复
热议问题