Content descriptor with numerous lines

Currently, two things are on my mind...
First:
I'm attempting to set up a contact section with a few basic text input fields. One of these fields is meant for longer messages and should have multiple rows. The issue I'm facing is figuring out how to add these rows and restrict the number of characters per row.
Second:
How can I make these input fields clickable and editable? Once added to the website, they show as placeholders but do not allow me to click and type inside them (for example, to fill out a form)...

The code snippet is provided below, and I appreciate any assistance in expanding my knowledge on this topic...

.kontakt {
display: block;
padding-top: 10px;
padding-bottom: 15px;
padding-left: 15px;
padding-right: 15px;
border: 3px solid #20202f;
border-radius: 10px;
position: absolute;
top: 50px;
left: 50px;
font-size: 24px;
background-color: rgba(51, 52, 89, 0.85);
}

#yourname {
font-size: 20px;
margin-bottom: 10px;
}

#mail {
font-size: 20px;
margin-bottom: 10px;
}

#message {
font-size: 20px;
margin-bottom: 25px;
}

.messagebutton {
width: 75px;
height: 35px;
font-size: 15px;
border-radius: 5px;
background-color: #bfbfff;
color: black;
margin-left: 172px;
margin-bottom: 5px;
}
<div class="kontakt">
<div class="nametext">
<label for="ime">your name</label> 
</div>
<div class="namebox">
<input type="text" id="yourname" placeholder="your name">
</div>
<div class="mailtext">
<label for="mail">e-mail</label>
</div>
<div class="mailbox">
<input type="email" id="mail" placeholder="your email">
</div>
<div class="messagetext">
<label for="Message">message</label>
</div>
<div class="messagebox">
<input type="text" id="message" placeholder="Your message goes here">
</div>

<button type="button" class="messagebutton">SEND</button>

</div>

Answer №1

Great information!

If you need a message that spans multiple lines, it's best to use the textarea tag instead of the input tag. Here's an example:

    <div class="messagebox">
        <textarea id="message" rows="3" placeholder="Your message goes here"></textarea>
    </div>

The ROWS attribute allows you to specify the number of lines, or you can leave it to the browser default.

For more details on textareas, you can visit https://www.w3schools.com/tags/tag_textarea.asp

By default, textareas are editable - and your code snippet appears to be functioning correctly.

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

Efficiently Organizing Data Using Coldfusion Loops in Columns and Rows

My issue lies in pulling data from a database to display on my website. I have three keys/attributes (columns) - PostedDate, DataImage, and Source that need to be shown together in one div with the posted date at the top, image in the middle, and source at ...

Can you explain the distinction between [att|=val] and [att~=val] in css?

Could someone help me differentiate between the [att|=val] and [att~=val] attributes in CSS? I'm having trouble grasping the concept. Thank you! ...

Failing to verify the presence of specific text within a dropdown menu using Selenium

Previously, I successfully implemented this code, however, the HTML/CSS for the dropdown has since changed and now I am unable to get it to function correctly. Below is the structure for the dropdown code, with specific text highlighted that I am trying t ...

What is the best way to cut out a portion of a div using CSS?

I have a scaled down version of my project, but it's not quite what I need. I would like the green div to have some transparency so that the content behind both divs is visible (there is none in the example, but there is in my actual project). However ...

Implementing dynamic width with ng-style in AngularJS

I am trying to dynamically resize a div when an event is fired from S3. In the code below, I pass the progress variable to the updateProgress function as a parameter. This function resides in the top scope of my Angular controller. s3.upload(params).on(& ...

Alter the colors of all Divs inside a container with each click

Hey everyone, I'm just starting to learn JavaScript. I'm working on a project where I want to change the color of all the divs in a container every time they are clicked. For example, on the first click, I want all the divs to turn red. Then, on ...

Is there a way to retrieve values from two input fields using the onclick function?

In a div, I have added two input fields and an update button. Here's the code structure: <button type = "button" id = "add-botton" >Add Element </button> <div id = "trace-div1" class = "trace"> <h4><span>Trace 1& ...

Setting a fixed width for content in CSS based on the size of the browser screen

I'm a newcomer to CSS and HTML and feeling a bit lost on this issue. My goal is to divide the screen into two halves, with one half taking up 50% of the browser screen width while the other half remains flexible. I want the content in one half to be f ...

PHP - The variable $_SESSION['var1'] has not been set within the index.php file

My index.php page is causing me some confusion. <?php session_start(); if (!isset($_SESSION['var1'])) { echo "session not started..."; die(); } else { echo "session started"; die(); } ?> Within the page, there is a login form that connec ...

Exploring ways to open the Front camera using HTML5 without relying on WebRTC

Is there a way to launch the front camera directly using HTML5? I know that with <input type="file" accept="image/*" capture="camera">, we can launch the Gallery/Camera choose option in HTML5 based apps. However, I specifically want to use the front ...

What is the process for implementing filtered HTML attributes in a directive?

I’ve created a custom directive that generates a popup menu by extracting data from HTML content. The purpose is to transform a group of Bootstrap carousel-compatible elements into a structured list. However, each .item element contains an attribute with ...

What is the best method for effectively organizing and storing DOM elements alongside their related objects?

In order to efficiently handle key input events for multiple textareas on the page, I have decided to create a TextareaState object to cache information related to each textarea. This includes data such as whether changes have been made and the previous co ...

Combining Bootstrap navigation with a hamburger menu icon

Can anyone suggest the most effective method in Bootstrap4 to showcase both a menu and a hamburger menu simultaneously within a navbar? The goal is to prioritize less important menu elements through the hamburger menu. Any assistance would be greatly app ...

How can I create a black border around an input button in the OPERA browser

List item Why does a black box appear around the input button in Opera? Check out the jsfiddle link for reference: http://jsfiddle.net/PKRRj/ Give it a try by clicking on the button. Test it in Opera, as there are no issues with other browsers. Here is ...

Tips for creating space between a radio button and its label text

I'm having an issue with the spacing between my radio button and radio button text box in my struts tag. It seems to be congested. Any suggestions on how to create more space between them? <div class="form-group"> <label class="col-lg- ...

The current page does not get printed when using @media print

I am facing an issue with two components on my website <div id="div1"> div1 content </div> <div id="div2"> div2 content </div> and the CSS styling for these components is as follows: #div1{ height: 1000px; } @media print { ...

The Javascript function call from the <img src="myFunction()"> is malfunctioning

I am looking to dynamically pass the URL of an image using a JavaScript function. <head> <script> function myFunction() { var str1 = "somepictureurl.png"; return str1; } </script> </head> <body> <img src="myFu ...

Designate the preferred location for requesting the desktop site

Is there a way to specify the location of the 'Request desktop site' option? Here is the code I am currently using: var detector = new MobileDetect(window.navigator.userAgent); if(detector.mobile() != null || detector.phone() != null || det ...

jQuery enables the creation of fresh form fields

Currently, I am working on a form that initially consists of 2 text input fields. The typical use case involves the user entering a number in one field and their name in the other. Following this, the page updates itself without reloading. However, there a ...

Collapsed Bootstrap 5 select drop-down featuring the multiple attribute

I am facing a challenge with using the select element along with the 'multiple' attribute. My aim is to have it collapsed by default and expand only when the user clicks on it. Unfortunately, Bootstrap 5 no longer supports the multiselect feature ...