What is the reason behind the vanishing of the input field while adjusting the

Why is the input field getting cut off when I resize my browser window, even though I'm using percentages? Here is a screenshot for reference: https://i.sstatic.net/4JrWd.png Shouldn't it resize automatically with percentages? Thank you!

Below is my CSS code:

body {
    margin: 0;
    padding: 0;
    background-color: #EFEFEF;
    font-family: sans-serif;
}

.homepage-window {
    height: 100vh;
    display: flex;
}

.nav-bar {
    width: 18%;
    background-color: #2E3E4E;
}

.bar-manager {
    width: 100%;
}
...

And here is my HTML code:

<!DOCTYPE html>
<html>
<link rel="stylesheet" type="text/css" href="CSS/Homepage.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<head>
    <title>Cold-Ops Homepage</title>
</head>
<body>
    <div class="homepage-window">
        <div class="nav-bar">   
        </div>
        <div class="bar-manager">
            <div class="top-bar">
                <p>Homepage</p>
                <div class="user-search-input-field">
                    <form action="Login.php" method="POST">
                        <input type="text" name="userPost" placeholder="Search users..." required>
                        <i class = "fa fa-search" aria-hidden = "true"></i>
                    </form>
                </div>
            </div>
            <div class="bottom-bar">
                <div class="bottom-bar-texts">
                    <div><h1>Welcome, Omard2000</h1></div>
                    <div><p>Administrator</p></div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>

Thank you!

Answer №1

The element has been successfully positioned.

It's likely that the left side is causing it to extend beyond the visible screen.

Combining view units and pixels can be risky.

Answer №2

Recent Update:

Due to the limited space available for the user-search-input-field, the top-bar has been divided into two sections. Part 1 is reserved for p and Part 2 is for user-search-input-field, providing more space, as shown below:

body {
    margin: 0;
    padding: 0;
    background-color: #EFEFEF;
    font-family: sans-serif;
}

.homepage-window {
    height: 100vh;
    display: flex;
}

.nav-bar {
    width: 18%;
    background-color: #2E3E4E;
}

.bar-manager {
    width: 100%;
}

.top-bar {
    display: flex;
    align-items: center;
    width: 100%;
    height: 7%;
    background-color: white;
    border-bottom: 0.5px solid lightgrey;
}

.top-bar p {
    margin-left: 10px;
    font-weight: lighter;
}


.bottom-bar {
    width: 100%;
    height: 40px;
    display: flex;
    align-content: center;
    line-height: 40%;
    background-color: white;
    border-bottom: 1px solid lightgrey;
}

.bottom-bar h1 {
    font-size: 12px;
    margin-left: 10px;
    font-weight: 500;
}

.bottom-bar p {
    font-size: 12px;
    margin-left: 10px;
    font-weight: lighter;
}

.user-search-input-field {
    width: 100%;
    
}
form {
    background-color: red;
    display: inline-block;
    float: right;
}

