screen_rotation
Copied to Clipboard
<!DOCTYPE html> <html> <head> <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script> </head> <body> <div id="app"> <h3>Vue Checkbox show hide div</h3> <div class="checkbox-component"> <input type="checkbox" id="show-div-checkbox" v-model="isChecked"> <label for="show-div-checkbox">{{isChecked?'Hide Div':'Show Div'}}</label> </div> <div v-if="isChecked"> <p>Fontawesomeicons.com</p> </div> </div> <script type="module"> const app = Vue.createApp({ data() { return { isChecked: false, }; }, }); app.mount('#app'); </script> <style> #app { max-width: 800px; margin: 0 auto; font-family: Arial, sans-serif; font-size: 16px; line-height: 1.5; color: #333; background-color: #f7f7f7; } .checkbox-component { display: flex; align-items: center; gap: 10px; margin: 0 auto; } .checkbox-component label { cursor: pointer; } .checkbox-component div { margin-top: 10px; } .checkbox-component p { font-size: 14px; color: #333; } </style> </body> </html>