Using :focus to style outer div?

后端 未结 10 743
礼貌的吻别
礼貌的吻别 2020-12-02 18:24

When I begin writing text in the textarea, I want the outer div, with a class box, to have it\'s border turned solid instead of dashed, but somehow the :focus doesn\'t apply

10条回答
  •  悲&欢浪女
    2020-12-02 18:38

    You can tab between div tags. Just add a tab index to the div. It's best to use jQuery and CSS classes to solve this problem. Here's a working sample tested in IE, Firefox, and Chrome (Latest versions... didn't test older).

    
        
            
            
            
        
        
            

    Div 1






    Div 2






    Div 3






    Div 4






提交回复
热议问题