CSS and HTML made easy: How come my page is displaying unpredictable outcomes?

Something seems off with this page when it loads. It only displays correctly after resizing the browser window. Random combinations appear before the resize, which is quite strange.

Can anyone identify what's causing this issue?

Here's the JS fiddle link for reference: http://jsfiddle.net/grDvW/1/

The images aren't loading properly, and even the placeholders don't appear until resizing the output window in the JS fiddle. At least the problem is consistent.

Here's the HTML code:

<!DOCTYPE html>
<html>
<head>
    <link rel="stylesheet" type="text/css" href="style/style.css"><title>GameMode | Minecraft</title>
    <meta name="keywords" content="keyword">
    <meta name="description" content="description">
    <meta name="author" content="Jonathan Todd">
</head>
<body>
    <div class="wrap"><!-- begin wrap :: this will keep all of the stuff neat and in one place -->
    <div class="login-screen bg-dirt"><!-- begin login screen, background dirt :: sets up a background for the login and styles it with a dirt tile and holds all login elements -->
    </div><!-- end login screen, background dirt -->
    <div class="welcome-screen"><!-- begin welcome screen :: this will hold the elements within the welcome screen, mainly just a title and the two moving wall pieces -->
       <div class="wall-left"><!-- begin wall left :: must I explain this? It opens and closes with the other wall -->
          <img src="images/wall_left.png">
       </div><!-- end wall left -->
       <div class="wall-right"><!-- begin wall-right :: must I explain this? It opens and closes with the other wall -->
          <img src="images/wall_right.png">
       </div><!-- end wall right -->
       <img class="welcome-logo" src="images/logo.png">
       <img class="welcome-shadows" src="images/shadows_fast.png">
   </div><!-- end welcome screen -->
</div><!-- end wrap -->
</body>
</html>

And here's the simple CSS code:

/* Style Setup */

    body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td {
    margin: 0;
    padding: 0;
    -webkit-perspective: 6500;
}
table {
    border-collapse: collapse;
    border-spacing: 0;
}
fieldset, img {
    border: 0;
}
address, caption, cite, code, dfn, th, var {
    font-style: normal;
    font-weight: normal;
}
caption, th {
    text-align: left;
}
h1, h2, h3, h4, h5, h6 {
    font-size: 100%;
    font-weight: normal;
}
q:before, q:after {
    content: '';
}
abbr, acronym {
    border: 0;
}   
.wrap, html {
    width: 100%;
    margin: 0px;
    padding: 0px;
    height: 100%;
    overflow: hidden;
}
/* Style Start */
.bg-dirt { }
.login-screen {
    z-index: 0;
}   
.welcome-screen {
    z-index: 1;
    width: 100%;
    height: 100%;
}
.wall-left {
    position: absolute;
    z-index: 2;
    height: 100%;
    left: 0px;
}
.wall-right {
    position: absolute;
    z-index: 3;
    height: 100%;
    right: 0px; 
}
.welcome-logo {
    position: absolute;
    z-index: 4;
    margin-left: auto;
    margin-right: auto;
}
.welcome-shadows {
    position: absolute;
    z-index: 5;
    width: 100%;
}

Answer №1

Would you mind deleting the following code?

body,section,table,date,time,list-item,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,output,p,quote,td{
  margin:0;
  padding:0;
  /*-webkit-perspective:6500;*/
}

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

What is causing this code to keep iterating endlessly?

I have a basic jquery script embedded in my HTML code that utilizes the cycle plugin for jQuery. The problem I'm facing is that when I interact with the slideshow using the "next" or "previous" buttons, it continues to loop automatically after that in ...

Retrieving PNG image from dynamically created PDF file with DomPDF

Having trouble displaying an image on a generated PDF using DOMPDF. My DomPDF version is v2.0.3 and I'm working with XAMPP on localhost. This is the output: see image here Below is the code snippet: <?php require_once __DIR__ . '/vendor/auto ...

Switch from using a select tag to a check box to easily switch between a dark and light theme

