Experiencing Problems with Firefox Height?

Check out my current project on Codepen - it's a clock: http://codepen.io/www139/pen/MaxGyW

Here's what it's supposed to look like: https://i.sstatic.net/tOMKh.png

If you're using FireFox, you might notice that it looks different compared to other browsers on OS X: https://i.sstatic.net/u94eJ.png

Can anyone suggest how to make it run smoothly in Firefox like the first example, and what might be causing this issue?

Below is the HTML, CSS, and JavaScript for the project:

html,
body {
  margin: 0;
  padding: 0;
}
#projectContainer {
  background-color: #eee;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}
#verticalAlign {
  -o-transform: translate(0%, -50%);
  -moz-transform: translate(0%, -50%);
  -webkit-transform: translate(0%, -50%);
  -ms-transform: translate(0%, -50%);
  transform: translate(0%, -50%);
  position: absolute;
  top: 50%;
  width: 100%;
}
#watchBelt {} #watchContainer {
  display: table;
  margin: auto;
  width: 50vh;
  height: 50vh;
  position: relative;
  border-radius: 50%;
  padding: 2vh;
  background-color: #AB9883;
}
#watchStructure {
  width: 100%;
  height: 100%;
}
#watchFace {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  /*background: -ms-linear-gradient(-35deg, #444, #eee);
  background: -moz-linear-gradient(-35deg, #444, #eee);
  background: -webkit-linear-gradient(-35deg, #444, #eee);
  background: -o-linear-gradient(-35deg, #444, #eee);
  background: linear-gradient(-35deg, #444, #999);
  position:relative;*/
  background-color: #0E1021;
  position: relative;
}
#watchHourHand {
  height: 40%;
  width: 5%;
  background-color: #eee;
  position: absolute;
  left: 47.5%;
  top: 10%;
  -o-transform-origin: bottom center;
  -moz-transform-origin: bottom center;
  -webkit-transform-origin: bottom center;
  -ms-transform-origin: bottom center;
  transform-origin: bottom center;
}
#watchMinuteHand {
  width: 3%;
  height: 50%;
  background-color: #eee;
  position: absolute;
  left: 48.5%;
  -o-transform-origin: bottom center;
  -moz-transform-origin: bottom center;
  -webkit-transform-origin: bottom center;
  -ms-transform-origin: bottom center;
  transform-origin: bottom center;
}
#watchSecondHand {
  width: 2%;
  height: 50%;
  background-color: #eee;
  position: absolute;
  left: 49%;
  -o-transform-origin: bottom center;
  -moz-transform-origin: bottom center;
  -webkit-transform-origin: bottom center;
  -ms-transform-origin: bottom center;
  transform-origin: bottom center;
}
* {
  -o-transition: all .5s ease;
  -moz-transition: all .5s ease;
  -webkit-transition: all .5s ease;
  -ms-transition: all .5s ease;
  transition: all .5s ease;
  -webkit-backface-visibility: hidden;
}
.noTransition {
  -o-transition: none !important;
  -moz-transition: none !important;
  -webkit-transition: none !important;
  -ms-transition: none !important;
  transition: none !important;
}
<div id="projectContainer">
  <div id="verticalAlign">
    <div id="watchContainer">
      <div id="watchBelt"></div>
      <div id="watchStructure">
        <div id="watchFace">
          <div id="markers"></div>
          <div id="watchHourHand"></div>
          <div id="watchMinuteHand"></div>
          <div id="watchSecondHand"></div>
        </div>
      </div>
    </div>
  </div>
</div>

Answer №1

The reason for this issue is that the child element of display:table is not configured to display:table-cell.

To resolve this, update your CSS by including display:table-cell in the #watchStructure selector.

#watchStructure{
  width:100%;
  height:100%;
  display:table-cell;
}

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

Analysis of printing functionality across Chrome, Safari, and Firefox browsers

When utilizing the print function of various browsers to save web content in a PDF file, I have observed that each browser behaves differently. This becomes an issue when the content spans multiple pages. For instance, Chrome prints correctly while Safari ...

How to extract a value from a span input textbox using Vue?

I just started using Vue and I'm attempting to create an auto-growing input. I've realized that it's not possible to create a real <input> element that adjusts its size based on its content and allows for value modifications using v-mo ...

The CSS class names for Next.js have not been defined yet

Just getting started with next js and trying to use css modules for styling my nav component. However, I noticed that the classname I setup for the nav element is not showing up in the rendered DOM. Even though I can see the generated styles by webpack in ...

