实现css输入范围 [英] Materialize css input range

查看:145
本文介绍了实现css输入范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何在滚动范围输入时显示范围的值

I was wondering how to have the value of the range to show up when scrolling the range input

<form action="#">
                                                  <h5>The Temperature</h5>
                                                  <!--the temperature-->
                                                    <p class="range-field">
                                                      <input type="range" id="temp" min="0" max="100" />

                                                    </p>


推荐答案

相关对象的放置方式确实是相对于文档或相关容器的页边距。例如,你有一个标题,你想要定位在屏幕的左上角,那么代码可能看起来像这样。

When working with position: relative; the way the object in question is positioned is indeed relative to page margins of your document or relevant container. So for example, of you had a header that you wanted to be positioned in the upper left hand corner of the screen, then the code may look something like this.

h1 {
position: relative;
top: 5px;
right: 5px;
}

其中元素相对于浏览器窗口或父元素定位。因此,虽然相对定位不影响除了特定目标之外的任何其它元素,但绝对定位可导致重叠元素,因为对象被放置在特定位置。例如,如果你想在屏幕的右下角放置一个图像,你的代码可能看起来像这样。

Now compare that to position: absolute; where elements are positioned in relation to the browser window or parent element. So while relative positioning does not affect any other elements other than what is specifically targeted, absolute positioning can result in overlapping elements because objects are being placed in specific locations. If you wanted to position an image in the lower right corner of the screen, for instance, your code may look something like this.

img {
position: absolute;
bottom: 0px;
right: 0px;
}

这篇关于实现css输入范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