Positioning my login form in the right spot is proving to be a challenge

I'm working on integrating this form into my website, but I'm having trouble placing it in the top right corner of the header.

Below is the HTML code:

 $(function(){
      var $form_inputs =   $('form input');
      var $rainbow_and_border = $('.rain, .border');
      /* Used to provide loping animations in fallback mode */
      $form_inputs.bind('focus', function(){
        $rainbow_and_border.addClass('end').removeClass('unfocus start');
      });
      $form_inputs.bind('blur', function(){
        $rainbow_and_border.addClass('unfocus start').removeClass('end');
      });
      $form_inputs.first().delay(800).queue(function() {
        $(this).focus();
      });
    });

</script>
    <style>

    </style>
</head>
<body id="home">
    <div class="rain">
        <div class="border start">
            <form>
                <label for="email">Email</label>
                <input name="email" type="text" placeholder="Email"/>
                <label for="pass">Password</label>
                <input name="pass" type="password"    placeholder="Password"/>
                                    <input type="submit" value="LOG IN"/>
            </form>
        </div>
    </div>

If it helps, here is all the CSS code for the form:

/* Login Form -------------------------------------------*/

        .border,
        .rain{
            height: 170px;
            width: 320px;
            float: right;
        }
        /* Layout with mask */
        .rain{
             padding: 10px 12px 12px 10px;
             -moz-box-shadow: 10px 10px 10px rgba(0,0,0,1) inset, -9px -9px 8px rgba(0,0,0,1) inset;
             -webkit-box-shadow: 8px 8px 8px rgba(0,0,0,1) inset, -9px -9px 8px rgba(0,0,0,1) inset;
             box-shadow: 8px 8px 8px rgba(0,0,0,1) inset, -9px -9px 8px rgba(0,0,0,1) inset;
             margin: 0 0 140px 0 auto;
        }
        /* Artifical "border" to clear border to bypass mask */
        .border{
            padding: 1px;
            -moz-border-radius: 5px;
            -webkit-border-radius: 5px;
            border-radius: 5px;
        }

        .border,
        .rain,
        .border.start,
        .rain.start{
            background-repeat: repeat-x, repeat-x, repeat-x, repeat-x;
            background-position: 0 0, 0 0, 0 0, 0 0;
            /* Blue-ish Green Fallback for Mozilla */
            background-image: -moz-linear-gradient(left, #09BA5E 0%, #00C7CE 15%, #3472CF 26%, #00C7CE 48%, #0CCF91 91%, #09BA5E 100%);
            /* Add "Highlight" Texture to the Animation */
            background-image: -webkit-gradient(linear, left top, right top, color-stop(1%,rgba(0,0,0,.3)), color-stop(23%,rgba(0,0,0,.1)), color-stop(40%,rgba(255,231,87,.1)), color-stop(61%,rgba(255,231,87,.2)), color-stop(70%,rgba(255,231,87,.1)), color-stop(80%,rgba(0,0,0,.1)), color-stop(100%,rgba(0,0,0,.25)));
            /* Starting Color */
            background-color: #39f;
            /* Just do something for IE-suck */
            filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00BA1B', endColorstr='#00BA1B',GradientType=1 );
        }

        /* Non-keyframe fallback animation */
        .border.end,
        .rain.end{
            -moz-transition-property: background-position;  
            -moz-transition-duration: 30s;
            -moz-transition-timing-function: linear;
            -webkit-transition-property: background-position;  
            -webkit-transition-duration: 30s;  
            -webkit-transition-timing-function: linear;
            -o-transition-property: background-position;  
            -o-transition-duration: 30s;  
            -o-transition-timing-function: linear;
            transition-property: background-position;  
            transition-duration: 30s;  
            transition-timing-function: linear;
            background-position: -5400px 0, -4600px 0, -3800px 0, -3000px 0;    
        }

        /* Keyfram-licious animation */
        @-webkit-keyframes colors {
            0% {background-color: #39f;}
            15% {background-color: #F246C9;}
            30% {background-color: #4453F2;}
            45% {background-color: #44F262;}
            60% {background-color: #F257D4;}
            75% {background-color: #EDF255;}
            90% {background-color: #F20006;}
            100% {background-color: #39f;}
        }
        .border,.rain{
            -webkit-animation-direction: normal;
            -webkit-animation-duration: 20s;
            -webkit-animation-iteration-count: infinite;
            -webkit-animation-name: colors;
            -webkit-animation-timing-function: ease;
        }

        /* In-Active State Style */
        .border.unfocus{
            background: #333 !important;    
             -moz-box-shadow: 0px 0px 15px rgba(255,255,255,.2);
             -webkit-box-shadow: 0px 0px 15px rgba(255,255,255,.2);
             box-shadow: 0px 0px 15px rgba(255,255,255,.2);
             -webkit-animation-name: none;
        }
        .rain.unfocus{
            background: #000 !important;    
            -webkit-animation-name: none;
        }

        /* Regular Form Styles */
        form{
            background: #212121;
            -moz-border-radius: 5px;
            -webkit-border-radius: 5px;
            border-radius: 5px;
            height: 100%;
            width: 100%;
            background: -moz-radial-gradient(50% 46% 90deg,circle closest-corner, #242424, #090909);
            background: -webkit-gradient(radial, 50% 50%, 0, 50% 50%, 150, from(#242424), to(#090909));
        }
        form label{
            display: block;
            padding: 5px 5px 5px 10px;
            font-size: 11px;
            color: #777;
        }
        form input{
            display: block;
            margin: 5px 5px 15px 10px;
            width: 85%;
            background: #111;
            -moz-box-shadow: 0px 0px 4px #000 inset;
            -webkit-box-shadow: 0px 0px 4px #000 inset;
            box-shadow: 0px 0px 4px #000 inset;
            outline: 1px solid #333;
            border: 1px solid #000;
            padding: 5px;
            color: #444;
            font-size: 16px;
        }
        form input:focus{
            outline: 1px solid #555;
            color: #FFF;
        }
        input[type="submit"]{
            color: #999;
            padding: 5px 5px;
            float: right;
            margin: 20px 0;
            border: 1px solid #000;
            font-weight: lighter;
            -moz-border-radius: 15px;
            -webkit-border-radius: 15px;
            border-radius: 15px;
            background: #45484d;
            background: -moz-linear-gradient(top, #222 0%, #111 100%);
            background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#222), color-stop(100%,#111));
            filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#22222', endColorstr='#11111',GradientType=0 );
            -moz-box-shadow: 0px 1px 1px #000, 0px 1px 0px rgba(255,255,255,.3) inset;
            -webkit-box-shadow: 0px 1px 1px #000, 0px 1px 0px rgba(255,255,255,.3) inset;
            box-shadow: 0px 1px 1px #000,0px 1px 0px rgba(255,255,255,.3) inset;
            text-shadow: 0 1px 1px #000;
        }

Answer №1

To achieve this effect, you can utilize absolute positioning:

.drop {
  position:absolute;
  right:0;
  top:0;
}

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

In order to format my text, I must locate a specific character and encompass the text following it with HTML tags

When working with a list generated in Jekyll, I came across the need to emphasize certain words using strong tags. My solution was to incorporate a delimiter into the process. <li>100g of |sugar</li> This would transform into: <li>100g ...

How can we assign various class names depending on the value of an object?

I have a set of objects stored in my component. I need to dynamically apply different classes based on the value of the ErrorLevel property within each object. If an object has ErrorLevel equal to 1, I want to assign the following classes to various elemen ...

The value within the style.setProperty function does not get applied

I have a progress bar that dynamically increases based on user input: <div class="progressBarContainer percentBar"> <div class="progressBarPercent" style="--width:${gPercent}" id="${gName}-pbar">< ...

Searching for text in a Python Selenium input field and retrieving suggested values can be achieved by using certain methods and commands

When you type a term like "apple" into the search bar on , a dropdown menu with search suggestions appears. I am attempting to retrieve a list, dictionary, or dataframe of the values in that dropdown box. For example: {'AAPL':['Apple Inc ...

Ways to implement the CSS on images with an ID such as img120 within a div that has a class of 'open'

<div class='cluster' id='12' 'style='width:350px;min-height:150px;border:4px solid #339966;'> <div class='image' style='width:150px;height:150px;border:2px solid black;float:left;margin-bottom: ...

Unusual Occurrence: Unexpected Gap at the Beginning of HTML

There seems to be an issue with white space appearing unexpectedly at the top and right side of the file in a website I am working on. Despite adding margin: 0; padding: 0; to both <body> and <html>, the problem persists. After inspecting the ...

I have expanded the CSSStyleDeclaration prototype, how do I access the 'parent' property?

I have developed some custom methods for CSSStyleDeclaration and implement them like this: A_OBJECT.style.method() ; The code structure is quite simple: CSSStyleDeclaration.prototype.method = function () { x = this.left; ..... etc } Here's my que ...

The image I want to show is invisible on the CSS custom radio button

I'm having trouble creating a custom radio button that displays the image I want. The current setup doesn't seem to be working as expected. label { font-weight: lighter; cursor:pointer; } input[type="radio"] { display:none; } in ...

Attempting to retrieve currentScript is causing a typeError to be thrown

I'm attempting to access a custom attribute that I added to my script tag: <script type="text/javascript" src="https://.../mysource.js" customdata="some_value"></script> To make this work on Internet Explorer ...

How can you apply a class to a different element by hovering over one element?

Is there a way to darken the rest of the page when a user hovers over the menu bar on my website? I've been playing around with jQuery but can't seem to get it right. Any suggestions? I'm looking to add a class '.darken' to #conte ...

Font size determined by both the width and height of the viewport

I'll be brief and direct, so hear me out: When using VW, the font-size changes based on the viewport width. With VH, the font-size adjusts according to the viewport height. Now, I have a question: Is there a way to scale my font-size based on ...

Is there a way to resolve the issue with Google reCAPTCHA still permitting my OpenCart registration even without being selected or properly validated?

When trying to register on OpenCart with Google reCaptcha, I encountered a peculiar issue. The first time I submitted the form without selecting the reCaptcha box, the registration did not go through and I was redirected back to the form with an error mess ...

Surrounding the text with background color

My H1 text is in a div that spans multiple lines due to the fixed width of the div. I am looking to set the background color to only appear behind the actual text of the H1, without extending into empty space at the end of each line. In addition, I also n ...

Customizing padding and margin in material-UI styles

Having issues with excessive padding and margin inside my tab component, even after trying to override it. I've followed some suggestions on StackOverflow but none seem to work. Here's how it looks: https://i.stack.imgur.com/Bgi3u.png Here is th ...

What is the reason the .clearfix class fails to properly clear a floated element?

Check out this post: Understanding clearfix The most helpful response indicates that the clearfix should be applied directly to the last floating element: To incorporate a clearfix, you simply need to include HTML code: <div class="clearfix"> ...

Why is Python BeautifulSoup's findAll function not returning all the elements in the web page

I am attempting to retrieve information from the following URL . Displayed below is the code I have developed. import requests from bs4 import BeautifulSoup url_str = 'https://99airdrops.com/page/1/' page = requests.get(url_str, headers={&apo ...

What could be causing my CSS navigation toggle button to malfunction?

My attempt at creating a toggle button for tablets and phones seems to be failing. Despite the javascript class being triggered when I click the toggle button, it is not functioning as expected... https://i.stack.imgur.com/j5BN8.png https://i.stack.imgur. ...

Is there a way to adjust the label elevation for a Material UI TextField component?

I am trying to enhance the appearance of a textfield label, but I am facing some challenges with my code. textStyle: { backgroundColor: '#1c1a1a', border: 0, borderRadius: 0, width: 400, height: 66, display: 'flex&a ...

Having an issue with Jquery selector where the text does not match

HTML Code <select id="myDropdown"> <option selected="selected" value="0">default</option> <option value="1">bananas</option> <option value="2">pears</option> </select> Javascript Function setDr ...

Bootstrap 4 and Angular 7 application experiencing issues with toggle button functionality in the navigation bar

I am currently working with Angular7 and Bootstrap4. I am attempting to integrate a navbar into my application, but I am facing an issue where the toggle button does not work when the navbar is collapsed. It is important for me to mention that I do not wa ...