The Dilemma of Percentage Heights in JQuery Mobile

Seeking assistance with setting the height as a percentage of a header element in JQuery Mobile for my login page.

#login .ui-header
{
height: 62%;
}

The parent element's height is 615px on my test device, as shown in this screenshot found here.

Even though the parent has a height of 615px, the header only displays at 241px. Any suggestions on how to fix this issue?

Your help would be highly appreciated!

Answer №1

Are you looking to specify the height in pixels or as a percentage? Currently, it appears that only padding is having an effect. Have you considered adjusting the layout using padding instead of directly setting the height?

Take a look at this DEMO http://jsfiddle.net/yeyene/Rdfxs/1/

#login #my_header{
    padding: 20% 0 !important;
}

Answer №2

Appreciate all the input everyone. Unfortunately, using !important didn't resolve the problem as expected.

As a workaround, I decided to define the height of my page individually like this...

$(function() {
  $('#login').css({'height':windowHeight });
});

By doing this, it seemed to take precedence over any conflicting jQuery Mobile code, allowing the percentages to display correctly.

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

Inverting the hierarchy of a tree structure

I am currently working with a tree structure and utilizing the jstree jQuery plugin. My main objective is to reverse the structure. https://i.sstatic.net/PG1Ha.png The desired structure should resemble the one shown in this image. I have made modificatio ...

Ways to align text in the middle and shift it downward?

I'm currently attempting to center the bottom navigation bar using the following CSS code: #main-nav { margin-left: auto; margin-right: auto;} Unfortunately, this method is not achieving the desired result. I even tried adding <center></cen ...

How can you customize your WooCommerce add to cart functionality using Ajax to set a unique price for your products?

My current challenge involves adding a product to the cart during checkout through an on_click event. The price of this product is calculated dynamically using an external API, causing it to register with a price of 0 in WooCommerce itself. While I have su ...

How can I use AJAX to transmit a 2D array to a PHP page and then display each dimension individually?

Recently, I created a webpage with multiple checkboxes. Using jQuery, I am able to fetch data from these checkboxes and store them in a two-dimensional array. Here is an excerpt of my code: HTML snippet: <input type="checkbox" name="checkboxs[]" pric ...

The Jquery Floating Menu remains stationary and does not shift positions

I've been working on creating a sidebar that should start scrolling from a specific offset. I carefully followed a tutorial for this purpose: Unfortunately, no matter what I try, my sidebar refuses to move at all. Does anyone have any insights into ...

When the md-menu is clicked, the Top Nav shifts upwards along with the mdDialog buttons

Currently, I am in the process of developing a website using AngularJS and ASP.NET, incorporating Angular Material. However, I encountered an issue where scrolling on the page causes the top navigation to move up the body or essentially "disappear" when cl ...

IE doesn't seem to support framesets, while Mozilla browsers handle them just fine

Can anyone help with this code that works in Mozilla but not in Internet Explorer? The situation is urgent. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> <html lang="en" xmlns= ...

Avoiding additional empty lines between selectors when setting up Stylelint

Can anyone help me with configuring Stylelint options? Specifically, I want to enforce a rule that no empty lines are allowed between selectors in a list of selectors: &:focus, &:hover, &.active { color: #fb3a5e; text-align: left; text-de ...

Preserve the authentic picture along with a blur mask that can be dragged and applied to it

Is there a way to preserve the original image while having a draggable blur mask over it? If you want to see an example of a draggable blur mask over an image, you can check out this link: https://codepen.io/netsi1964/pen/AXRabW $(function() { $("#ma ...

Trouble accessing Angular page after resource call was made

Seeking assistance with creating a Dispatchsystem for the local taxi company using Angular. While not an expert in Angular and its functionalities, I encountered an issue after setting up angular-route to inject html pages into the main html document and e ...

What is the best way to expand and collapse a mat-expansion-panel using a button click

Is it possible to expand a specific mat-expansion-panel by clicking an external button? I've attempted linking to the ID of the panel, but haven't had any luck... <mat-expansion-panel id="panel1"> ... </> ... <button (click)="doc ...

A guide on how to selectively blur and make the background transparent in jgrowl notifications without affecting the content

After some experimentation, I found that making the jGrowl notification background both transparent and blurry was not possible. When applying blur to the background, the content also became blurry, which is not the desired effect. If you want a transparen ...

Having trouble displaying WordPress posts in a grid view on a single page

Currently, I am working on customizing a Wordpress theme that features a grid view. My goal is to dynamically load posts on the same page, similar to how it works on Twitter. I have experimented with various plugins such as infinite scroll, but unfortunate ...

Attempting to modify header color in various website sections without success

I've been struggling to figure out this code: <script> window.onload = function() {myFunction()}; window.onscroll = function() {myFunction()}; function myFunction() { const top1 = document.getElementById("big-landing ...

CSS hover effect: altering background colors of both parent and child elements simultaneously

HTML: <div class="container"> <div class="parent">one <div class="child">two</div> </div> </div> CSS: .parent { background: red; height: 200px; width: 200px; } .child { back ...

Displaying a distinct value from the data retrieved via an ajax call

I have implemented the use of jQuery AJAX to send data to a servlet in the following manner: var dataString = 'messageid='+ msgid1+'&receivedById='+receiverid; $.ajax({ type: "POST", url: "fetchSharePage", ...

Executing database queries in a synchronous manner in JavaScript

let positionConfig = require('setting'); function retrieveConfig(element) { let setting; positionConfig.find({element: element}, function (err,docs) { console.log(docs[0].current); // show the value setting = docs[0].curr ...

A guide to dynamically adding an HTML class using JavaScript

I have a login page with a text field for email and password, styled using the Bootstrap framework. I want to change the border color of the input field from grey to red when it is empty and the user clicks the login button. I tried implementing the code t ...

How to target the nested elements within a canvas using CSS

Can someone help me figure out why I am unable to style this canvas element? It seems like the CSS is not recognizing it because it is generated dynamically. Even using 'copy selection' does not seem to work. #drawing > div > div > canv ...

Jquery Datepicker is not hiding previous dates

Currently utilizing Jquery Datepicker in my project. When attempting to modify the date format, I have the following code: $( "#datepicker1" ).datepicker({ dateFormat: "dd-mm-yy" }); The above code is not functioning as expected. How ...