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

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -