Forming a header area by utilizing a 960 Grid container

I'm in the process of designing a website utilizing the 960 Grid system.

The header consists of three parts: the logo, the navigation, and the login form.

I've implemented media queries to center both the logo and the login section when the page width drops below 1614 pixels. However, I'm encountering an issue where the logo centers properly but the div containing the login form does not align as expected.

Here is a screenshot with highlighted areas around the affected divs for better visualization.

View the Webpage Scenario

Here's an attempted fiddle:

Access Fiddle Link

I'm uncertain about the root cause of this problem.

HTML

<div id="header">
    <div id="logoHolder">
        <a href="index.html">
            <img src="images/Pinnacle_ira logo_web.png" alt="Pinnacle IRA" width="125" height="84"/>
        </a>
    </div>
    <div id="loginHolder">
        <form action="https://www.theiracenter.com/customerLoginAction.gsx" method="post" >
            <label for="username">Username:</label>
            <input class="topLogin" type="text" name="login" />
            <br />
            <label for="password">Password:</label>
            <input class="topLogin" id="passwordText" type="password" name="password" />
            <input type="hidden" name="pd" value="C05" />
            <br />
            <input type="submit" />
        </form>
    </div>
    <br />
    <div class="container_12">
        <div class="grid_12">
            <div id="navigationHolder">
                <ul id="navigation">
                    <li><a href="guidedChoice.html">GuidedChoice</a></li>
                    <li><a href="pricing.html">Pricing</a></li>
                    <li><a href="faq.html">FAQs</a></li>
                    <li><a href="investment.html">Investment Tools</a></li>
                    <li><a href="contact.html">Contact Us</a></li>
                </ul>
            </div>
        </div>
        <div class="clear"></div>
    </div>
</div>

CSS

/*Header*/
#logoHolder{
    float:left;
}
    #logoHolder img{
        margin:5px;
        margin-top:20px;
        vertical-align:bottom;
    }

    @media (min-width:0px) and (max-width:1614px){
        #logoHolder{
            width:125px;
            float:none;
            display:block;
            margin-left:auto;
            margin-right:auto;
        }
    }


#loginHolder{
    float:right;
}

    @media (min-width:0px) and (max-width:1614px){
        #loginHolder{
            display:block;
            margin-left:auto;
            margin-right:auto;
        }
    }

label{
    font-family:Arial;
}

.topLogin{
    width:175px !important;
    height:20px !important;
}
    #passwordText{
        margin-left:22px;
    }

#navigationHolder{
    display:block;
    margin-left:auto;
    margin-right:auto;
    width:775px;
    background-color:brown;
    height:auto;
}

/*Navigation*/
#navigation{
    list-style:none;
    font-family:Arial;
    font-size:1.3em;
}

    #navigation li{
        float:left;
        display:block;
        color:#888888;
        margin-top:20px;
    }

    #navigation li:hover{
        color:white;
    }

    #navigation li a{
        color:inherit;
        text-decoration:none;
        display:block;
        text-align:center;

        padding:1.25em;
        padding-bottom:3.5em;
    }

    #navigation li a:hover{
        background:#609941;
        text-decoration:underline;
    }

Answer №1

Do you have a specific reason for having two decelerations?

@media (min-width:0px) and (max-width:1614px){

Regardless, just include float:none in the #loginHolder selector to solve the issue. -Remember to place this in your second deceleration at the same breakpoint.

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

Display a div every 3 seconds with the help of jQuery

I am seeking a solution to display the second div (box2) every 3 seconds. Can anyone help me achieve this using jQuery? <div id="box1" style="background-color:#0000FF"> <h3>This is a heading in a div element</h3> <p>This ...

Issue with Bootstrap flash alert CSS on mobile devices is not functioning properly

I am in the process of developing a Rails application. Within my app, I utilize Bootstrap's CSS for displaying flash messages on alerts. Instead of fully incorporating Bootstrap's CSS, I only integrate styles related to alerts in order to prevent ...

Utilize PHP's foreach loop to showcase information within multiple HTML div containers

I am presented with the following data and would like to showcase it in separate containers using HTML. Name Price Difference Signal CA.PA 15.85 3.5609257364073 MACD AZN.ST 896 3.4881049471963 MACD AMGN 258.57 1.6391533819031 SMA 50/ ...

Tips on using htmlspecialchars in combination with a href:To safely include links in

If I have the following code: $text = "please visit this <a href='http://example.com'>site</a>." $text = htmlspecialchars($text); echo $text; The output will be please visit this <a href='http://example.com'>site< ...

The level of transparency linked with text in a blockquote

I've spent hours on this and I'm completely lost. Even though I believe my code is correct, it keeps telling me it's wrong. I don't know where to go from here. The task requires adding a style rule for the blockquote element that chan ...

What is the best way to toggle DOM classes in React using Material-UI components?

Currently utilizing Material UI alongside React, I have a div element: <div className={classes.div}></div> I am attempting to dynamically add a conditional class to it: <div className={classes.div + divActive ? `${classes.div}__active` : &a ...

What could be the reason for the empty space between the upper and middle cuts?

I am working on these two web pages: http://slacklog.heroku.com/ http://slacklog.heroku.com/signup/date As you can see, there is a gap between the top and middle images as well as the bottom and middle images on both pages. Below is my HTML code: <d ...

Leveraging weather application programming interfaces

I am trying to set up a basic webpage that can display tide information from wunderground.com. However, for some reason I am not seeing any results on the page. I have included the load function in hopes of at least getting something to appear when the p ...

What is the best way to retain the background image in a fixed position?

Is there a way to fix the size of the picture in my code? The current size is 5834*3886, but when I minimize the browser, part of it disappears. Here is the CSS code I have written: .contact{ position: relative; min-height: 100vh; padding: 50 ...

When I hover over div 1, I am attempting to conceal it and reveal div 2 in its place

I need help with a CSS issue involving hiding one div on mouse hover and showing another instead. I attempted to achieve this using pure CSS, but both divs end up hidden. Would jQuery be necessary for this task? Below is the CSS/HTML code I wrote: .r ...

Error in CSS styling affecting image display on responsive website

My CSS seems to have a bug when it comes to responsive pages with images. Take a look at the demo: https://jsfiddle.net/xr4getom/ If you resize the window on this example, you'll notice that a dark background (#222) appears intermittently. Is there ...

Combining various array values into a single key in JSON格式

Issue: I am working on a sign-up form for new users using HTML. The goal is to store multiple arrays (each containing "username: username, password: password, topScore: 0) within one JSON key ("user" key). However, the current functionality only allows f ...

PHP not receiving POST information from $.ajax call

My JavaScript triggers a POST method when the datepicker loses focus, calling the script rent-fetch-pick-up-point.php. However, the PHP script gets stuck at the if-statement because it's not receiving the POST data. The datepicker is associated with a ...

How can I dynamically adjust the stroke length of an SVG circle using code?

In my design project, I utilized Inkscape to create a circle. With the fill turned off, only the stroke was visible. The starting point was set at 45 degrees and the ending point at 315 degrees. After rotating it 90 degrees, here is the final outcome. < ...

Tips for showcasing additional choices within a SELECT element while incorporating floating labels and adjusting the size

I'm struggling to make a floating label work smoothly with an HTML select that has a size="5" attribute using Bootstrap 5.3.x. It seems like it's not possible without some hacks or missing information from the Bootstrap documentation. According ...

css top navigation does not appear at the top of the webpage

My navigation bar appears to have an unexpected 5px padding issue that is causing it not to align properly at the top. To investigate, I have created a basic header.html + header.css setup as follows: <link href="css/header.css" rel="stylesheet"> &l ...

Is it possible to equalize the size of these list elements?

I'm new to working with HTML and CSS. My goal is to have navigation buttons that are all the same size, occupying one third of the width of the panel they are placed in. I have access to the original code but can only make adjustments rather than comp ...

Tips on customizing the CSS responsiveness of your Bootstrap carousel

I have recently installed a Bootstrap theme on my Wordpress site and I am trying to make some CSS adjustments. One issue I am facing is with the carousel. Currently, when I resize the website or view it on a mobile device... The carousel maintains a lar ...

Tips for maintaining focus on an editable div using jQuery

Is there a way to prevent an editable div from becoming unfocused when clicking on a formatting bar created using jQuery? I've been trying to implement this feature but can't seem to figure it out. Any advice would be greatly appreciated. Many th ...

Setting the height of a webpage element to match the height of the window through CSS

How can I make the .Bck div stretch to the full height of the browser window? I attempted using jQuery, but the height doesn't adjust correctly when I resize the window. What is wrong with my JavaScript and can this be achieved with CSS alone? <!- ...