Steps for positioning a floating button within a textarea

Can anyone help me achieve this design using Vue framework and postcss preprocessor? I attempted a solution involving a contenteditable span as suggested here, but the button isn't floated properly, causing the text to hide underneath it as if it has absolute positioning:

<div class="feedback__textarea">
  <app-btn theme="deepwater" class="feedback__btn">Send</app-btn>
  <span contenteditable="true"
        class="feedback__input"
        id="feedback-form-message"
        name="message"></span>
</div>

.feedback__textarea {
    position: relative;
    height: 150px;
    background-color: var(--white);
}

.feedback__textarea .feedback__input {
    position: relative;
    top: -60px;
    display: inline-flex;
    width: 100%;
    height: 150px;
    color: var(--dark-grey);
    word-break: break-all;

    &:focus {
        outline: none;
    }
}

.feedback__btn {
    float: right;
    position: relative;
    top: 90px;
}

Answer №1

It's likely that you were anticipating this:

<iframe width="100%" height="300" src="//codebrace.com/embed/b09138c60/?12px&amp;wordwrap&amp;html&amp;css&amp;xcode&amp;focus=css" allowtransparency="true" allowfullscreen="true" style="background-color:transparent; overflow: hidden;margin: 0;" title="" frameborder="0"></iframe>

In order to address the issue, I have enclosed the text area within a div container with position: relative, positioning "feedback__btn" using position: absolute at the bottom right corner.

Improved solution:

By adding margin-bottom to the textarea, I safeguarded against the button covering the textarea. You can refer to the updated solution for assistance. Hopefully, this resolves your concern :).

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

Using props as classnames in next.js applications

I am currently attempting to create a dynamic header for each page of my app that changes color based on the current page. Here is my approach: <Header className="headerBitcoin"></Header> My goal is to have the same header component ...

What is the best way to establish a consistent layout across numerous pages?

As a novice in web development, I am currently experimenting with HTML and CSS to create my first webpage. My goal is to replicate the layout of various elements such as the background and header, but I have been facing challenges in achieving this. Recent ...

Sorting a dynamic menu to assign custom classes with PHP

<?php // Select all entries from the menu table $sql1 = $pardConfig->prepare("SELECT id, menu_title, menu_link, parent FROM pard_menu ORDER BY parent, sort, menu_title"); // Create a multidimensional array to conatin a list of items and parents $sql1 ...

Customize Your Wordpress Category Title with a Background Image

Within my wordpress template, there is a module known as new_boxs. The code snippet below shows that this module displays on the page six times, with two columns wide and three rows down: foreach($data_cat as $cat){ ?> <div class="span6"> ...

Utilizing event delegation for JavaScript addEventListener across multiple elements

How can I use event delegation with addEventListener on multiple elements? I want to trigger a click event on .node, including dynamically added elements. The code I have tried so far gives different results when clicking on .title, .image, or .subtitle. ...

An error occurs when trying to access data from the cities of a specific state. The error message reads: "Unable to retrieve property 'data

An error occured: Cannot read property 'data' of undefined at Object.city The issue I am facing is that I am dynamically calling the state parameter. When I use cities.UP.data, it displays the correct result. However, when I try to add cities.st ...

Establish a variable in XSL to define the tabIndex

My XSL code has been designed to read an XML file and generate input elements of type text for each child node. The XML file structure is as follows: For node c, two input boxes are created in the format: Label(com 1) :input box--------------------- Label ...

How can I save or export an image file containing HTML content?

Currently, I am working on a project where I am generating dynamic HTML content. My goal is to be able to export or save this HTML content as an image file using PHP, jQuery, and JavaScript (or any other method if applicable). Can anyone help with the im ...

Properly positioning images within a v-carousel module

In my v-carousel, I have set a height of 40vh. The images inside the carousel are of different sizes, and I want to ensure that none of them get cut off. To achieve this, I used "contain" for the v-image along with a maximum height matching the carousel co ...

Cube with 3D attributes and text displayed on each face shatters upon reaching a specific time limit on Google Chrome (between

The issue appears to be specific to Chrome. In Chrome, the 3D cube's face or multiple faces become transparent, giving the appearance that the animation is breaking. Sometimes adding "backface-visibility" after the break can temporarily resolve the is ...

There seems to be an issue with the pseudo-elements :before and :after

I have been attempting to apply a double border to my table using the "border" property for one, and :before and :after for the second. However, I am facing an issue as it is not working properly. I am relatively new to CSS and HTML and have tried my bes ...

Establishing connections between HTML and CSS files

After writing my html and css code, I noticed that the files are not linking properly. Despite checking for errors, I couldn't find any issues within the codes. Here is a snippet of my html file: <!DOCTYPE html> <html lang="en" dir= ...

Leveraging the power of CSS id selectors to customize the appearance of a Grid

In my current CSS file, I have defined two id selectors: #TableHead { font-family: Arial, Helvetica, sans-serif; font-size:11px; font-weight: bold; color: #000000; border-top-width: thin; border-top-style: solid; border-top-color: #A9AAAA; border-bottom-w ...

Why is the camera access permission dialog not showing up in the WeChat app?

Why is it that when I attempt to open the following links for the first time, Chrome asks for camera permission, but when I access them through WeChat's in-app browser, the camera permission dialog does not appear? Can someone shed some light on this ...

Creating an HTML template in an Angular service and utilizing it as an HTMLTemplateRef

I'm currently working on a major project that has a specific requirement. As part of this project, I am utilizing a library which allows me to open dialog (modal) popups. In order to do so, I need to configure some options for the modal opening proce ...

Hide the border on a table with CSS

I recently installed a Wordpress Template and customized the table's background and text colors. However, I am struggling to remove the border around the table. Despite searching for solutions, my limited CSS knowledge has not led me to a fix that wor ...

The bootstrap modal display issue: black background visible

In my HTML file, there are two modal dialogs that seem to be causing an issue. Interestingly, whichever modal dialog is placed first in the sequence of the HTML code displays properly when the button is clicked (and vice versa). Both modal dialogs have u ...

What steps do I need to take to ensure that my text and images are positioned in the same way as the reference image provided in the link

Can anyone help me align text and images to resemble this example: https://i.sstatic.net/TzNZtvJj.png Currently, it is displaying like this: https://i.sstatic.net/M6gUdUEp.png Here is the HTML and CSS I have used: :root { font-size: 10px; } *, *: ...

The Angular material checkbox has a mind of its own, deciding to uncheck

I am having an issue with a list displayed as checkboxes using angular-material (Angular 7). Below, I will provide the code snippets for both the .html and .ts files. Every time I click on a checkbox, it gets checked but then immediately becomes unchecked ...

Tips for creating a single rolling scroll over multiple rows in a grid layout

I successfully implemented a grid layout for displaying four book images in a row with CSS, including responsive overflow. However, the challenge lies in ensuring that only one row scrolls at a time while allowing other rows to scroll simultaneously when o ...