CSS 不会永久改变

发布于 2024-12-17 13:52:39 字数 1216 浏览 3 评论 0原文

模糊的问题,但我也不知道问谷歌的正确问题。

我有一个小部件,其背景图像位于我页面上的列中。但是,当我调整页面大小时,我的小部件将被销毁,从而无法横向滚动页面。背景图像也被剪掉。

另外:我该如何准备我的页面以适应不同的屏幕尺寸?有没有办法让我的小部件粘在一个地方?有人能指出我正确的方向吗?

谢谢

.example_wrapper
{
    margin: 10px 20% 10px 20%;
    border-style: solid;
    border-width: 0px;
    height: 315px;

    border-radius: 20px;      
}

.example_container
{
    margin: 10px 0px 10px 3%;
    align: center;
    border-radius: 0px;
    height: 300px;
    overflow:auto;      
    background-image: url('img.png');
    background-repeat: no-repeat;
    background-position: center;
}

.example_textarea
{
    position: absolute;
    margin: 145px 30% 0 5%;
    align: left;
    overflow: hidden;
    height: 130px;


}

.twitter_block
{
   position: left;
   margin: 6px;
   height: 120px;
   width: 120px;
   align: left;
   float: left;


}



.twitter_pic
{
    position: center;
    margin: 1px 20% auto 20%;

}

.scale-image
{
height:73px;
width: 73px;


}

.twitter_link
{
position: none;
margin: 0px 100px auto 30px;
}

.twitter_half
{
margin: 0px;


}

.twitter_profile_pos
{
text-align: center;
margin: 0px 10px auto 17px;
font-weight: bold;

}

.twitter_profile_pos a
{
color: #043E6B;

}

Vague questions but i don't know the right question to ask google either.

I have a widget that has a background img that is in columns on my page. But when I resize the page my widget will be destroyed making impossible to scroll the page sideways. The background image is also cut off.

Also: how can I prepare for my page to adapt to different screen sizes? Is there a way to make my widget stick in one place? Can anyone point me in the right direction?

Thanks

.example_wrapper
{
    margin: 10px 20% 10px 20%;
    border-style: solid;
    border-width: 0px;
    height: 315px;

    border-radius: 20px;      
}

.example_container
{
    margin: 10px 0px 10px 3%;
    align: center;
    border-radius: 0px;
    height: 300px;
    overflow:auto;      
    background-image: url('img.png');
    background-repeat: no-repeat;
    background-position: center;
}

.example_textarea
{
    position: absolute;
    margin: 145px 30% 0 5%;
    align: left;
    overflow: hidden;
    height: 130px;


}

.twitter_block
{
   position: left;
   margin: 6px;
   height: 120px;
   width: 120px;
   align: left;
   float: left;


}



.twitter_pic
{
    position: center;
    margin: 1px 20% auto 20%;

}

.scale-image
{
height:73px;
width: 73px;


}

.twitter_link
{
position: none;
margin: 0px 100px auto 30px;
}

.twitter_half
{
margin: 0px;


}

.twitter_profile_pos
{
text-align: center;
margin: 0px 10px auto 17px;
font-weight: bold;

}

.twitter_profile_pos a
{
color: #043E6B;

}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

反差帅 2024-12-24 13:52:39

这可能是某种清算问题,也可能与您的持仓规则有关。

position:noneposition:leftposition:center 不是有效规则。所以这些对解决任何定位问题都无济于事。

如果 position:relative 未应用于父元素,position:absolute 可能会破坏您的布局(否则它将元素relative 定位到整个元素)文档,而不是特定元素)。这可能会导致调整大小时中断。

如果您可以发布相应的 HTML,那么每个人都应该能够重新创建它。或者更好的是,如果您将代码发布在 jsfiddle 上并将链接放在这里,我们可以帮助您更快地解决问题! !

It could be some sort of clearing issue, or it could be something to with your position rules.

position:none, position:left and position:center are not valid rules. So those won't help with any positioning issues.

position:absolute might be breaking your layout if position:relative is not applied to the parent element (otherwise it positions the element relative to the whole document, rather than a specific element). This could be causing the break on resize.

If you could post your corresponding HTML, everyone should be able to recreate it. Or better yet, if you post the code on jsfiddle and put the link here, we can help solve it even faster!!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文