I have implemented a feature on my website that allows users to toggle between dark and light themes using the select tag with jQuery. Here is the code snippet that I am currently using: $(function() { // Code for changing stylesheets based on select ...

Implementing text formatting for user comments within my NodeJS application

Is there a way to incorporate an interactive text formatting feature into the comment form on my nodejs app? After searching for options online, I couldn't find exactly what I was looking for. Can anyone point me in the right direction? I'm refe ...

The text alignment in Internet Explorer is off

After testing this website on both Firefox and Chrome, the alignment in the "Releases" section appears to be correct: However, when viewed in Internet Explorer, some of the text seems to be aligned in the center for unknown reasons. I have been struggling ...

When I set the width of my script to 100% in CSS, it causes the width to become distorted

I encountered an issue with my Div Slider that swaps out Divs on click. When I modified the CSS to include the following: .hslide-item {width: 100%}; The script started ignoring the entire div width. I am looking for a solution where the .hslide-item ca ...

Assistance with Ajax for content loading

Greetings, I am encountering an issue with the following code snippet (located in a js file named ajax.js) $(function(){ $("#loading").hide(); $("ul#nav a").click(function(){ page = "content/"+$(this).attr('href') ...

Transitioning from Bootstrap 3 to Bootstrap 4: Addressing File Upload Button and Input Size Concerns

I've been working with the code snippet below for some time now. However, when I attempt to transfer the same code to Bootstrap 4, I'm facing an issue where the button size and input box size are not aligning correctly. Original Bootstrap 3 File ...

What is the best way to stack columns on small screens in a single row?

While utilizing the default bootstrap col classes, I noticed that when I reduce the grid to mobile size, the columns span the entire width of the row. This results in a long vertical list of items on mobile devices, even though there is sufficient space on ...

The onClick function for the "div" element is failing to append

I am currently working on a project that involves searching for strings in a database and then appending the selected string to a text box. So far, I have been successful in retrieving the search results from the database and appending them below the text ...

CSS problem: HTML element moving to the right upon clicking

Currently, I am utilizing a jQuery popup to present additional information to users. The setup involves having a link on the page that triggers the popup to appear from the top. The popup script being used is sourced from CodePen. However, an issue arises ...

Using srcset and picture together to optimize images for various screen sizes

At my workplace, we are in the process of devising a strategy to integrate responsive images into our custom framework. Our goal is to have one centralized solution that caters to all image use cases. After investigating, it appears that using srcset for ...

Reposition icons accordingly while incorporating a new set of icons

After creating a new icon set font, I noticed that the icons are not positioning correctly and appear smaller than expected when loaded: https://i.stack.imgur.com/1OsAL.png https://i.stack.imgur.com/zmLQq.png I attempted to adjust the .icon class by add ...

Update the display of the mouse pointer

I use CSS to set a custom cursor image: #scroll_up{ display: block; position: absolute; width: 960px; height: 300px; cursor: url(../imgs/cursor_up.png), auto; } The above style is assigned to a div element so that the cursor appea ...

Utilizing Selenium for automating button clicks

When attempting to click a button represented by the following HTML code: <a href="javascript:submitPage('V','All Notes','');" class="viewFilter">All Notes</a> I have made multiple attempts to ...

Displaying three tables in each row using ng-repeat, with the ability to repeat the process multiple times

Is it possible to repeat a table multiple times with each set of three tables in the same line using AngularJS and Bootstrap? I am unsure how this can be achieved with ng-repeat. table 1 | table 2 | table 3 table 4 | table 5 | ... <div ng-repeat="zo ...

The unusual actions displayed by the initial row of a grid container

In an effort to familiarize myself with front-end development, I took on the challenge of creating a simple calculator. Opting to utilize the grid-layout due to the static nature of the content and my desire for flexibility in button sizes both vertically ...

Transmitting messages from a cross-domain iframe to the parent window

In my parent component, I am embedding an iframe from a different domain. The iframe contains a button that when clicked, I need to capture the event and pass it back to the parent component. I have experimented with using window.postMessage and window.ad ...

Strong tags within MFC

Is it possible to create labels in MFC (Static text) that contain both bold and non-bold text? For instance, something like this: "I want my label to have a mix of styles like this" Any suggestions on how to achieve this? I am aware that I can change ...

Incorrect formatting of HTML email on Outlook

Here is the code snippet I am using for an HTML email: <div style="background-color:red;max-width:600px;height:140px;margin-left:auto;margin-right:auto;"> <img src="https://via.placeholder.com/140x99" height="140" wi ...