The Div element on my webpage is not adjusting properly to fit the size of mobile devices

My app was created using Quick flip 2, and I needed to resize it for mobile screens, so I implemented jquery-mobile.

Here is the code snippet:

<!--css-->

<style>
.quickFlip, .quickFlip3 {
    height: 350px;
    width: 400px;
}
.quickFlip2 {
   height: 150px;
    width: 40%;
    float: left;
    margin-right: 9%;
}

/* other irrelevant styles */

</style>
<!--Javascript-->
<!-- JavaScript imports omitted -->
</head>
<body>
<div data-role="page">

  <div data-role="main" class="ui-content">
     <div class="quickFlip">
        <div id="imgContainer" class="blackPanel">

            <center><input id="click_flip" type="button" class="quickFlipCta" value="Flip to see the Answer" ></center>
        </div>
          ...
    </div>

  </div>

  </div> 

The resizing is not working as expected. What modifications should be made to fix this issue?

The page div is resizing properly, but the QuickFlip div is not responsive.

Answer №1

.cendiv{
  background: #e5e5e5;
  bottom: 0;
  height: 80%;
  left: 0;
  margin: auto;
  position: absolute;
  top: 0;
  right: 0;
  width: 98%;
}

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 using jQuery to slowly change a CSS property to "auto"

I've encountered a situation where I have an element styled with position:fixed, and bottom: auto;. When I apply the command .animate({bottom : '10%'});, it smoothly slides to the specified position. However, when I try to set it back to its ...

Unable to generate a "test" directory in Android Studio for Robolectric testing

Looking to incorporate Robolectric tests into my project using IntelliJ. I attempted to follow this tutorial However, I am unable to add the "test" package under my main module. Additionally, the "build variants" appear different compared to the tutoria ...

Is there a way to modify CSS class names on-the-fly within an Angular project?

I am working with two CSS classes named as below: .icon_heart{ color: #bdbdbd; } .icon_heart_red{ color: #a6b7d4;; } Within my HTML code, I have incorporated a heart icon. <div class="icon_heart" *ngIf="showheartIcon"> ...

Is there a way to automatically increase the input id when adding a new row?

I have been working on dynamically adding new inputs and trying to assign a new ID that increments by 1 each time I add a new input. However, I am facing an issue where the value is not incrementing as expected. Can someone please help me identify what&apo ...

When submitting an Asp net mvc Form, some fields may not be posted as expected

I'm facing an issue with my ASP.NET MVC application form. Some fields that should be posted are missing, and I can't figure out why. <form id="FormRegistroUsuario" action="/Account/AdminSecurityUserAccountAdd"> <fieldset> ...

Using JavaScript to send formatted text through POST requests in a Rails application

Within APP A, I have the following formatted text: A beautiful painting because I created it because an artist endorsed it because my cat loves it I can access this formatted text in index.html.erb through product.body_html, which I then load into a Ja ...

The edit functionality in jqGrid does not function properly if custom search parameters are designated

Using the Guriddo jqGrid JS version 5.2.0 implemented here: @license Guriddo jqGrid JS - v5.2.0 - 2016-11-27 Copyright(c) 2008, Tony Tomov, [email protected] The code block below showcases an entire self-contained implementation of jqGrid. It inclu ...

unexpected result from ajax call

After successfully establishing the ajax call, I encountered an issue when trying to retrieve a response from the PHP file. In my .php file, I have <?php echo 'hello'; ?>. However, when I alert the parameter in the success function, it disp ...

Create an HTML component that expands to fill any leftover space on the page, without using flex

In my current situation, I have two elements positioned side by side with dynamic widths based on their content. The element on the right needs to fill up as much vertical space as possible without a set width. I am looking for an alternative to flexbox d ...

Tips for employing Flex-grow alongside the behavior of "justify-content: start"

I am working with a flex container setup like this: .container { display: flex; flex-flow: row wrap; justify-content: start; width: 100%; } .item { border: 1px solid red; flex: 1 1 33%; height: 100px; } <div class="container"> <d ...

Could anyone explain why only one button seems to be functioning properly? It's always the top one that works, but never both simultaneously

Seeking assistance with getting two buttons to function on a single activity. Despite trying various methods, I am unable to get both buttons to work properly. Any help would be greatly appreciated as I have the code ready but can't share it here. ...

Refreshing the dropdown selection to a specific option using AngularJS and either JavaScript or jQuery

Currently, I am facing an issue with resetting the select tag to its first option. I have implemented Materialize CSS for styling purposes. Despite my efforts, the code snippet below is not achieving the desired outcome. Here is the JavaScript within an ...

Obtaining attribute from an object using JQuery

I am experiencing an issue with extracting the innerHTML from an object. The code I currently have is as follows: console.log( $(myString).find("#" + someID).prevObject ); The variable myString contains HTML code in string format someID represents the ...

Analyzing a JSON Structure Containing Numerous Sub-Objects

<script type="text/javascript" src="http://static.stackmob.com/js/2.5.3-crypto-sha1-hmac.js"></script> <script type="text/javascript"> $j.ajax({ dataType : 'json', url : "/api/core/v2/groups/", //or any other res ...

Encountering issues with styled component's flex not functioning as expected in React

I am currently working with styled-components, and I have been using "flex" for responsive design. However, I am facing some challenges in implementing it. The CSS defined within styled-components does not seem to be applying properly. The styles are not ...

What is the correct way to write the syntax for wp_register_style function in

I'm attempting to include a cache-buster version in my CSS file. The guides mention: <?php wp_register_style( $handle, $src, $deps, $ver, $media ); ?> However, I've scoured Google and Stack Overflow for the correct formatting of these var ...

jQuery does not support PHP code recognition

I'm facing an issue with a function that gets called when I click a button. The data I pass to this function is not wrapped in a form tag, so I am manually including the csrf token: function NewDeleteBox(box_id, batch_id, staff_id){ $.ajax({ ...

Unable to locate a suitable retrieval method for the private boolean field in OrmLite

While working on my Android application with OrmLite, I encountered sporadic crashes with an error message indicating a problem with a missing getter method. java.lang.RuntimeException: Unable to start activity ComponentInfo{com.app/com.app.MainActivity_ ...

Utilize jQuery to style the background of the webpage, while excluding the Modal element when using Bootstrap

I'm currently working on implementing foggy.js () to create a blurred background effect for Bootstrap's Modal. While I've successfully blurred all elements in the background, the Modal Popup itself is also appearing blurry. So my question is ...

Tips for resizing an image to perfectly fit on a compact HTML5 canvas without sacrificing its quality

I need assistance with my code. I'm trying to draw an image on the canvas while maintaining its quality. const canvas = document.getElementById("canvas"); const context = canvas.getContext("2d"); canvas.width = 360px; canvas.height = 360px; const img ...