Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8436117
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:06:07+00:00 2026-06-10T07:06:07+00:00

I have two problems with a form I am making, the first is the

  • 0

I have two problems with a form I am making, the first is the I want to throw some css onto a form. This works with my <textarea> box, as it has a closing tag and you can put the text in between. The <input> tags on the other hand have to get text trough the value="" tag, which doesn’t respond to any of my CSS tries.

Secondly, I was wondering if it is possible to make the box clear itsself once it is clicked. (not sure if HTML forms support that)

Here is a link to the form with the css, so you can see the problem. http://jsfiddle.net/D39rr/5/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T07:06:09+00:00Added an answer on June 10, 2026 at 7:06 am

    You’re looking for the placeholder attribute:

    <input placeholder="Your email address" />
    

    JS Fiddle demo.

    To style the placeholder text (in compliant browsers):

    ::-webkit-input-placeholder,
    ::-moz-input-placeholder,
    ::-o-input-placeholder,
    ::-ms-input-placeholder,
    ::input-placeholder {
        color: #0f0;
        font-weight: bold;
    }
    

    JS Fiddle demo.

    To style the text, whether it’s from the value attribute or user-entered, simply use the usual color, font-style, font-weight, etc:

    input {
        color: #f00;
        font-size: 1.5em;
        font-style: italic;
        font-weight: bold;
    }​
    

    JS Fiddle demo.

    Incidentally, the textarea, as you correctly note, ‘has a closing tag.’ Therefore it’s not a self-closing (or void) element, and should not have a / character in its opening tag (as you do in your linked JS Fiddle: <textarea id="style" name="message" />Type out your question here</textarea>), instead it should be, simply:

    <textarea id="style" name="message">Type out your question here</textarea>
    

    Or, with the placeholder:

    <textarea id="style" name="message" placeholder="Type out your question here"></textarea>
    

    It’s worth noting, also, that using the placeholder to replace a label means that any guidance offered is explicitly hidden once the user has focused, or entered data into, the field. If you don’t want the label elements visible all the time, then one way to show the guidance only while the input is focused is:

    label {
        display: inline;
        opacity: 0;
        overflow: hidden;
        -webkit-transition: all 1s linear;
        -moz-transition: all 1s linear;
        -o-transition: all 1s linear;
        -ms-transition: all 1s linear;
        transition: all 1s linear;
    }
    
    input:focus + label,
    input:active + label {
        opacity: 1;
        -webkit-transition: all 1s linear;
        -moz-transition: all 1s linear;
        -o-transition: all 1s linear;
        -ms-transition: all 1s linear;
        transition: all 1s linear;
    }​
    

    Which triggers the reveal once the input is focused/active: JS Fiddle demo.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two cmake-related problems: first, I can't make it to find the includes
I have some localization problems in my webpage. There are basically two problems (that
We are having some problems deploying our WCF services into IIS7. We have two
I'm having some problems trying to perform a query. I have two tables, one
I Have two problem in this Case : I want to pass a JSON
I have two strange problems when I use routing in a web form application.
I have two problems. problem one: I am trying to create a registeration form
Hy, I have a problem in a nested form. Actually, I have two problems,
I am making an HTML form in JavaScript and it works, but the two
I have a Form in my application that displays some data. When I first

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.