javascript - How to make a div as selected in HTML? -
javascript - How to make a div as selected in HTML? -
i have tried create div selected , not hover.
i need alter outline color when div selected. have tried same hover. need help in selector. possible via javascript or css 3 enough?
here tried:
class="snippet-code-css lang-css prettyprint-override">div { background: #ccc; margin: 20px; } div:hover { outline: 1px solid blue; } class="snippet-code-html lang-html prettyprint-override"><div>1</div> <div>2</div> <div>3</div>
you can seek :focus pseudo-class. note need tabindex create divs focusable.
class="snippet-code-css lang-css prettyprint-override">div { background: #ccc; margin: 20px; } div:focus { outline: 1px solid blue; } class="snippet-code-html lang-html prettyprint-override"><div tabindex="-1">1</div> <div tabindex="-1">2</div> <div tabindex="-1">3</div>
javascript html css html5 css3
Comments
Post a Comment