Solved

CSS text when off-focus

Posted on 2014-04-21
3
495 Views
Last Modified: 2014-04-30
Hello,

Please take a look at this link:

https://id.avast.com/login?target=https%3A%2F%2Fmy.avast.com%3A443%2F

Notice the legends "Email Address" and "Password" on the textfields. Then the textfields get focus, the legend dissapears.

I asume this is CSS? If so, how can I do that, for an email address and password?

Thanks!
0
Comment
Question by:SimpleDude
3 Comments
 
LVL 15

Expert Comment

by:Ess Kay
ID: 40013454
This is for links

a:link {color:#FF0000;}      /* unvisited link */
a:visited {color:#00FF00;}  /* visited link */
a:hover {color:#FF00FF;}  /* mouse over link */
a:active {color:#0000FF;}  /* selected link */

Open in new window



Something similar should work for textbox
specifically the focus command

http://www.w3schools.com/cssref/sel_focus.asp

input:focus
{ 
background-color:yellow;
}

Open in new window

0
 
LVL 35

Accepted Solution

by:
Miguel Oz earned 500 total points
ID: 40013614
This is not CSS, it is the HTML5 placeholder attribute being displayed in the inputs. In your sample site, the first textbox contains "Email address" as shown below:
<input name="username" placeholder="Email address"/>

Open in new window


If you need the same behaviour use  placeholder attribute  in your inputs. For more info check:
http://www.w3schools.com/Tags/att_input_placeholder.asp
0
 

Author Closing Comment

by:SimpleDude
ID: 40033088
That Works excellent!

Thank you so much
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…

832 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