Opera 中的 CSS 最小化模式:在快速拨号扩展中定位
我正在尝试在快速拨号框中显示滚动列表,但定位有问题
我想知道列表对象何时太大而无法容纳该框,但据我所知,没有办法获得框的大小(以像素为单位)
如何获得最小化模式以准确显示在正常模式下看到的但适合框的内容?
这是我现在正在使用的CSS
* {
margin: 0;
padding: 0;
}
html {
height: 100%;
}
body {
background: #eee;
color: #444;
display: table;
height: 100%;
width: 100%;
}
output {
position:absolute;
width: 100%;
white-space:nowrap;
font-family: monospace;
}
,如果我在选项卡中打开文件,它可以正常工作,但是在快速拨号中,它会在
Opera的指南中放大显示,使用此查询:
@media screen and (view-mode: minimized) { }
我认为它控制着它在快速拨号中的显示方式。但我不知道该放什么
更新 好吧,我最终创建了一个元素并指定了 0 的底部值
,如下所示:
var bottom = document.createElement('div');
bottom.className= "ylimit";
document.body.appendChild(bottom);
在 CSS 中:
div.ylimit{
position:absolute;
bottom:0px;
}
然后每当我想检查或比较高度时,我都会使用 Bottom.offsetHeight
I'm trying to display a scrolling list inside a speed dial box but have a problem with the positioning
I want to know when the list object is too big to fit the box, but as far as I know, there's no way of getting the size of the box in pixels
how can I get the minimized mode to show exactly what it's seen in the normal mode but fitting the box?
this is the CSS I'm using right now
* {
margin: 0;
padding: 0;
}
html {
height: 100%;
}
body {
background: #eee;
color: #444;
display: table;
height: 100%;
width: 100%;
}
output {
position:absolute;
width: 100%;
white-space:nowrap;
font-family: monospace;
}
it works fine if I open the file in a tab, but in the speed dial it's displayed zoomed in
Opera's guide uses this query:
@media screen and (view-mode: minimized) { }
which controls the way it's displayed in the speed dial, I think. but I don't know what to put in there
UPDATE
well, I ended up creating an element and assigning a bottom value of 0
like this:
var bottom = document.createElement('div');
bottom.className= "ylimit";
document.body.appendChild(bottom);
and in CSS:
div.ylimit{
position:absolute;
bottom:0px;
}
then whenever I want to check or compare the height, I use bottom.offsetHeight
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论