Стилизация textarea css пример

CSS Forms

The look of an HTML form can be greatly improved with CSS:

Styling Input Fields

Use the width property to determine the width of the input field:

Example

The example above applies to all elements. If you only want to style a specific input type, you can use attribute selectors:

  • input[type=text] — will only select text fields
  • input[type=password] — will only select password fields
  • input[type=number] — will only select number fields
  • etc..

Padded Inputs

Use the padding property to add space inside the text field.

Tip: When you have many inputs after each other, you might also want to add some margin , to add more space outside of them:

Example

Note that we have set the box-sizing property to border-box . This makes sure that the padding and eventually borders are included in the total width and height of the elements.
Read more about the box-sizing property in our CSS Box Sizing chapter.

Читайте также:  Ввод строк java консоль

Bordered Inputs

Use the border property to change the border size and color, and use the border-radius property to add rounded corners:

Example

If you only want a bottom border, use the border-bottom property:

Example

Colored Inputs

Use the background-color property to add a background color to the input, and the color property to change the text color:

Example

Focused Inputs

By default, some browsers will add a blue outline around the input when it gets focus (clicked on). You can remove this behavior by adding outline: none; to the input.

Use the :focus selector to do something with the input field when it gets focus:

Example

Example

Input with icon/image

If you want an icon inside the input, use the background-image property and position it with the background-position property. Also notice that we add a large left padding to reserve the space of the icon:

Example

input[type=text] <
background-color: white;
background-image: url(‘searchicon.png’);
background-position: 10px 10px;
background-repeat: no-repeat;
padding-left: 40px;
>

Animated Search Input

In this example we use the CSS transition property to animate the width of the search input when it gets focus. You will learn more about the transition property later, in our CSS Transitions chapter.

Example

input[type=text] <
transition: width 0.4s ease-in-out;
>

input[type=text]:focus width: 100%;
>

Styling Textareas

Tip: Use the resize property to prevent textareas from being resized (disable the «grabber» in the bottom right corner):

Example

textarea <
width: 100%;
height: 150px;
padding: 12px 20px;
box-sizing: border-box;
border: 2px solid #ccc;
border-radius: 4px;
background-color: #f8f8f8;
resize: none;
>

Styling Select Menus

Example

select <
width: 100%;
padding: 16px 20px;
border: none;
border-radius: 4px;
background-color: #f1f1f1;
>

Styling Input Buttons

Example

input[type=button], input[type=submit], input[type=reset] <
background-color: #04AA6D;
border: none;
color: white;
padding: 16px 32px;
text-decoration: none;
margin: 4px 2px;
cursor: pointer;
>

/* Tip: use width: 100% for full-width buttons */

For more information about how to style buttons with CSS, read our CSS Buttons Tutorial.

Responsive Form

Resize the browser window to see the effect. When the screen is less than 600px wide, make the two columns stack on top of each other instead of next to each other.

Advanced: The following example uses media queries to create a responsive form. You will learn more about this in a later chapter.

Aligned Form

An example of how to style labels together with inputs to create a horizontal aligned form:

Источник

15+ CSS Textarea Styles

CSS Textarea Styles

Hello there! In this article, you will find 15+ Textarea Styles Using Html And CSS with complete sources.

CSS Textarea Styles

We have the best handpicked CSS Textarea Styles. Custom-made free Textarea Styles using Html And CSS code and demo for you. So you can just simply copy and paste them into your project and implement it easily.

First, let’s quickly see what a text area is, The HTML element represents a multi-line plain-text editing control, useful when you want to allow users to enter a sizeable amount of free-form text, for example, a comment on a review or feedback form. Textarea can be used in many different circumstances as well.

master frontend development ebook cover

Do you want to learn HTML to JavaScript? 🔥

If yes, then here is our Master Frontend: Zero to Hero eBook! 📚 In this eBook, you’ll learn complete HTML, CSS, Bootstrap, and JavaScript from beginner to advance level. 💪 It includes 450 Projects with source code.

Here are Textarea Styles Using Html And CSS with code examples from codepen.

Let’s see some cool CSS Textarea styles.

1. A fun textbox

15+ CSS Textarea Styles

Let’s start our list with a textbox that looks like a notepad made by Stein using Html And CSS.

2. Hungry textarea

15+ CSS Textarea Styles

See the Pen Hungry textarea by Louis Hoebregts (@Mamboleoo) on CodePen.

Code by Louis Hoebregts
Demo & download click here for the code
Language used HTML,CSS(SCSS),JS
External link / Dependencies Yes
Responsive Yes

Hungry Textarea by Louis Hoebregts. The text area is transformed into a mouth of a monster. this is made with HTML, CSS(SCSS), and JavaScript.

3. Textarea Tabs + Syntax Highlighting

15+ CSS Textarea Styles

Code by Ashley Ktorou
Demo & download click here for the code
Language used HTML,CSS(SCSS),JS
External link / Dependencies Yes
Responsive No

A code editor style text area, made by Ashley Ktorou using HTML, CSS(SCSS), and JavaScript. Additionally, it also has syntax highlighting.

4. CodeHive’s simple markdown WYSIWYG toolbar

15+ CSS Textarea Styles

