The text box is intersecting with the photo

Struggling to craft a clean layout with an upvote button, I encountered an issue where the textarea appears to overlap with the image.

Below is my sample code snippet:

.my-component-row {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(247, 247, 248, 1);
}
...
<head>
  ...
</body>

The problem arises from the overlapping of the textarea and the image. Could anyone provide insights into why this occurs?

Your feedback is greatly appreciated!

Answer №1

For your particular situation, try adding img { min-width: 0; } or img { overflow: hidden; } to compress the image effectively:

.custom-row {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(247, 247, 248, 1);
}

.custom-container {
  display: flex;
  align-items: flex-start;
  width: 800px;
  padding: 10px;
}

.custom-icon {
  width: 24px;
  height: 24px;
  margin-right: 15px;
}

.custom-textbox {
  flex-grow: 1;
  border: none;
  outline: none;
}

.vote-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-right: 20px;
}

.vote-button {
  font-size: 2rem;
  background: none;
  border: none;
}

.view-count {
  margin-top: 10px;
}

.vote-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-right: 20px;
}

img {
  min-width: 0;
}
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f89a97978c8b8c8a9988b8cdd6cbd6c8d59994889099c9">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet">

  <!-- Bootstrap Icons -->
  <link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b3d1dcdcc7c0c7c1d2c39edad0dcddc0f3829d849d82">[email protected]</a>/font/bootstrap-icons.css" rel="stylesheet">
</head>

<body style="margin-bottom: 32px;">
  <header class="p-3 border-bottom sticky-top bg-white">
    <div class="container">
      <div class="d-flex flex-wrap align-items-center justify-content-center justify-content-lg-start">
        <a href="/" class="d-flex align-items-center mb-2 mb-lg-0 link-body-emphasis text-decoration-none" style="
          font-size: 30px;
          color: black;
      ">
              Test<sup style="font-size: 12px; color: black; margin-left: 5px;">BETA</sup>
            </a>

        <ul class="nav col-12 col-lg-auto me-lg-auto mb-2 justify-content-center mb-md-0">
          <li>
            <a href="http://127.0.0.1:8000/latest" class="nav-link px-2 link-body-emphasis" style="margin-left: 20px;">Text</a>
          </li>
        </ul>
      </div>
    </div>
  </header>

  <div class="container mt-5">

    <!-- IMAGE -->
    <div class="row">
      <div class="col-md-6 d-flex align-items-center justify-content-center">
        <div class="vote-section">
          <button id="upvote-button" class="btn btn-outline-secondary vote-button">
                    <i class="bi bi-arrow-up-square-fill"></i>
                </button>
          <div class="view-count"><span id="view-count">2</span></div>
        </div>
        <img src="https://via.placeholder.com/500x300" alt=""
          class="img-fluid ml-3">
      </div>
      <div class="col-md-6">
        <textarea id="prompt-text" class="form-control" style="width: 100%;" rows="4" readonly="">**&lt;https://s.mj.run/wNoQuLDjphY&gt; Darth Vader, cinematic light, Artist Rembrandt Harmenszoon van Rijn, oil painting, high detail, realistic render, octane render, 4k, 8k, realism, cinematic lighting, dramatic --aspect 5:3 --uplight** - Upscaled (Light) by &lt;@803576493681934346&gt;</textarea>
        <button id="copy-prompt" class="btn btn-primary mt-3">Copy Prompt</button>
      </div>
    </div>
  </div>

  <footer class="bg-white py-3 mt-5">
    <div class="container">
      <div class="row">
        <div class="col-12">
          <p class="text-center">
            ©<span id="currentYear">2023</span>
          </p>
        </div>
      </div>
    </div>
  </footer>
</body>

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

What is the best way to implement Bootstrap 5 jQuery plugins in an ES6 project with Webpack?

Currently in the process of transitioning an ES6 project from Bootstrap 4 to Bootstrap 5, encountering the following error: Error: Uncaught TypeError: bootstrapElement.Tooltip is not a function According to the Migration Notes, Bootstrap 5 no longer inc ...

What methods can be used to stop HTML5 audio from pre-downloading or streaming upon loading?

