Win a copy of TensorFlow 2.0 in Action this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

CSS height and width getting set to 0 px

 
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on a hybrid mobile-app and one of the screens is having an issue where the height and width of a div element is being set to 0px causing the screen to not display as required.

Below is how the screen is expected to look like:



The issue is with the grid like div element in the middle. When this screen is displayed above as required, the height and width of this div is set to 500px and 358px respectively.



However, the issue is that when this screen loads for the first time, the screen is displayed as below:


As can be seen, the grid in the middle is not displayed.

The content-section div has width and height set to 0 pixels.



However if we select a different order (using the dropdown on the top), the screen is reloaded and displayed correctly as required (with height and width set to appropriate pixel values).

Now I am not looking for the exact answer to this issue (if somebody can give this, nothing like it) but I am trying to understand if you faced this issue, what would be the next step to follow. How can we identify the root cause behind the height and width getting set to 0 px the first time the screen is
 
Marshal
Posts: 25965
70
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That wouldn't be my question. My question would be "Why aren't the height and width values being set to the numbers I wanted them to be set to?"
 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Paul Clapham wrote:That wouldn't be my question. My question would be "Why aren't the height and width values being set to the numbers I wanted them to be set to?"


This is a difficult question to answer since you're providing a limited amount of your coding, provide more information so that people can understand how you're trying to build your app and how you can fix the problem.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic