Safari: Height of 100% not functioning as expected

Currently, I have a div with the class of "signup-login-forms" that is set to have a height of 40vh and span 100% of the browser width. Inside this div are two forms positioned next to each other. The goal is to have both forms fill the entire height of the "signup-login-forms" div. This layout functions as expected in FireFox and Chrome, however, Safari (specifically version 7.0.6) doesn't display the forms at full height; instead, they only expand to fit their content. I've attempted several solutions including setting min-height to 100%, changing height to auto, and removing box-sizing:border-box without success. Included below is my source code for reference. Any assistance would be greatly appreciated!

I've experimented with the following: 1. Changing to min-height: 100% 2. Setting height: auto 3. Removing box-sizing: border-box

Here's the HTML structure:

<div id="signup-login-forms">
            <form id="signup-form" name="signup-form" method="POST" action="#">
                <header>
                    <h2>Create account</h2>
                </header>
                <fieldset>  
                    <input type="email" id="userEmail" name="userEmail" required="required" placeholder="email">
                    <input type="email" id="confirmUserEmail" name="confirmUserEmail" required="required" placeholder="confirm email">
                    <input type="password" id="confirmPassword" name="confirmPassword" required="required" placeholder="create password">
                    <small>
                        <p>By signing up, you agree to our <a href="---">terms and conditions</a>.</p>
                    </small>
                    <button class="form-button" id="signup-button" type="submit" formmethod="#" formaction="#">Sign up</button>
                </fieldset>
            </form>
            <form id="login-form" name="login-form" method="POST" action="#">
                <header>
                    <h2>Log-in</h2>
                </header>
                <fieldset>
                    <input type="email" id="userEmail" name="userEmail" required="required" placeholder="email">
                    <input type="password" id="password" name="password" required="required" placeholder="password">
                    <div id="checkbox">
                        <input type="checkbox" name="loginPreference" id="loginPreference"><label>Keep me logged in</label>
                    </div>
                    <button class="form-button" id="login-button" type="submit" formmethod="#" formaction="#">Log-in</button>
                </fieldset>
            </form>
        </div>

Corresponding CSS styles:

#signup-login-forms {
width: 100%;
height: 40vh;
background-color: #161618;
margin: 4em 0 0 0;
text-align: center;
}

#signup-login-forms form {
height: 100%;
width: 50%;
text-align: center;
}

#signup-form {
float: left;
border-right: 1px solid rgb(53, 53, 53);
box-sizing: border-box;
}

#login-form {
float: right;
box-sizing: border-box;
}

#signup-login-forms form header {
width: 100%;
padding: 5% 0 0 0;
text-align: center;
}

#signup-login-forms header h2 {
color: #e74c3c;
font-weight: normal;
font-size: 2em;
display: inline;
}


#signup-login-forms fieldset {
width: 100%;
}

Answer №1

After modifying the CSS in the #signup-login-forms form from height:100%to height:inherit, the issue was successfully resolved. This adjustment now enables me to set the height of #signup-login-forms using viewport height (vh) units.

Answer №2

Experiment with adding the !important declaration to that property, or consider using inline styles instead.

Alternatively, you could increase the specificity of your CSS rules. While it's generally not recommended to style elements using IDs in CSS, it might be worth a shot in this case.

Answer №3

In Safari, the vh unit does not function properly. Consider using % or px instead for optimal results.

Answer №4

Take a look at the following content, you must specify the necessary height for Div Tag in percentage

#signup-login-forms { width: 100%; height: 100%; background-color: #161618; margin: 4em 0 0 0; text-align: center; }

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

Remove newline character from HTML code using Python 3.2 and urllib module

After fetching HTML content as a string using urllib, I encountered difficulty in searching the string due to its HTML format. Is there any way to "unformat" the string by removing all the new lines without altering the HTML code itself? Here is the Pytho ...

Page for Calling with jQuery Mobile

How can I navigate to the administrator page while also refreshing the page? The concept is: If the user logs in successfully, the page will automatically redirect to the administrator page using HTML5 storage for data. For example: sessionStorage.setIte ...

JavaScript button mouse enter

There seems to be an issue with this code. The button is not functioning properly after hovering over it, even though it was copied from the instructional website where it works fine. <html> <head> <title>Button Magic</t ...

How can I target all ul elements except those contained within a div with a specific class using CSS?

In my global.scss file, I have defined global styles for ul elements as shown below: ul { list-style: none; margin: 0; padding: 0; } However, I am trying to find a way to style all ul elements except those within a specific jodit-wrapper class ...

Press the div, excluding the button - Vue

I have a basic div that spans 100% of the width, containing a button inside. The issue I'm facing is that when I add a click event to the div, the entire div becomes clickable (including the button within it). What I want is for the whole div to be ...

Discover a new method for mastering jQuery Draggable: an advanced technique

Click here for the interactive demo. I'm trying to create a draggable effect for the cover element within the pic-area, but I only want it to be draggable until it completely fills the space without any white gaps. Please have a look at the example b ...

CSS: Achieving Full Container Width Text with Respect to Another Container's Height

Hello, I am facing a very specific issue that I can't seem to resolve: I have two containers (ion-card) and I want them to always be the same height. I was able to achieve this by following the solution provided here: https://i.sstatic.net/he8O7.png ...

Having trouble getting the timer function to execute upon page load in JavaScript

My goal is to have my basic timer function activate when the page loads. However, I'm encountering issues with it not working as intended. I suspect there may be an error in the if else loop, possibly here: setTimeout(function(tag, sec), 1000);. How c ...

Top tip for handling repetitive code with echo commands

I've been struggling with a question for quite some time now. Imagine you have a code that consists of multiple nested divs and spans, forming a square with an image inside. echo '<div> <div> <div> <div> <span> < ...

Internet Explorer does not support the use of a:focus

Unfortunately, the issue with a:focus not working in IE is still unresolved. I have been searching for a solution, but have not been able to find one yet. <div class="city-selection"> <ul> ...

Issues with Pdf.js functionality on Internet Explorer

Could someone shed some light on why this code isn't functioning in Internet Explorer? It works perfectly fine in Chrome. Snippet of my HTML: <head> <script type='text/javascript' src="//code.jquery.com/jquery-1.9.1.js"></sc ...

Having Trouble Receiving Desired Results with Ajax and JSONP

Testing jsonp for a new project. The html page features ajax, displaying a drop-down form and an empty table. The table cells will be populated based on the jsonp response fetched by ajax. The php response is hosted separately but doesn't seem to wo ...

The z-index property fails to function properly when used with a relative parent and after/before pseudo-elements

Here is the code snippet (prototype) that I am working with: .headerz { position: relative; padding: 5rem 0 0 5rem; margin: 3rem 0 0 0; color: #000; font-size: 3.8rem; text-transform: uppercase; z-index: 24; } .headerz::before { content ...

Enhanced auto-zoom feature with orientation change for iOS 7

My web page was functioning perfectly until the release of iOS 7 by Apple today, causing the layout to break when the screen orientation is changed. When focusing on a text area and rotating the screen to landscape view, the entire page zooms in. However, ...

Map on leaflet not showing up

I followed the tutorial at http://leafletjs.com/examples/quick-start/ as instructed. After downloading the css and js files to my local directory, I expected to see a map but all I get is a gray background. Can anyone advise me on what might be missing? T ...

Why isn't the image showing up as a list style?

I can't seem to get the image to show up on my page. Can anyone help me figure out what's wrong? ul li { background-image: url(logo.png); background-repeat: no-repeat; padding-left: 0px; } This is what I'm currently seeing: This is what ...

Update the appearance of a cell if the value within it is equal to zero

I have discovered a way to achieve this using inputs. input[value="0"] { background-color:#F7ECEC; color:#f00;} Now, I am looking for assistance in applying the same concept to table cells. Can anyone provide guidance? Thank you. ...

Using JQuery to locate and substitute occurrences of HTML elements throughout my webpage

Looking for assistance with a JQuery search and replace task involving multiple instances of HTML within a specific DIV element on my webpage. Specifically, I need to change certain items in the textbox to a simpler display format. Here is a snippet of th ...

Building an HTML table dynamically with JavaScript

Can anyone help me figure out why my JavaScript code isn't populating the HTML body table as expected? var shepard = { name: "Commander", victories: 3, ties: 1, defeats: 6, points: 0 }; var lara = { name: "RaiderOfTombs", victories: ...

Change the type of field from a div to an input when clicked

I'm trying to achieve something unique with a div on my webpage. When the user clicks on it, I want the div to transform into an input field. Initially, the div looks like this: <div>This is the content.</div> But when clicked, I want i ...