[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

CSS TextArea Formatting Using Input

Posted on 2011-09-28
3
Medium Priority
?
607 Views
Last Modified: 2012-06-27
I'm using the following CSS to round the corners on my text boxes over the whole site.

input { border:1px solid; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; }

This works great on most browsers, but it doesn't effect the textarea boxes.  Is there a way to modify the formatting for the textarea boxes without having to edit each individual entry?

In other words, is there a way to modify the input commmand above to globally format the textarea as well as the text boxes?

Thanks!
0
Comment
Question by:digitility
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 30

Accepted Solution

by:
LZ1 earned 2000 total points
ID: 36718580
You can just use textarea instead of input.

Input and textarea are 2 separate tags in HTML. So in CSS, you would have to treat them as 2 separate elements:

input, textarea { border:1px solid; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; }

Open in new window

0
 
LVL 8

Expert Comment

by:Jesse Matlock
ID: 36719389
+1 for LZ1's response.. textareas are inputs, but they are NOT styled using 'input'.. they are targeted using 'textarea' :) Alternatively, you can add a class or an ID to a specific textarea, if you only want to target specific textareas.. and then style that class or ID.. eg.:

input {border:1px solid;}
.rounded {border:1px solid; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px;}

Open in new window


<input type="text" name="" class="rounded" value="" /> <!-- this input WILL have rounded corners -->

<input type="text" name="" class="" value="" /> <!-- this input WILL NOT have rounded corners -->

<textarea name="" rows="8" cols="40" class="rounded"></textarea><!-- this textarea WILL have rounded corners --> 

<textarea name="" rows="8" cols="40" class=""></textarea><!-- this textarea WILL NOT have rounded corners -->

Open in new window


When you create CSS styles like this, they become very easy to re-use and allow you to re-use CSS code across projects .. like a toolkit :)
0
 

Author Closing Comment

by:digitility
ID: 36932261
Awesome, works great. Thanks.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Find out what you should include to make the best professional email signature for your organization.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question