?
Solved

CSS text when off-focus

Posted on 2014-04-21
3
Medium Priority
?
532 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
[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 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 36

Accepted Solution

by:
Miguel Oz earned 2000 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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 different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
Suggested Courses

765 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