Is there a way to adjust the alignment of the placeholder text to the top of a sizable input field?

Here is how my code currently appears:

https://i.sstatic.net/WwXd2.png

I am trying to align the text at the top of the input text field.

I have attempted using align-text-top, align-top, and creating a custom class with vertical-align: top; and vertical-align: text-top;

However, I haven't been able to find a solution. Any assistance would be greatly appreciated.

<body>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="87e5e8e8f3f4f3f5e6f7c7b2a9b6a9b4">[email protected]</a>/dist/css/bootstrap.min.css" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">

  <script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>

  <div class="main-wrapper" style="object-fit: contain;">
    <!-- navbar -->
    <div class="navbarDesktop d-none d-sm-flex">
      <img class="p-3" style="width: auto; height: auto; max-width: 40%; object-fit: contain;" src="../../expanded_logo.png" />
      <img class="p-4 ms-auto" style="width:auto; max-width: 34%; object-fit:contain;" src="../../title_text.png">
    </div>
    <!-- main content -->
    <div class="mainContent">
      <!-- text -->
      <div class="px-5 pt-5 pb-4 display-5 d-flex flex-column h-100">
        <p>Do you have any <span class="brand">medical conditions</span> and/or <span class="brand">allergies</span>?</p>

        <div class="pt-4 h-100">
          <input type="text" class="text-wrap h-100 w-100 form-control align brandBorder fs-1 px-4 pt-2" placeholder="Start typing here..." id="conditions">
        </div>

        <p id="error" class="text-danger visually-hidden"><span class="fs-3">Please double check your entry.</span></p>

        <div class="d-flex pt-4 ps-2">
          <p class="brand fs-2 me-auto">Separate items with a comma. <br> e.g type 1 diabetes, coronary heart disease</p>
          <input class="btn btn-dark border-0 btn-lg brandBack fs-1 px-5 mt-4 border" type="submit" value="Next" id="next">
        </div>
      </div>
    </div>
  </div>
</body>

Answer №1

Switching to a textarea was the simple solution I needed, since input does not have the capability for multiline text or vertical alignment.

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

Include a search button within the search box of the Custom Search Engine

Can anyone help me with adding a search button to my HTML code? I've tried implementing it, but when I try to search something on a website like YouTube, the results show up without displaying my search query. How can I fix this issue and what changes ...

Having trouble selecting links in the navigation bar

Just getting started with HTML/CSS and designing a website with buttons. Got some buttons up and running perfectly fine. But now, I'm working on a navigation bar with anchors inside. The problem is that while I can see the anchors when I open the webs ...

Using a data URL to stream a PDF into an iframe is only compatible with Chrome

While the code below functions properly in Chrome, it displays a blank iframe content in Firefox 15 and IE 9. <html> <head></head> <body> <p>this n that</p> <iframe type="application/pdf" widt ...

Adjust item size and move them into the panel

I am looking to create a panel that arranges items in a specific layout shown here: https://i.stack.imgur.com/qw3lS.png Below is the code I have attempted so far: import React, { useCallback, useEffect } from "react"; import { Box, Grid, Tab, T ...

Identifying activity on a handheld device

I am currently working on a website and I have noticed that it doesn't work as well on mobile devices as it does on desktop. There are performance issues that need to be addressed. I've seen other websites redirecting users to a different page wh ...

When attempting to load a CSS file, Java automatically redirects to the login page

EDIT** After successfully loading CSS, I encountered an issue where the page kept redirecting back to login.jsp instead of displaying the CSS. Any insights on what might be causing this?https://i.sstatic.net/Ij7Oh.png I attempted to incorporate a custom ...

Executing a Javascript function post AJAX page loading

I'm not a coding expert, so I hope my question is still clear. Essentially, I have an index.php page with filters (by project, year, month) that send variables to filterData.php after clicking submit. These variables are then used in SQL statements t ...

Using JQuery, select and remove a single element from a dropdown while simultaneously removing the same element

I am experiencing an issue with multiple drop-downs that have the same options. Currently, my code functions correctly when the user selects an item from the first drop-down list, causing that item to be removed from the second and third lists. However, if ...

Update the hover effect specifically for mobile devices

.hovereffect a.info,.hovereffect h2{text-transform:uppercase;color:#fff} .hovereffect{float:left;position:relative;cursor:default} .hovereffect .overlay{position:absolute;top:0;left:0;opacity:0;background-color:none;-webkit-transition:all .4s ease-in-out ...

Using AngularJS to apply custom css to a tag within a directive for creating a Bootstrap sticky footer

Currently, I am in the process of developing my very first AngularJS application with Bootstrap as the responsive framework. In order to achieve a sticky footer, I usually utilize jQuery to determine the outerHeight of the footer and then apply that value ...

Javascript enables the magnetization of cursor movements

Can a web page be designed so that when users open it and hover their mouse over a specific area outside of an image, the mouse is attracted to the image as if by a magnet? Is this idea feasible? Any suggestions would be appreciated. ...

Exploring the Difference Between :nth-child(even|odd) and :nth-child(int) CSS Selectors

Encountering a challenge with the CSS :nth-child pseudo selector and suspecting that something crucial has been overlooked. index.html <html> <head>...</head> <body> <div class='selector'>first</di ...

Altering calendar dates using VBA for web scraping

Seeking assistance with creating a VBA program for automatically downloading historical stock data from a website. The code I have currently works for downloading data, but I'm facing challenges in changing the date using my code. You can view the co ...

Click to position custom text on image

Is there a way to adjust the position of text on an image after it has been clicked? I have included an image below to demonstrate how I would like it to appear: https://i.stack.imgur.com/unmoD.png function revealContent(obj) { var hiddenText = obj. ...

The JavaScript code appears to be missing or failing to execute on the website

Encountering a console error while trying to integrate jQuery into my website. The JavaScript file is throwing an error in the console that says: Uncaught ReferenceError: $ is not defined catergory.js:1 Even after following the suggested steps in this an ...

Guide on creating my inaugural HTML embeddable widget?

A client recently requested me to create a JavaScript (MooTools)/HTML/CSS/PHP based game as a deployable widget. This will be my first time developing a widget, so I am seeking advice and insights to help me navigate any potential challenges from experie ...

The Silent Disregard for CSS Files in React Rendered Pages

I'm currently working on a React application that I created using create-react-app. In my index.html file, I have linked it to my CSS file like this: <link rel="stylesheet" href="../src/site.css"></link> The content of the site.css file ...

Problem: NgFor is failing to render the data

Hey there! I'm working on a project that involves Spring Boot, SQL, and Angular. I have set up one-to-many relationships, but I'm struggling to display the second object in my component's HTML. Here's my current setup: @Component({ se ...

What is the best way to assign specific codes to separate pages using a single JS file?

I am currently working on a project that involves an authentication JavaScript which is responsible for managing user sign-ins and registrations. However, there are certain lines of code within this script that impact different pages in various ways. I n ...

Web GUI for insert, update, and delete functionalities

After repeatedly creating Add/Edit/Delete/List GUI's, I have grown weary and frustrated with the process. Surely, there must be a free package available that can simplify this tedious task. I envision something like the following code snippet: { ...