div我的應用程式中有一個元素。我想給它添加背景。背景應由小方塊組成。因為我想在它上面畫一些形狀。我無法遵循確切需要做什么才能在后臺獲取這些網格。有人可以幫忙嗎?
我希望里面的整個div部分HTML page看起來像這樣:
它應該是這樣的:

<template>
<div class="container-fluid">
<div class="row">
<div class="col-sm-12">
<v-stage ref="stage" class="stage">
<v-layer ref="layer"> </v-layer>
</v-stage>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {};
},
};
</script>
<style scoped>
.stage {
background-color: red;
}
</style>
uj5u.com熱心網友回復:
背景可以做到:
html {
min-height: 100%;
background-image:
conic-gradient(at calc(100% - 2px) calc(100% - 2px),#366 270deg, #0000 0),
conic-gradient(at calc(100% - 1px) calc(100% - 1px),#a9a9a9 270deg, #0000 0);
background-size: 100px 100px, 20px 20px; /* adjust the size like you want */
}
uj5u.com熱心網友回復:
我正在為我實作這個,KonvaJS Stage如果將來有人需要它,以下是完整的代碼示例:
<template>
<div class="row root">
<div class="col-sm-12 body">
<v-stage
ref="stage"
class="stage"
>
<v-layer ref="layer">
</v-layer>
</v-stage>
</div>
</div>
</template>
<style scoped>
.root {
--bg-color: #fff;
--line-color-1: #D5D8DC;
--line-color-2: #a9a9a9;
}
.body {
height: 100vh;
margin: 0;
}
.stage {
height: 100%;
background-color: var(--bg-color);
background-image:
conic-gradient(at calc(100% - 2px) calc(100% - 2px),var(--line-color-1) 270deg, #0000 0),
conic-gradient(at calc(100% - 1px) calc(100% - 1px),var(--line-color-2) 270deg, #0000 0);
background-size: 100px 100px, 20px 20px;
}
</style>
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/348961.html
標籤:html css 推特引导 Vue.js bootstrap-4
上一篇:內嵌標題和文本的字體真棒圖示
