开发者

How to emulate/create css overflow-top and overflow-bottom?

开发者 https://www.devze.com 2023-03-15 00:03 出处:网络
I\'m using stylish to modify a website and I have this div full of text the needs to be moved upwards. The problem is the surrounding div has overflow-y:hidden to prevent text from flowing down the pa

I'm using stylish to modify a website and I have this div full of text the needs to be moved upwards. The problem is the surrounding div has overflow-y:hidden to prevent text from flowing down the page. How can I allow overflow up but not down.

P.S. I know the css properties I used in the title don't exist, although if they did the style would already be 开发者_Python百科done.


I needed to same, I found out you can just use clip, it's a very handy css property that isn't very much known. It does exactly what you want, you can shape the dimension of a div to your liking. With clip you for example can do something like

  <div id="myBox" style="clip: rect(10px 100px 100px 10px);">This is some text to play with so you can see it is clipped.</div>
0

精彩评论

暂无评论...
验证码 换一张
取 消