What is the best approach to place a label between the jqm rangeslider and the sliderthumb?

My goal is to place the label between the slider and the slider thumb in order to maximize screen space utilization. However, I am facing an issue where the label appears above everything and I am unable to resolve it using z-index...

HTML:

<div class="container">
    <div class="slider">
        <label for="slider1" class='sliderlabel'>Test</label>
        <input type="range" id='slider1' min="0" max="100" data-role="none">
    </div>
</div>

CSS:

.sliderlabel {
    z-index: 1;
    color: white;
    left: 35%;
    position: absolute;
}

input[type="range"]::-webkit-slider-thumb {
    z-index: 2;
    -webkit-appearance: none !important;
    width: 20px;
    height: 20px;
    background-color: #579e81;
    border-radius: 30px;
    /*    box-shadow: 0px 0px 3px #3c6d59;*/
    transition: all 0.5s ease;
}

An example of the code can be found here : http://jsfiddle.net/bjvDB/3/

Answer №1

Here's a different approach to solve the problem:

CSS:

    .label {
        position: absolute;
        margin-top: 10px;
        margin-left: 100px;
        z-index: 2;
    }
    #slider1 {
        position: relative;
        z-index: 1;
    }
    .ui-btn {
        z-index: 3!important;
        background-color: red!important;
    }

HTML:

 <div data-role="page">
        <div data-role="content">
            <div class="label">
                TEST
            </div>
            <div>
                <input class="slider" type="range" value="0" min="0" max="100" id="slider1" step="5" />
            </div>

        </div>
    </div>

http://jsfiddle.net/cq69z/

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Show a variety of months using a datepicker arranged neatly in rows and columns

I need to display 13 months using multidatespicker. I achieved this with the following code: $(document).ready(function(){ $('#my_calendar').multiDatesPicker({ numberOfMonths: [4, 4], dateFormat: 'dd-mm-yy&a ...

Chosen Dropdown selection - Retrieve/Receive information

One of the challenges I'm facing involves a dropdown list on my web form that contains various dates. My main query is: How can I retrieve data for the selected date from a MySQL database and present it to the user? Additionally, if the chosen date do ...

Steps to retrieve specific text or table cell data upon button click

Greetings, I am a beginner in the world of html and javascript, so please bear with me :) My challenge involves working with a table in html. Each row contains a dropdown menu (with identical options) and a button. When the button is clicked, I aim to sen ...

Is it possible to utilize Bootstrap Icons as bullet points on a website?

Is it possible to use Bootstrap icons for bullet points with CSS? I am aware that FontAwesome can be used for this purpose, but I would like to confirm if the same can be achieved using Bootstrap. Though there is a method using: <ul> <li>< ...

How can I successfully submit a POST request to a route in Laravel 4.2 using AJAX despite receiving a status of cancelled

I've been pondering this dilemma for quite some time now. I have a block of jQuery code that executes an AJAX post to a URL within the website when the user navigates away from the current page they are on. The issue arises when I'm on the URL c ...

Looking for tips on how to achieve a sleek search bar expansion effect when focusing using w3.css?

I have been trying to utilize the following code to create a Google search bar that expands when focused within a w3.css navigation bar-item. While it does expand and contract on focus/blur, I am unable to achieve smooth transitions between sizes. The sear ...

Shadows appear distorted in Internet Explorer 9

After searching online for how to add shadows to my containers, I came across this code that I applied to my divs: .boxShadow { -webkit-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5); -moz-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5); -ms-filter: " ...

The @Input decorator in Angular 2/4 is designed to only transfer fundamental values and not collections or complex data

I have encountered an issue while attempting to use @Input with a list of objects, where the @Input variable ends up being undefined. What is functioning properly can be seen in home.component.html: <p> <it-easy [mycount]="countItem" (result ...

Hide the HTML select dropdown if there are no available options

How can I remove the dropdown options list when the select element is empty in Windows/Chrome? The issue arises where it displays an empty dropdown with a box shadow around it. Is there a CSS solution for this problem? I am unable to use the disabled attr ...

Arrange the radio buttons vertically, one beneath the other

Is there a way to align radio buttons vertically instead of horizontally like this? Sex (button)Male (button) Female No matter what I try, it ends up looking like this ...

How can I resolve the vertical adjustment issue of Bootstrap 5 input group on mobile devices?

My current issue involves using Bootstrap 5.2.3 to create an input group that displays a set of spans with the ".input-group-text" class alongside inputs with the ".form-control" class. While this setup works well on a computer screen, it does not adjust c ...

Tips for extracting header ID from the HTML/DOM using react and typescript

I developed a unique app that utilizes marked.js to convert markdown files into HTML and then showcases the converted content on a webpage. In the following code snippet, I go through text nodes to extract all raw text values that are displayed and store t ...

Incorporate symbols and unique characters in your dataset

When retrieving records from the database, I noticed that some of them contain apostrophes. For example, one record has a name like this: CC CHÂTEAU D'IF However, when looking at the element, the data-attribute appears to be incorrect: data-vess ...

Firefox failing to display fonts from Google Font API

The landing page our company outsourced does not display the Lato font in Firefox, resorting to a different option instead. We have received a stylesheet from fonts.googleapis.com that includes the following: @font-face { font-family: 'Lato'; ...

I am attempting to transfer information from a website I manage to a different one

Currently, I am in the process of extracting information from a website that I manage (referred to as Site A), and transferring it to another site that I am setting up (Site B). To accomplish this task, I am utilizing $.getJSON to fetch the data from Site ...

Successfully Determining User Identity with Ajax Authentication

Currently, I am facing a security issue with my login page that uses an Ajax request for user authentication. The password entered by the user is sent as plain text in the form data of the Ajax request, making it vulnerable to interception by sniffing tool ...

Obtain the value of the submit button that was clicked

I have been struggling to retrieve the value of one of two submit buttons from my form. No matter what I try, I can't seem to get it right. Is there anyone out there who can lend a hand and show me the correct way to do it? Below is the HTML form in ...

Thumbnail vanishes upon being selected

To access my template site currently, please click here. Currently, the first thumbnail on my website is set up to display a gallery of images in FancyBox once clicked, similar to a question asked on StackOverflow that you can view here. Below is a snipp ...

Learn the steps to create a 3D carousel that spins on its own without the need for manual clicks and pauses once the

Looking for a solution to create a 3D carousel that rotates continuously without the need for buttons to be clicked, and pauses when the mouse hovers over it, then resumes rotation when the mouse is not hovering over it. var carousel = $(".carousel"), ...

What is preventing my HTML from rendering on the page?

I have cross-referenced the script below with the google charts documentation available at the following link: https://developers.google.com/chart/interactive/docs/gallery/scatterchart However, it is not displaying properly. I have reviewed the code and ...