How can PHP send a variety of error messages to an Ajax/Jquery script and display them in an HTML DIV?

In an attempt to send various error messages back to an HTML DIV based on the PHP outcome, I have scoured through different resources without a solution that fits my particular case. Hopefully, someone can provide assistance with this. The scenario involv ...

jQuery Refuses to Perform Animation

I'm facing an issue with animating a specific element using jQuery while scrolling down the page. My goal is to change the background color of the element from transparent to black, but so far, my attempts have been unsuccessful. Can someone please pr ...

JQuery cannot target content that is dynamically inserted through an Ajax request

When I use an ajax call to pass dynamically generated html, such as in the example below: var loadContent = function(){ $.ajax({ url: '/url', method: 'GET' }).success(function (html) { $('.con ...

How can I use a CSS file in PHP to conceal the folder structure?

main.css $theme->assign('css_file',SITE_URL.'styles.php?theme='.THEME_ID); $theme->display(TEMPLATES_PATH.'header.tpl'); header.tpl <link rel="stylesheet" href="{$css_file}"> styles.php include TEMPLATES_PATH. ...

Saving Information from an HTML Form Input?

I am currently working on a form that collects information about employees including their name, age, position, and details. When the "Add Record" button is pressed, this information should be added to a designated div. Although I have set up the Object C ...

Reducing image size using CSS can result in blurry images on multiple web browsers

Encountering challenges with downscaled images in multiple browsers... The images must be downscaled to adapt to the browser size. Here is the code snippet: #pic-holder img { -moz-transform: rotate(0deg); /*image-rendering:-webkit-optimize-contras ...

Center the table cell element horizontally

Struggling to align a table cell element both horizontally and vertically? Currently, only managing the vertical alignment. The images vary in size, calling for fluidity and compatibility with max-height and width... Custom Style Sheet (CSS) .prod-img { ...

In my Angular application, I have two div elements that I want to toggle between. When a button located in the first div is clicked, I need

I am working on a code snippet that requires me to hide div1 and display div2 when the button in div1 is clicked using Angular HTML5. Currently, I have two separate modal pop up template files and JS controllers for each of them. Instead of having two po ...

Ways to position Drop-down menu flush against the left edge of the webpage?

I am facing a challenge in customizing my CSS3 Mega drop-down menu. I want the mega menu to start from the left side of the main page, beginning from the home button area and extending all the way to the end. Currently, it is appearing where the parent men ...

Passing a value from a prop to a click event that is dynamically created within an SVG Vue.js

Currently, I am in the process of developing a map component using a JSON array and implementing a click event handler for each item. The objective is to toggle the CSS style to color the item when clicked, which is functioning as expected. However, my goa ...

Repositioning with Flexbox: shifting the middle element to a new line

I have a flex item that contains three divs. ┌────────────────────────────────────────┐ | WRAPPER | | ┌─────────┬─ ...

Setting up bootstrap for PHP: A step-by-step guide

Struggling with integrating PHP and Bootstrap? I recently attempted to do the same, but unfortunately, my website doesn't seem to recognize Bootstrap. Instead of the sleek Bootstrap design, it's displaying a simple HTML layout. Here's a snip ...

What is the best way for Selenium in C# to identify and locate a specific span element by its value

I've been experimenting with different locators, but I'm struggling to find a straightforward solution for identifying the dynamic number within this span using C# Selenium. Initially, my focus is just on locating the span itself. <span inven ...

Resize the tab header in primefaces to fit your needs

Is there a way to change the height of the tabView's header specifically in primefaces? Take for instance the tabs with headers like "God Father I", "God Father II" on this link, I only want to adjust the height of the header and not the entire tab. ...

Ensure all vertically stacked boxes maintain the same height using Flexbox technology

My design includes a series of links styled as larger boxes, with varying content and height. Using flexbox to ensure equal heights on each row is straightforward. I'm utilizing the Bootstrap grid layout, but when the boxes stack vertically (one per r ...

Utilize CSHTML Script to Show HTML Content When SQL Query Results in Null

I have a CSHTML Script that a friend has written, and I am currently making some changes to it. I have a SQL Query saved as a variable and if this query returns NULL, then I want to display different HTML compared to when it returns results. Below are the ...

What is the best way to pass an array to PHP and then display it in HTML?

After setting up a form with 3 select tags in my HTML, I attempted to create an array using jQuery and send it to PHP. The goal is to retrieve data from PHP and display it on my HTML page. Below is the code snippet: HTML code <form name="myform"> ...