Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Full Width Transparent Textarea input

Tags:

html

css

I am trying to make a note application using HTML5 and CSS. While trying to take input from the user, I would like that the textarea is full width (100%) and would be transparent.

So, basically, the text area should be transparent and page should just show a white cursor, and there should be no overflow.

If someone could point me to saving and clearing the note, that would be great too.

like image 671
Dvorak Avatar asked Jul 29 '15 18:07

Dvorak


People also ask

How do I make textarea transparent?

The absolute easiest way to do that is to add padding to the wrapping element. The width of the input is 100% of its container + 1px + 1px (borders) + 4px + 4px (padding). In other words the width is 100% + 10px; Therefore we give the fix class an extra 10px padding to the right.

How do you make an input box transparent in CSS?

You can set the CSS transparent background for boxes by adding the opacity property to multiple <div> elements. Tip: you should notice that texts inside boxes take the opacity of the CSS transparent background. The RGBA function allows you to keep the text opacity.

How do you make a transparent color in input?

As for transparency, it's really quite simple, all you have to do is use: background-color: transparent; you can also use: background-color: rgba(255, 0, 0; also, 0 and 0, as well). How Do You Make An Input Tag Transparent In Css?


1 Answers

Depending on the image you have posted, wrap the textarea inside a container.

html,
body {
  height: 100%;
  padding: 0;
  margin: 0;
  overflow-x: hidden;
}

.text-container {
  background: #4492E0;
  padding: 20px;
  height: 100%;
  position: relative;
}

textarea {
  background: transparent;
  color: transparent;
  resize: none;
  border: 0 none;
  width: 100%;
  font-size: 5em;
  outline: none;
  height: 100%;
  position: absolute;
}

textarea:focus {
  color: white;
}
<div class="text-container">
  <textarea>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).
  
  Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).</textarea>
</div>
like image 96
m4n0 Avatar answered Oct 11 '22 22:10

m4n0