Experiencing problems with positioning and division

I've been struggling with adding a div wrapper around the title of a popup on my index page. I'm attempting to align it horizontally and add a margin-top, but my efforts aren't yielding the desired results. The div also fails to touch the start of the popup, resulting in an unwanted horizontal scrollbar.

Furthermore, the inputs within the same popup are refusing to center horizontally. Despite placing them inside a wrapper and setting a width along with margin: 10px auto, they remain misaligned.

If you'd like to see this issue firsthand, please visit my website at sundayfundayleague.com. Click the Sign In button to trigger the popup.

What am I missing here?

<div id="light" class="signInpopup">    <a class="close" href="javascript:void(0)">Close</a>

<div id="indexpopupTitleWrap">  <span id="indexpopupTitle">Sign In</span>

</div>
<form id="signInform" name="Sign In" action="" method="POST" autocomplete="on" accept-charset="utf-8">
    <div id="signInformWrap">
        <input type="text" name="username" id="signInInput" placeholder="Username" autocomplete="on" required>
        <br>
        <input type="password" name="password" id="signInPasswordInput" placeholder="Password" autocomplete="off" required>
        <br>
        <br>
        <br>
        <label for="remember">
            <input type="checkbox" name="remember" id="remember">Remember me</label>
        <input type="hidden" name="token" value="<?php echo Token::generate(); ?>">
        <label for="widebutton">
            <input id="widebutton" type="submit" value="Sign In">
        </label>
        <br>
        <br>
    </div>
</form>

CSS

.black_overlay{


  display: none;
    position: absolute;
    top: 0%;
    left: 0%;
    width: 100%;
    height: 100%;
    background-color: black;
    z-index:1001;
    -moz-opacity: 0.8;
    opacity:.80;
    filter: alpha(opacity=80);
}
.lighter_black_overlay{
    display: none;
    position: absolute;
    top: 0%;
    left: 0%;
    width: 100%;
    height: 100%;
    background-color: black;
    z-index:1001;
    -moz-opacity: 0.6;
    opacity:.60;
    filter: alpha(opacity=60);
}
.white_content {
    display: none;
    position: fixed;
    top: 27.5%;
    left: 27.5%;
    width: 45%;
    padding: 6px;
    background-color: white;
    z-index:1002;
    overflow: auto;
}
.close {
    float: right;
    margin-right: 2px;
    color: #909090;
    text-decoration: none;
}
.close:hover{
    color: #686868;
    text-decoration: underline;
}
#indexpopupTitleWrap {
    width: 100%;
    height: 100px;
    background-color: #282828;
}
#indexpopupTitle {
    font-size: 2.5em;
    text-align: center;
    margin-top: 25px auto;
    padding: 10px;
    color: #800000;
}
#signInformWrap {
    width: 800px;
    height: 300px;
}
#signInInput[type=text] {
    width: 400px;
    margin: 10px auto;
    font-size: 18px;
    padding: 10px;
}
#signInPasswordInput[type=password] {
    width: 400px;
    margin: 10px auto;
    font-size: 18px;
    padding: 10px;
}
.signInpopup {
    width: 100%;
    padding: 5px 0;
    border-radius: 10px;
    border: 3px solid #4D4D4D;
    background-color: #FFFFFF;
    margin: auto;
    display: none;
    position: fixed;
    top: 27.5%;
    left: 27.5%;
    width: 45%;
    height: 45%;
    padding: 6px;
    z-index:1002;
    overflow: auto;
}

Answer №1

The display property of your input elements is currently set to inline-block;. To center them, you can change it to block. Alternatively, you could try the following approach:

#signinformwrap { width: 400px; margin: 0 auto; }

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

How come my div doesn't stick together with the other div while moving?

I am trying to figure out how to make the blue "shield" div cover the red "button" div after 3 clicks successfully. It seems like no matter what I do, the positioning is always off. I've played around with the randomplace variable, but nothing seems t ...

Arrangement with mutual prime numbers and rowspan

I have a set of unique data points (A, B1, B2, C1, C2 and C3) that I want to organize into a table layout as shown below: +----+----+----+ | | B1 | C1 | | +----+ | | A | B2 +----| | +----+ C2 | | | B3 | | +----+----+----+ After trying ...

The height and width of a tag enclosed within div elements are effectively set to 0

For an example, please visit https://jsfiddle.net/x7znc405/1/ If the HTML structure is as follows: <div id="wrapper"> <a> <div id="content"> Hello World </div> </a> </div> Here's the CSS styling: #content ...

