css - How to properly use label when putting design with only placeholder online -


i'm working in web agency, , had small question , not find answer. designer gave me psd file form without labels in form, placeholders. last time had this, went straight forward html5 placeholder attributes (with javascript fallback old browser). however, read lot , realized people saying must have label in form accessibility. therefore, wondering best way have both : accessibility of label , placeholder without having label ''minimal'' design designer gave me. should put them in visibility hidden screen readers absolute positioning or ? here's picture example of have (just understand context). it's in french, i'm sure still can understand mean!

you can see example of enter image description here

building on steveax's comment , link, there couple ways implemented. since there no interactivity in label itself,

label {   height: 1px;   text-indent: -1000px;   overflow: hidden; } 

another option more comprehensive hiding technique webaim mentions, namely

.hidden {   position:absolute;   left:-10000px;   top:auto;   width:1px;   height:1px;   overflow:hidden; } 

here example of each on text input.

if possible though, recommend trying design tweaked include labels visually well. number of sources cite negative effects of using placeholder text exclusively.


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -