Blank areas on a document

I've recently started learning HTML and CSS, and I've encountered a problem that has me stuck.

HTML:

<div class = "window">
      <form>
        <input class="button" type="submit" value="Login" />
      </form>
    </div>
    

CSS:

@font-face {
        font-family: caviarDreams;
        src: url(./CaviarDreams.ttf);
    }
    html * {
        font-family:caviarDreams; 
        cursor:  url(./cursor.png), auto;
        background: url(./background.png) no-repeat center center fixed; 
        -webkit-background-size: cover;
        -moz-background-size: cover;
        background-size: cover;
    }
    .button {
        border: none;
        text-indent:0;
        display:inline-block;
        line-height:39px;
        font-size: 15px; 
        background:url(./buttonNormal.png) no-repeat; 
        width:230px;
        height:71px;
    }
    .button:active { 
        background:url(./buttonActive.png) no-repeat; 
    }
    .button:hover { 
        background:url(./buttonHover.png) no-repeat;
    }
    .window {
        background: url('./window.png') no-repeat;
        background-size: 624px 696px;
        width:624px;
        height:696px;
    }
    

Below is the code snippet. You can view a demo on this link. Interestingly, there seems to be no issue with it on the fiddle.

html * {
          background: url(./background.png) no-repeat center center fixed;
          -webkit-background-size: cover;
          -moz-background-size: cover;
          background-size: cover;
      }
      .button {
          border: none;
          text-indent: 0;
          display: inline-block;
          line-height: 39px;
          font-size: 15px;
          background: url(http://i.imgur.com/ZD9nn7F.png) no-repeat;
          width: 230px;
          height: 71px;
      }
      .button:active {
          background: url(http://i.imgur.com/K5mD1ga.png) no-repeat;
      }
      .button:hover {
          background: url(http://i.imgur.com/Yh2wITG.png) no-repeat;
      }
      .window {
          background: url('http://i.imgur.com/0ZQwEeS.png') no-repeat;
          background-size: 624px 696px;
          width: 624px;
          height: 696px;
      }

      <div class="window">
        <br/>
        <br/>
        <br/>
        <br/>
        <form>
          <input class="button" type="submit" value="Login" />
        </form>

      </div>

How it currently looks:

How it should look:

When I remove the <form> tags, the unwanted white space disappears. Any suggestions on how to fix this?

Answer №1

After eliminating the * from html * { .. }, everything is working perfectly now, I can't believe how simple the solution was!

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

Submitting information via jQuery

https://i.stack.imgur.com/VU5LT.jpg Currently, I am working on integrating an event planner into my HTML form. However, I am facing difficulty in transferring the data ("meetup", "startEvent", "break") from HTML to my database. Using jQuery, I was able to ...

Utilize Python to extract a table from an HTML document

I would like to retrieve a table from an HTML file. Below is the code-snippet I have written in order to extract the first table: import urllib2 import os import time import traceback from bs4 import BeautifulSoup #find('table',{'class&ap ...

Tips for avoiding accidentally selecting nearby text while holding down a button on your mobile device

My application requires the user to press and hold a button to record audio. However, on mobile devices, when the user holds the button, the browser attempts to select nearby text due to finger pressure. While this behavior is understandable, I want to pre ...

If tall, then the height is set to 100%; if wide, then the width is set

My image-generating algorithm produces images of various sizes, some tall and some wide. How can I ensure that the images always fit perfectly within their parent container? They should be 100% height if they are tall and 100% width if they are wide. .im ...

Utilizing AngularJS, implement ng-form and ng-repeat to seamlessly handle input validation and submission actions

Angular 1.6.2 I am experimenting with iterating over elements of a collection inputted by the user, checking their validity, and enabling the submit action if validation passes. I have tried using ng-form for this purpose and have come up with two differ ...

Retrieve the chosen item to automatically fill in the input fields using Ionic 2 and Angular

My goal is to create a dropdown menu populated with a list of items, and when a product is selected, its price should automatically appear in the quantity field. <ion-item> <ion-label>Item</ion-label> <ion-select (ionChange)="getP ...

Is there a way to access other HTML pages in a separate folder from the index file when running npm start?

At the moment, I have a simple index.html file and would like to access the app.html file located in a subfolder from the index.html. You can see the folder structure here: https://i.sstatic.net/IGcOk.png My app.html file is inside the 'app' sub ...

Hide the #loading element when the <input> field is devoid of content

Sample - jsfiddle.net/75CqW/ Upon clicking the Submit button, the loading div is displayed even when the input field is empty. I attempted to add "required" to the input field to prevent the loading div from showing when it's empty, but it's st ...

What could be the reason for the onClick event functioning only once in HTML?

Below is the code snippet containing both HTML and JavaScript. However, the issue I am facing is that the onclick event only seems to work for the first <li>. <!DOCTYPE html> <html> <body> <ul class="list"> <li ...

Modifying the default hover color of a specific row in AgGridReact

How can I eliminate the row color changing behavior in AgGrid tables when a row is selected and hovered over using React? Currently, a default dark gray color is applied when I hover over certain elements of a selected row, which is not desired in my imple ...

Why Isn't This JPG Image Functioning Properly in HTML/CSS?

I am facing an issue with a JPG image that I am attempting to use in CSS as a background-image for a div container. For some reason, this particular image refuses to render in the viewport. Interestingly, when I inspect the element, I can see its thumbnail ...

Extract from Document File

After receiving a PDF through an Angular Http request from an external API with Content Type: application/pdf, I need to convert it into a Blob object. However, the conventional methods like let blobFile = new Blob(result) or let blobFile = new Blob([resul ...

JavaScript - Dynamically loaded CSS: CSS variables are not immediately accessible to JavaScript, but are successfully evaluated within the CSS itself

I am encountering an issue with dynamically loading stylesheets via JavaScript into my application. Within these stylesheets, I have various CSS variables that I need to access and modify from my JavaScript code. When the stylesheets are directly embedded ...

What is a way to include a ":hover" effect in Elm without relying on signals?

I'm looking to apply a :hover style to an element using Elm's HTML library. I've considered using Signals and Sets to manage selected nodes, but it feels like overkill for such a simple task. Another option is adding an external stylesheet, ...

Step-by-step tutorial for making a mesmerizing fade out grunge background

How can I achieve a fading grid background effect? I have experimented with using a conic-gradient for the background, but I am unsure how to make it fade out. background: conic-gradient(from 90deg at 1px 1px,#0000 90deg,grey 0) 0 0/50px 50px; ...

Lock the initial column in an HTML table

Hey there! I've been trying to freeze the first column of my HTML table, and while I managed to do so after a few attempts, I encountered an issue. When I scroll the table horizontally, the columns on the left seem to overlap with the first column, an ...

Tips for adding a button to the SB Admin 2 Card header without altering its height

I am currently utilizing the SB Admin 2 template for my project and encountering difficulty when trying to add a button in the card header without altering the default height. The goal is to maintain a consistent look across both cards, as illustrated in t ...

Image encoded in base64 not appearing on the screen

Hey there, I'm currently working on implementing a jQuery image uploader that generates a base64 code when an image is selected. function readImage(input) { if (input.files && input.files[0]) { var FR= new FileReader(); FR.onload ...

Guide to Including Captions and Spans in a Table

In the given HTML code, nested tables are used by the developer which cannot be changed. However, there is a requirement to replace the table class and add a caption and span only to the main table. <table class="two_column_layout" align="center"> & ...

Is there a way to override the padding of a container?

Working with Wordpress for the first time has been quite a challenge. Adjusting to everything is causing me some major headaches. So, I've got this container div and added a lazy 10px padding. However, for the theme I'm attempting to develop, I ...