.top-bar p {
    width: 20%;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<div class="homepage-window">
    <div class="nav-bar"></div>
    <div class="bar-manager">
        <div class="top-bar">
            <p>Homepage</p>
            <div class="user-search-input-field">
                <form action="Login.php" method="POST">
                    <input type="text" name="userPost" placeholder="Search users..." required>
                    <i class = "fa fa-search" aria-hidden = "true"></i>
                </form>
            </div>
        </div>
        <div class="bottom-bar">
            <div class="bottom-bar-texts">
                <div><h1>Welcome, Omard2000</h1></div>
                <div><p>Administrator</p></div>
            </div>
        </div>
    </div>
</div>

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

A guide to sending epoch time data to a backend API using the owl-date-module in Angular

I have integrated the owl-date-time module into my application to collect date-time parameters in two separate fields. However, I am encountering an issue where the value is being returned in a list format with an extra null value in the payload. Additiona ...

Executing a function within a ng-repeat iteration

Is there a way to call a method within an ng-repeat loop, even if the element does not exist at that moment? I'm facing this issue and I'm not sure how to resolve it... The ID seems to be correct. Strangely, when I run it in the console after ev ...

What is the process for transmitting data in JSON format generated by Python to JavaScript?

Utilizing Python libraries cherrypy and Jinja, my web pages are being served by two Python files: Main.py (responsible for handling web pages) and search.py (containing server-side functions). I have implemented a dynamic dropdown list using JavaScript w ...

Place your cursor over the following element to take control

There is a paragraph that needs to be clipped when hovered over. An issue arises where the H1 text shifts its position. Only the phrase "HOVER ABOVE PARAGRAPH" should be concealed. * { margin: 0; box-sizing: border-box; } .wrapper { displ ...

How to use Selenium WebDriver in Python to upload a file using a hidden input field

Html: <div id="js-cert-file" class="form-group"> <button id="js-ob-browse-n-upload" class="btn btn-ob browse-and-upload-onboarding-ssl-button" style=""> BROWSE & UPLOAD </button> <input id="js-cert-file" class="hidden btn btn-ob" ...

The synchronization between Typescript and the HTML view breaks down

I am currently working on an application that retrieves user event posts from MongoDB and displays them in HTML. In the Event-post.ts file, inside the ngOnInit() function, I have written code to retrieve the posts using the postsService.getPosts() method. ...

Utilizing AggregateRating and ratingValue to represent ratings in the form of images

I'm facing a challenge while trying to incorporate rich snippets on my website, particularly in the AggregateRating section where the ratingValue is only displayed as an image. This is how my markup currently looks: <tr itemprop="reviews" itemsco ...

Customize the background image in your Windows 8 app developed with HTML

While working on my app with the grid app template, I placed an image in the images folder. However, when I attempted to change the background image, it didn't seem to take effect. This is the code snippet that I used: HMTL <div id="contenthost" ...

Combining numerous base64 decoded PDF files into a single PDF document with the help of ReactJS

I have a scenario where I receive multiple responses in the form of base64 encoded PDFs, which I need to decode and merge into one PDF file. Below is the code snippet for reference: var pdf_base1 = "data:application/pdf;base64,JVBERi0xLjQKJfbk/N8KMSAwIG9 ...

When adjusting to mobile dimensions, the responsive website design struggles to center the navbar properly

I am currently developing my senior year portfolio website and I am struggling to center the navbar (Work About Contact) when it is in mobile mode. My goal is for it to be positioned directly below the logo, perfectly centered, but so far nothing I have tr ...

Guide on navigating to a specific section on a different page using scrolling

Adding a link for a "read more" button is simple. Just include the href attribute like this: <a href="about.html#post2">readmore</a> In my index.html page, I have implemented Bootstrap 3 with scroll animations for navbar sections. When clicki ...

Specify the location of the resize button (corner)

Scenario : At the bottom of the page, there is a resizable textarea, However, having the resize button at the bottom-right corner does not provide the best user experience (try it out), Issue : I am wondering if there is a way to move the resize butt ...

What is the best way to toggle a specific div element within an ng-repeat loop?

I have a list of products. When I click on a product, it should be added to the database. If I click on the same product again, it should be removed from the database. I am toggling the wishlistFlag using ng-click. This works correctly for one div element, ...

How to Emphasize Html Select Element on Mobile Devices?

Is there a way to make the HTML select element on Android appear more distinguishable as a dropdown list, rather than just looking like plain text? Any suggestions for highlighting it so users can easily identify and select an option from this element? Up ...

html<script src="" and causing a redirect when button is clicked

My login.html page for logging in can be found in the design folder. <html> <head> <title>Login Page</title> <script src="../Script/login.js"> </script> </head> <body> <h3> Login</h3> ...

Switch back and forth between two tabs positioned vertically on a webpage without affecting any other elements of the page

I've been tasked with creating two toggle tabs/buttons in a single column on a website where visitors can switch between them without affecting the page's other elements. The goal is to emulate the style of the Personal and Business tabs found on ...

Difficulties with integrating tooltips into SVGs

Being a minimalist, I am facing restrictions while working on a website. I desire interactive tooltips to appear when users hover over specific sections of my SVG. However, I also want to incorporate this interactivity within the SVG itself. The challenge ...

The React Navbar fails to appear when using React JS

I am currently in the process of creating a single-page website. I have incorporated react-bootstrap for the navigation bar, but I am facing an issue where it is not rendering on the page. Despite not encountering any errors, the page remains blank. Below ...

Struggling to close the dropdown with jquery

Check out this code snippet: https://jsfiddle.net/rajat_bansal/rtapaew5/1/ The jQuery section below is causing some trouble: $(document).ready(function(e) { $(".sub-handle").click(function() { if(!$(this).hasClass('showing-sub&ap ...

Vertical centering menu adjustment

Can anyone help me with centering an image on my website? I've tried the following code: top: 50%; -webkit-transform: translateY(-50%); -ms-transform: translateY(-50%); transform: translateY(-50%); You can see what's happening on my site here: ...