I am experiencing slow load times on my single page website that features a variety of HTML5 audio players. The issue seems to stem from certain browsers predownloading the content (mp3 and ogg). Internet Explorer Google Chrome Firefox Safari (probably Op ...

There seems to be an issue with the zebra striping in the rich:datatable component when using the rowClasses

I'm attempting to give my table a "zebra" color pattern for the rows, but it seems like the rowClasses attribute isn't functioning properly (edit: I don't see any colors applied to the table at all). Here is how I defined the styles: <s ...

Tips for relocating anchor elements to less desirable locations

My website has an issue with anchor elements appearing too frequently and not in the desired location. I need someone to help fix this so there are only two anchors displayed. After checking my code, it seems like there are not more than the specified num ...

Maintaining Background Consistency After Closing Bootstrap Offcanvas Navigation

Having a lengthy list of links within an offcanvas div, designed to facilitate navigation through a sprawling background page (essentially acting as a table of contents). The offcanvas opens smoothly, and the navigation links successfully move the backgro ...

Slideshow Display Suddenly Halts at the Last Image

I am currently working on a Bootstrap JS Carousel that showcases several images stored in the project folder. Each image's filepath is retrieved from an SQL Server database and displayed within the carousel. While the images are displaying correctly ...

Creating a custom JavaScript clock based on stored database values

I am looking to create an analog clock using JavaScript. I have both working hours and off hours stored in a database. My goal is to display working hours in one color and off hours in another color on the clock. How can I achieve this? The database prov ...

When utilizing JavaScript within an Electron application file that is linked with a script tag in an HTML document, there may be limitations on using node modules with

While working on my Electron application, I encountered an issue with referencing a node module using require within an HTML form that includes JavaScript. Specifically, I am having trouble integrating the 'knex' node module into my code. Here i ...

The TextField component in MUIv5 is showing some frustrating white space in the corners

I've integrated the MaterialUI_v5 library and included a TextField component within a Paper component. The background of the Paper component has been customized to appear in a shade of green. For the Textfield component, I have applied a styling tha ...

The jQuery animate() method fails to execute animations

I'm currently working on a JavaScript animation project and I've run into some roadblocks. One particular issue I'm facing is with animating the <label>'s margin-top, as it's not behaving as expected. For example: $(' ...

Configuring Node.js and express.js for my personal website to showcase my projects

I am new to node.js and I'm excited to implement it on my personal website as a way to start learning. I have successfully set up the node server, but I am struggling with setting up routing using express.js. All my files are typical static files like ...

Tips for swapping out the content within a "li" element

I am dealing with a situation where I have approximately 100 pages, all containing an <ul> tag, but the issue is that I need to enclose each list item within a <span> tag. Below is the code snippet I have tried: <ul style="list-style-type: ...

What is the best way to vertically align a Material UI component to occupy the remaining space within a container

Issue with Material UI/Grids for Login Page As a newcomer to Material UI/Grids, I am currently working on creating a login page where the layout is split into two parts. The left side occupies 5 column spaces while the right side takes up 7 column spaces. ...

jQuery Issue - Clash between multiple menus sharing the same class

Hey there! I'm currently diving into the world of jQuery and encountering an issue with my menu. Whenever I click on a menu item with either the "tm-nav-vertical" or "tm-nav-horizontal" class, it removes the .active class from the initial menu item. I ...

How can I display two different styles on a single page in ASP.NET MVC without any conflicts between CSS classes?

Currently, I am developing a web-based application that is capable of generating documents containing specific data. A new functionality has been introduced in the document generator, allowing users to input an Atlassian Confluence link into a designated t ...

Having trouble retrieving accurate text information from a JavaScript link

I am encountering an issue with my code which consists of links with divs inside them. When I click on a link, it should display another div with data for "Case No" and "Type". However, the problem is that it only fetches the data from the first link click ...

Ways to troubleshoot React JSX/HTML input issue displaying as -$NaN.undefined

https://i.sstatic.net/1xIvb.pnghttps://i.sstatic.net/aeQrS.pngI'm currently facing an issue while trying to implement an input field that subtracts a number from another computed value within an HTML table setup. I've noticed that everything work ...

data not being transferred successfully to the SQL input from forms

The data from this input form is not being properly transferred to the SQL database when using the sqlAddUser.php file available at pastebin.com/W9BH0D3s. The form includes the following fields: <form action="sqlAddUser.php" method="post"> <div c ...

Greek symbols do not display correctly in SQL Server when accessed through PHP

At my server database, there is a table with collation set to greek_ci_ai, but I am facing an issue where Greek characters are displaying as question marks(????). I have attempted using header("Content-Type: text/html; charset=iso-8859-7") and <meta ...

Tips for including space at the beginning and end of a dynamically created table cell

My table is dynamically generated with contents drawn from a database, creating rows based on the data. Each cell has a rounded border and 2px padding for consistency. I want all cells to appear evenly spaced and padded vertically, but I'm facing an ...