The CSS class in jQuery Mobile is not being properly displayed on the input field

I'm having trouble getting the .ui-input-text class to apply to the input field, despite using the jQuery Mobile class for text inputs. The border radius is not changing unless I manually add it in with CSS code. Here's my current setup:

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <title>Login Page</title>

    <style type="text/css">
        @font-face {
            font-family: 'RNS Camelia';
            font-style: normal;
            font-weight: normal;
            src: local('RNS Camelia'), url(http://localhost/codeigniter/fonts/RNS_Camelia.otf);
        }

        .ui-btn {
            width: 40% !important;
            height: 15px !important;
            border-radius: 50px !important;
            text-align: center !important;
            background-color: #D6DE23 !important;
            font-family: 'RNS Camelia', serif !important;
        }

        .login_button {
            margin-left: 20px !important;
            text-align: center !important;
        }

        .ui-page {
            background-image: url('../codeigniter/images/background.jpg') !important;
            width: 100%;
            background-size: 100% 100%;
            background-repeat: no-repeat;
        }

        ​ .ui-input-text {
            border-radius: 50px !important;
        }

        .user_pass {
            text-align: center!important;
            color: white!important;
            font-family: 'RNS Camelia', serif!important;
            font-size: 16px!important;
            height: 20px!important;
        }

        .text_input_wrap {
            margin-right: 15px !important;
        }

        .bottom_links {
            color: white!important;
            font-family: 'RNS Camelia', serif!important;
            text-decoration: none !important;
        }
    </style>

    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jquerymobile/1.4.3/jquery.mobile.min.css" />
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/jquerymobile/1.4.3/jquery.mobile.min.js"></script>
</head>

<body>
    <div data-role="page">
        <div class="ui-content" data-role="main">
            <img border="0" src="<?php echo $this->config-"base_url();?"   images/logo_only.png" alt="Logo Bar Express" style="margin:0px;width:313px;display:inline;height:142px;float:left;" />
            <div style="clear:both;"></div>



            <div class="ui-grid-b">
                <div class="ui-block-a">
                    <div class="user_pass">Enter Username</div>
                </div>
                <div class="ui-block-b">
                    <div class="user_pass">Enter Password</div>
                </div>
            </div>

            <div class="ui-grid-b">
                <div class="ui-block-a">
                    <div class="text_input_wrap">
                        <input type="text" id="username" name="username">
                    </div>
                </div>
                <div class="ui-block-b"> </div>

            </div>


            <input type="password" id="password" name="password">

            <div class="ui-grid-solo">
                <div class="ui-block-a">
                    <div class="login_button">
                        <input type="submit" value="LOG IN">
                    </div>
                </div>
            </div>



        </div>
    </div>

</body>

</html>

Answer №1

Make sure to add the following code snippet at the end of your stylesheet file.

Check out this FIDDLE Demo

.ui-input-text{
    border-radius: 50px;
}

Answer №2

It is recommended to move the <style> block from the Head section to your body. This is because jquery mobile uses ajax, which will not load anything from the Head.

To learn more, click here

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

Looking for a way to enhance image resizing animations in JavaScript for a seamless visual

Having two images inside a container means not knowing their size in advance after uploading. The resize function used helps fit the images within the container, but the animation appears choppy. Is there a way to improve its smoothness? $(window).load(f ...

What is the process for sending a request and obtaining a response from a REST API using JavaScript?

I have a private server set up on my computer with a built-in REST API. The base URL for the API is: . I am now looking to develop a client application for this server using the API. To authenticate on the server, the API endpoint is baseurl/login with the ...

Received this unexpected error message upon reloading the page in a ReactJS application: SyntaxError: Unexpected token '<'

Every time I refresh the page, I encounter the error Uncaught SyntaxError: Unexpected token '<'. This error originates from a top-level component named <Navbar /> that I included in App.js. Oddly enough, the issue only arises upon refres ...

Interactive JavaScript function designed to react to user commands

Struggling to develop a JavaScript/AngularJS function that notifies the user whether a entered number is too high or low (> 100 indicates it's too high)? Check out the HTML code below: <div> <p id="num">Number : <input type="nu ...

What is the best way to insert a character (::before) before an element?

I am trying to add a circle/dot using ::before on an element. • • However, I cannot seem to make it visible! .line ::before{ content:'•'; } and .line ::before{ content:'•'; } (Still not showing) I ...

Issues with playing Html 5 video arise when making an ajax call

My goal is to implement an AJAX call followed by displaying an HTML5 video. The provided code snippet seems to be ineffective. $.ajax({ type: "POST", url: "Videos.aspx/GetBlocs", contentType: "application/json; charse ...

What could be causing the read-only error in my presentation?

My website has always had a small slider that worked perfectly, but now an error message keeps popping up: Error: "myIndex" is read-only This is the JavaScript code in question: const myIndex = 0; carousel(); function carousel() { let i; const x = ...

Issue with min-height property in IE8 (and potentially other browser versions)

Trying to design a web page with 3 sections, each occupying 100% of the window height. Managed to make it work on Chrome, Firefox, and Safari, but facing compatibility issues with IE8 and possibly other versions. Test out the page here: Here's the H ...

Steps for incorporating one item into another object

I'm struggling to add an object to another object. I've created an object with two properties and now I want to assign it to another object. $scope.urlMappings = {}; $scope.Mapping = function() { ...

Utilizing PHP for Substituting URLs within HTML

Is there a way to use PHP to eliminate an entire <iframe> tag that contains the link abc.com? If I searched the following code for abc.com: ‹iframe src="http://abc.com/abcd.html"›‹/iframe› ‹iframe src="http://abc.com/lmno.html"›‹/ifr ...

What is the best way to locate the final text node within the <p> element?

Looking at the code below, my goal is to identify and retrieve the text node that serves as the last child element. <p class="western" style="margin-bottom: 0.14in"> <font color="#000000"> <font face="Arial, serif"> <font ...

Removing background color when clicking and dragging using CSS

I'm facing an issue with a resizable div that is cropping part of my webpage. Whenever the mouse moves and clicks on the titles and images, a background color appears, as seen in the picture below. Can someone please help me resolve this problem? htt ...

Generating dynamic divs in parallel

Despite encountering numerous posts related to the issue at hand, none of them have solved my specific problem. I am aiming for 3 divs to display in each row, but the current code is causing each div to show up on a new line vertically: JQuery ...

Adjust the size of a Div/Element in real-time using a randomly calculated number

Currently, I am working on a script that is designed to change the dimensions of a div element when a button on the page is clicked. The JavaScript function connected to this button should generate a random number between 1 and 1000, setting it as both the ...

Ensure that both textarea and pre elements have equal dimensions and line wrapping behavior in Internet Explorer

I am in the process of implementing a dynamic textarea that resizes automatically, based on a technique discussed in this article: Alistapart: Expanding Textareas (2011). The idea is quite straightforward: by using a pre element to mirror the input in the ...

How can I add a hyperlink to a Javascript string array?

I am currently facing a challenge in adding a hyperlink to a string using .link and .innerHTML methods. I believe there might be a misunderstanding on my part as I am quite new to this. Here is the code snippet I have been working with: <div id="type ...

Steps for exporting a module from a JavaScript file that is linked:

When I include the main.js file in my project, the code below works properly: modules.exports = { property: value } However, if I include it in a web page like this: <!DOCTYPE html> <html> <head> <script src="main.js"& ...

Counter for the type="range" HTML input

I recently read an article discussing the possibilities of displaying ticks in Chrome and Firefox for a number input with the type "range". I was intrigued to find out more about this feature and came across a helpful discussion on Stack Overflow. ...

When the @gridGutterWidth(s) is set to 0px for a flush grid in Bootstrap, the navbar's 'a.brand' breaks onto its

Big shoutout to the amazing StackOverflow community for helping me eradicate countless bugs before they even surfaced. Your crowd sourcing powers are truly magical. I'm in the process of building a website using the Wordpress Roots theme, which is ba ...

Automatic width table design

I am trying to position the "User ID" label closer to its value by aligning it to the right side, as shown in the picture below. I have attempted using additional colspan's but haven't been successful. The User ID can contain anywhere from 1 to 9 ...