Creating a layout in jQuery Mobile with two HTML <input type="button"> elements positioned side by side and each taking up 50% of the screen

After trying numerous strategies, I am still struggling to place two buttons next to each other evenly:

<input type="button" value="This week's Schedule" onclick= 'window.location.href = dic[current_sunday]' /> 
<input type="button" value="Next week's Schedule" onclick= 'window.location.href = dic[next_sunday]' />

The goal is to have one button occupy 50% of the row and the other button take up the remaining 50%, creating this layout:

{---------------------------------------}{--------------------------------------}

I require a solution that is compatible with jquery mobile. While I have come across methods that work for standard formats, none seem to work with jquery mobile and <input type"button"

For instance, the following code snippet:

<style>
.ui-block-a { width: 70% !important; }
.ui-block-b { width: 20% !important; }
</style>
<div class=ui-grid-a>
  <input type="button" value="This week's Schedule" onclick= 'window.location.href = dic[current_sunday]' /> 
  <input type="button" value="Next week's Schedule" onclick= 'window.location.href = dic[next_sunday]' />
</div>

does not produce the desired result when using <input type="button", but it works with

<button type="button">eat</button>

Even employing data-inline="true" as shown below:

<input type="button" data-inline="true" value="This week's Schedule" onclick= 'window.location.href = dic[current_sunday]' /> 
<input type="button" data-inline="true" value="Next week's Schedule" onclick= 'window.location.href = dic[next_sunday]' />

positions the buttons side by side, but their sizes are determined by the content.

In summary, I am seeking a solution to position two buttons side by side, each occupying 50% of the screen, within the constraints of jquery mobile and <input type="button"

Many thanks!

Answer №1

Summary: Creating two buttons positioned side by side with each taking up 50% of the screen using jQuery Mobile.

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

Tips for customizing font color on Google Maps Marker Clusterer

Is there a way to adjust the font color of a markerclusterer marker? Below is my current code for customizing the marker's style: mcOptions = {styles: [{ height: 27, url: "image.png", width: 35 ...

An issue occurred while the request was being transported or processed, resulting in Error code 10 at Path /wardeninit

Currently, I am attempting to pass an object (specifically the contents of a row from a sheet) to an apps script template. The screenshot displays the actual row. https://i.stack.imgur.com/IzMrn.png The function in my apps script consists of the followin ...

What is the procedure for extracting data from a JSON file within an HTML document?

Hey there, I am currently working on reading data from a json file using ajax. I have created a Video object that consists of Courses objects with titles and URLs. However, when attempting to read the title and URL of HTML as an example, I am not seeing a ...

When using the onclick function, an unexpected behavior occurs where instead of displaying content, the page

Below is a summarized version of my code: HTML <a onclick="showHideDiv('bio')" target='_self'> bio <div id="bio" class="shadowScreen" style="display: none;"> <p class="showBio"> Bio! </p> &l ...

The Angular ng-repeat directive is populating a list with items, but the parameters enclosed in double curly braces

After calling an API, the response contains data in the following format: [{name: "ABC", age: 20}, {name: "DEF", age: 25}] Even though the $scope.names variable is assigned with the array from the API, when viewed in the browser, it displays 2 rows but th ...

jQuery struggles to process large response

I am currently developing an application that sends requests to a URL and parses the table found in the HTML response using jQuery. While this method works well for smaller amounts of HTML code, it runs into issues with larger datasets. The problem arises ...

Changing the color of a Highcharts series bar according to its value

Playing around with Highcharts in this plunker has led me to wonder if it's possible to dynamically set the color of a bar based on its value. In my current setup, I have 5 bars that change values between 0 and 100 at intervals. I'd like the colo ...

What are the reasons for the POST method malfunctioning in a mobile web application?

Currently, I am in the process of developing a mobile web application using PhoneGap. At the moment, I am successfully passing data between the client (HTML page on the mobile device) and the server (PHP on the server) using the GET method. However, when a ...

Incorporate custom styles into Joomla articles

Is there a way to apply custom styles to articles in Joomla without them getting deleted by the editor? <style> span{ color: #0099ff; } img{ float: right; } </style> <div> <h3> <span ...

The document scales down automatically as I decrease the size of the window, but does not adjust when I switch to a mobile viewport

I've been working on developing a web app with a focus on mobile-first design. When I scale down my Chrome window, everything looks responsive and functions well, adjusting objects to fit the smaller screen size. However, I noticed that when I switch ...

Cells within a table are equivalent

I am attempting to ensure that all table cells match the size of the image, but for some reason, they are not aligning properly. Visit this link for reference. Here is a condensed version of the HTML code: <table> <tr> <td> ...

Tips for utilizing a variable within a variable containing HTML code

Is it possible to incorporate variables in a JavaScript function that includes HTML code? Let's consider the following example: function SetCFonts() { var Color = $('#CColor').val(); var Font = $('#CFont').val(); var S ...

When attempting to change the text in the textarea by selecting a different option from the dropdown list, the text is not updating

I am facing an issue with three multi-select dropdown lists. When a user selects options from these lists and then presses the submit button, the selected text should display in a textarea. However, if the user manually changes some text in the textarea ...

How to exclude elements nested inside another element using CSS or XPath techniques

Presented here is a snippet of XML code: <xml> <section> <element>good</element> <section class="ignored"> <element>bad</element> </section> </section> </xml> Identifying a ...

Vue.JS and its Onclick event handler allows for dynamic and interactive

These are my two buttons: <button onclick="filterSelection('Action')">Action</button> and <button onclick="filterSelection('Adventure')">Adventure</button> Now, I'm trying to achieve the same fun ...

Sass encountered an issue when trying to import using the "~" symbol from the node_modules directory

I am currently developing a single-page web application using Angular 6, and I recently integrated the ngx-toast library into my project. However, I encountered an issue when trying to load the libraries by adding the following Sass code with the "~" symb ...

When encountering a 404 redirect, CSS and JS files may fail to display

I created a unique error message using .htaccess, incorporating CSS and JS in separate folders. Although it functions properly when accessed directly, integrating these resources into the 404 Error message results in only the HTML text being displayed with ...

Showing MYSQL data in an html table

Hey there! I've been working on a website that features HTML5 video player to play videos. I have a "watch" page that retrieves data from the database based on the id parameter (watch.php?v=1). Now, I'm looking to display the most recent videos o ...

What is the best way to use CSS 3 to resize and enlarge an image, such as sprite icons?

Hello everyone, Picture this: a sprite image named icons.png linked to the css class .icons, featuring various 10x10px graphics. Now imagine needing another class that enlarges these sprite graphics exactly twice their size, making them 20x20 pixels on the ...

Tips for adjusting the position of overflowing text on a website using CSS in real-time

I'm currently working on an Angular application and I'd like to customize the styling so that any text exceeding 128 characters is not displayed. Ideally, if the text exceeds 128 characters, it should move to the left; otherwise, it should remain ...