css transform scroll,html - CSS Transform scale scrolling issue - Stack Overflow

I am creating a web app that uses CSS' transform scale property. As shown by the image below, I have an object inside of a container, which fits nice and snugly inside, without any overflowing content. This is how I wish for it to be.

BAaWS.png

My issue is brought up when I re-scale the object to a size greater than the container. As shown by the image, clearly the object is larger than the container. As marked by the arrows and labels of "scrollable area", the container can scroll to these areas, but the parts labelled with "hidden" are not visible or accessible through the scroll due to their overflow.

35HyK.png

For a practical view of my issue, here's a link to a codepen with my code:

Snippets of my CSS code area as follows:

#container {

position: fixed;

width: 300px;

height: 200px;

border: 1px solid #000000;

left: 0px;

top: 0px;

margin-left: 330px;

margin-top: 10px;

overflow: scroll;

display: block;

text-align: center;

}

#object {

position: relative;

width: 120px;

height: 120px;

display: inline-block;

background-color: rgba(255, 0, 255, 0.45);

margin-top: 40px;

border-radius: 25px;

transform: scale(3); /* This would be scale(1) on the small object */

}

This issue is holding back the development of my web app, so thanks in advance for your time and contributions.

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值