css ?
- Started
- Last post
- 7 Responses
- flyingnowhere
i want to set the display of the label from within the inputs focus
any way to achieve this within css?
<style>
*{
font-family: verdana;
font-size: 11px;
}
label{
background: red;
padding: 3px 6px;
color: white;
display: none;
}
input:focus{}
</style><input type="text"> <label>< Required</label>
- keiTai0
take a look into jquery,
better yet check this:
http://nettuts.com/tutorials/jav…
- 7point340
you mean change how the text field looks when you change focus to it?
you probably need to get a little bit of javascript involved.
i have never personally used the :focus pseudo class
- if you're changing something outside the input field then you definitely need javascript7point34
- no i mean display the label, when the input is focused onflyingnowhere
- studderine0
dis hard!
- 7point340
you would need a javascript function that triggers on the focus of that element which then sets the display of the label to block (or inline)
- 7point340
or you can try
input:focus label {display: inline;}
no idea though
- flyingnowhere0
awesome, thanks
and damn, do i hate IE
- works perfectly in firefox... no idea about safari7point34
- doesnt workflyingnowhere