Sticky navigation bar anchored to the top of the webpage using CSS and HTML

Currently, I am in the process of learning CSS3 and HTML5 but I'm facing some confusion. My goal right now is to create a webpage with a fixed navigation bar at the top that scrolls along with the page. Although the navbar is fixed at the top and doe ...

How to customize the style of a td element in an HTML table

Attempting to modify the style of a td element: .valuator .sw-slots table, tr, td { width 100% } Even after trying to override with this code: td.license-name-td{ width: 100px !important; } The global style always takes precedence over my specific s ...

Clicking outside the box will close it

I received a code from the internet that allows me to click on text and open a box. However, I am looking to add functionality to close the box when I click outside of it. Here is the javascript code I am using: function setVisibility(id, visibility) { ...

What is the best way to delete stored angularjs files permanently?

My web application, built on AngularJS, has certain functionalities that I have hidden from users. While the controls have been successfully hidden in the updated version of the file, there are still some users with the old file who can access these undesi ...

Tips for displaying HTML elements beyond the boundaries of an iframe

Similar Inquiry: How can content from an IFRAME overflow onto the parent frame? I am in search of a potential solution for the following issue: There is a specific element with the style "position: absolute" within a page loaded into an iframe. Based ...

Expanding with additional content using a div when the "read more" button is clicked, and including a close link to easily dismiss the expanded section

I am in need of assistance with my website, specifically regarding the functionality to expand and collapse div tags when a user clicks on "read more" or "close". As I am not familiar with jQuery, I would appreciate any JavaScript or CSS code that can achi ...

Is there a way to use selenium to extract data from a webpage if the table is not formatted with the standard HTML 'table' tag?

I am currently attempting to extract the data from the tables that appear when selecting "Branches", a city, and a district from this specific website: Progress has been made in writing the code to navigate through each city and district: from selenium.we ...

Challenges encountered on Chrome browser when using label:hover along with relative positioning

Currently, I am in the process of creating a price list for a section of a website I'm developing. To make it interactive, I am utilizing checkbox type inputs along with labels so that users can select the services they desire, and the webpage will au ...

What is the best way to showcase an image next to text on desktop, but have the image appear below the text on mobile devices?

Can anyone help me figure out how to display an image next to text on desktop and below it on mobile? I've been searching for solutions with no luck. Any assistance would be appreciated! This is my current code: Thanks in advance! I attempted usin ...

Is it true that Internet Explorer does not support border radius?

Styling with CSS border-bottom: 1px solid silver; background-color: #000; background: rgb(51,51,51); /* Old browsers */ background: -moz-linear-gradient(top, rgba(51,51,51,1) 0%, rgba(153,153,153,1) 100%); /* FF3.6+ */ background: -webkit-gradient(linear, ...

Materialize CSS is throwing an error: 'velocity is not a function'

Encountering an issue with Materialize CSS. A JavaScript error appears 'I('.velocity is not a function', for certain actions. For instance, clicking the collapse icon on the sidenav results in e.velocity is not a function error. Similarly, u ...

"Utilizing the flex box feature in IE 10 for efficient text trunc

.container { background: tomato; width: 100px; display: flex; } .text-left { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .text-right { } <div class=container> <div class="text-left"> title title title ...

Is There a Workaround for XMLHttpRequest Cannot Load When Using jQuery .load() with Relative Path?

My current project is stored locally, with a specific directory structure that I've simplified for clarity. What I'm aiming to do is include an external HTML file as the contents of a <header> element in my index.html file without manually ...

Submitting a form into a database with the help of AJAX within a looping structure

Trying to input values into the database using AJAX. The rows are generated in a loop from the database, with each row containing a button column. Clicking on the button submits the values to the database successfully. The issue is that it only inserts va ...

The images in Bootstrap 5 are displayed individually on separate lines, even though they could easily be accommodated within a

I'm facing an issue with displaying several 50x50 images in a row of 6 columns on my website. Despite the simple code setup, each image appears on its own row, creating the illusion of stacked images rather than a single row. This is the code structu ...

The function $(this).addClass() seems to be malfunctioning

While trying to follow a tutorial, I noticed that the style sheet isn't being applied to the clicked element in the list. What could be causing this issue? In the example provided, when a string is added to the text box and the button is clicked, a n ...

Lint error: Unrecognized attribute 'text-fill-color' in CSS (unknown properties)

My navigation bar isn't functioning, and I can't figure out why. It seems like it might be related to this snippet of code: -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; text-fill-color: trans ...