首页 > 其他分享 >041 Time to Practice Dynamic Styling - Problem

041 Time to Practice Dynamic Styling - Problem

时间:2024-08-22 20:29:20浏览次数:11  
标签:box color margin Practice Dynamic Styling background white border

示例

index.html

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Vue Basics</title>
    <link
      href="https://fonts.googleapis.com/css2?family=Jost:wght@400;700&display=swap"
      rel="stylesheet"
    />
    <link rel="stylesheet" href="styles.css" />
    <script src="https://unpkg.com/vue@3/dist/vue.global.js" defer></script>
    <script src="app.js" defer></script>
  </head>
  <body>
    <header>
      <h1>Vue Styling</h1>
    </header>
    <section id="styling">
      <input type="text">
      <p>Style Me!</p>
      <button>Toggle Paragraph</button>
      <input type="text">
      <p>Style Me Inline!</p>
    </section>
  </body>
</html>

app.js

const app = Vue.createApp({
    data(){
        return {
            
        };
    },
    computed: {
        
    },
    methods:{
        
    }
});

app.mount('#styling');

styles.css

* {
  box-sizing: border-box;
}

html {
  font-family: 'Jost', sans-serif;
}

body {
  margin: 0;
}

header {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.26);
  margin: 3rem;
  border-radius: 10px;
  padding: 1rem;
  background-color: #4fc08d;
  color: white;
  text-align: center;
}

#styling {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.26);
  margin: 3rem;
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
}

#styling p {
  font-size: 1.25rem;
  font-weight: bold;
  border: 1px solid #4fc08d;
  background-color: #4fc08d;
  color: white;
  padding: 0.5rem;
  border-radius: 25px;
}

#styling button {
  font: inherit;
  cursor: pointer;
  border: 1px solid #ff0077;
  background-color: #ff0077;
  color: white;
  padding: 0.05rem 1rem;
  box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.26);
  border-radius: 20px;
  margin: 0 1rem;
}

.user1 {
  background-color: blue;
  color: white;
}

.user2 {
  background-color: purple;
  color: white;
}

.hidden {
  display: none;
}

.visible {
  display: block;
}

.demo {
  width: calc(100% - 32px);
  height: 100px;
  margin: 16px;
  border: 2px dashed #ccc;
}

.active {
  border-color: red;
  background-color: salmon;
}

标签:box,color,margin,Practice,Dynamic,Styling,background,white,border
From: https://blog.csdn.net/KevinHuang2088/article/details/141437213

相关文章

  • 040 Dynamic Classes Array Syntax
    示例index.html:class="['demo',{active:boxBSelected}]"<!DOCTYPEhtml><htmllang="en"><head><metacharset="UTF-8"/><metaname="viewport"content="width=device......
  • SPONGE进阶教程:MetaDynamics的简单用例
    前序课程1前序课程2场景简述蛋白与配体对接后,采用通常的分子动力学模拟,通常会采样得到势阱附近的大量结构(如下图左L-P),即蛋白-配体结合构象的平均系综。如果想要探究蛋白-配体解离过程,需要克服一个解离能垒,去到L-P*,甚至更远的L+P解离状态。这时候静候模拟体系自然地运动过去是不......
  • [Web Component] using `part` to allow applying styling from outside the shadow D
    Let'ssaywehaveawebcomponent: import{getProductById}from"../services/Menu.js";import{addToCart}from"../services/Order.js";exportdefaultclassDetailsPageextendsHTMLElement{constructor(){super();......
  • 错误 1 error LNK2038: 检测到“RuntimeLibrary”的不匹配项: 值“MTd_StaticDebug”
    前言全局说明VisualStudio2013jsoncpp0.10.7库编译LNK2038一、说明环境:Windows7旗舰版VisualStudio2013二、错误内容错误1errorLNK2038:检测到“RuntimeLibrary”的不匹配项:值“MTd_StaticDebug”不匹配值“MDd_DynamicDebug”(mfc_mqtt-client-po......
  • day46-dynamic programming-part13-8.17
    tasksfortoday:1.647.回文子串2.516.最长回文子序列--------------------------------------------------------------------1.647.回文子串Inthispractice,itisimportanttofigureouttheessencetodecideifastringatargetone,thestring[i,j]is......
  • FINC3600 Finance in Practice S2 2024
    FINC3600 Financein PracticeS2 2024Project 1:Corporate Finance BriefProject LearningObjectivesBycompletingthisassignment,you will:Learn to apply corporate finance concepts and techniques from past finance courses in a realisti......
  • yolov5s ncnn practice
     Tutorial-deployYOLOv5withncnnhttps://github.com/Tencent/ncnn/discussions/4541 ncnnmodel制作(yolov5s.pt->ncnn.paramandncnn.bin) 使用ncnn库编译后生成的工具https://github.com/Tencent/ncnn/wiki/use-ncnn-with-pytorch-or-onnxhttps://ncnn.readt......
  • SOMEIP_ETS_042: echoUTF16DYNAMIC_length_too_short_for_String
    测试目的:验证设备(DUT)能否正确拒绝一个长度小于实际字符串长度的echoUTF16DYNAMIC字符串。描述本测试用例旨在检查当发送的SOME/IP消息中的echoUTF16DYNAMIC字符串长度小于实际字符串长度时,DUT是否能够返回格式错误(MALFORMED_MESSAGE)的错误消息。测试拓扑:具体步骤:TEST......
  • day43-dynamic programming-part10-8.14
    tasksfortoday:1.300.最长递增子序列2.674.最长连续递增序列3.718.最长重复子数组--------------------------------------------------------------------------1.300.最长递增子序列Inthispractice,notethemeaningofthedplist:whichis:dp[i]signifi......
  • day44-dynamic programming-part11-8.15
    tasksfortoday:1.1143.最长公共子序列2.1035.不相交的线3.53.最大子序和4.392.判断子序列(编辑距离问题)------------------------------------------------------------------------------1.1143.最长公共子序列300:single,ascending,non-continuity674:s......