Code by Michael Lee
Demo & download click here for the code
Language used HTML,CSS(SCSS),JS(CoffeeScript)
External link / Dependencies Yes
Responsive No

simple markdown WYSIWYG toolbar by Michael Lee made by using HTML, CSS(SCSS), and JS(CoffeeScript).

5. Twemoji Input

15+ CSS Textarea Styles

See the Pen Twemoji Input by Dmitriy Levchenko (@levchenkod) on CodePen.

Code by Dmitriy Levchenko
Demo & download click here for the code
Language used HTML, CSS, JS
External link / Dependencies Yes
Responsive No

Tiny plugin for pasting emojis in text area developed by Dmitriy Levchenko using HTML, CSS, and JavaScript.

6. Color Changing Cursor in TextArea

15+ CSS Textarea Styles

Code by Timothy Carambat
Demo & download click here for the code
Language used HTML, CSS, JS
External link / Dependencies Yes
Responsive No

Changing the color of an input cursor as it reaches the max length attr of a text area. made by Timothy Carambat using HTML, CSS, and JavaScript.

7. Sticky Notes

15+ CSS Textarea Styles

See the Pen Sticky Notes by Edmond KO (@edmondko) on CodePen.

Code by Edmond KO
Demo & download click here for the code
Language used HTML,CSS(SCSS),JS
External link / Dependencies Yes
Responsive No

Sticky notes by Edmond KO made with HTML, CSS(SCSS), and JavaScript. This example is purely visible only, it doesn’t save any notes.

8. Textarea with alternating background lines

15+ CSS Textarea Styles

Code by Erik Wiedeman
Demo & download click here for the code
Language used HTML,CSS(SCSS)
External link / Dependencies Yes
Responsive No

Textarea with alternating background lines, made by Erik Wiedeman using HTML and CSS(SCSS).

9. Textarea Auto Height

15+ CSS Textarea Styles

Code by Aaron Iker
Demo & download click here for the code
Language used HTML,CSS(SCSS),JS
External link / Dependencies Yes
Responsive No

A text area that automatically changes its height. Developed by Aaron Iker using HTML, CSS(SCSS), and JavaScript.

10. Svelte Word Frequency

15+ CSS Textarea Styles

Code by Gabriele Corti
Demo & download click here for the code
Language used HTML, CSS, JS
External link / Dependencies Yes
Responsive Yes

Elaborate the absolute frequency for every word included in a text area element. Highlight the result through a table and a pie chart. This is made by Gabriele Corti using HTML, CSS, and JavaScript.

11. Under the sea contact form

15+ CSS Textarea Styles

Code by Geert-Jan Hendriks
Demo & download click here for the code
Language used HTML, CSS, JS
External link / Dependencies Yes
Responsive No

Contact form with custom jQuery form validation and a good text area design. Plus some simple CSS3 animations.

12. Drag-n-drop sticky, with no JS!

15+ CSS Textarea Styles

Code by Scott Kellum
Demo & download click here for the code
Language used HTML,CSS(SCSS)
External link / Dependencies No
Responsive No

Another sticky note design. this was developed by Scott Kellum using HTML and CSS(SCSS) There is one element that allows you to drag around a part of it. That element is a text area. This places a note on the resizable corner of a text area. When you’re moving the note, you’re actually just resizing the text area and the note happens to follow along.

13. Chat Widget

15+ CSS Textarea Styles

See the Pen Chat Widget by Andre Madarang (@drehimself) on CodePen.

Code by Andre Madarang
Demo & download click here for the code
Language used HTML,CSS(SCSS),JS
External link / Dependencies Yes
Responsive No

A text area design for chatboxes, made by Andre Madarang using HTML, CSS(SCSS), and JavaScriptSearch field is functional. You can also add your own messages to the chat window! A random response will be given 🙂

14. Angularjs auto-expanding textarea

15+ CSS Textarea Styles

Code by Khashayar Pourdeilami
Demo & download click here for the code
Language used HTML, CSS, JS
External link / Dependencies Yes
Responsive No

This is an easy-to-use auto-expanding text area with angular js. No other library is required. made by Khashayar Pourdeilami using HTML, CSS, and JavaScript.

15. CSS-Only Navigation Magic

15+ CSS Textarea Styles

Code by Mohamed Moustafa
Demo & download click here for the code
Language used HTML, CSS
External link / Dependencies No
Responsive No

a hidden resizable text area by Mohamed Moustafa made with pure HTML and CSS.

16. Highlight Text Inside a Textarea

15+ CSS Textarea Styles

Code by Will Boyd
Demo & download click here for the code
Language used HTML, CSS, JS
External link / Dependencies Yes
Responsive No

This example by Will Boyd shows how to (fake) highlight text within a text area. implemented using HTML And CSS.

Conclusion

That’s it, folks. In this article, we shared 15+ CSS Textarea styles with cool and different designs. we have covered a lot in this article from simple textures with a little bit of styling to sticky notes and code editors.

Hope you like all the Textarea styles Using HTML and Css. If you like any of our projects you can simply click on our link and find complete source code, easy-to-implement.

If you like any of our projects, you can easily find the source code link in the project preview table.

See our other articles on codewithrandom and gain knowledge in Front-End Development.

Thank you and keep learning!!

Источник

Оцените статью