Solved

CSS text when off-focus

Posted on 2014-04-21
3
486 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
Comment Utility
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
Comment Utility
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
Comment Utility
That Works excellent!

Thank you so much
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

763 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

Need Help in Real-Time?

Connect with top rated Experts

5 Experts available now in Live!

Get 1:1 Help Now