请问vue写样式跟html有什么不一样吗

你好,我现在想在vue一个页面中做一个居中显示的展示框,这个div里面是ul列表,比如div的class叫做user,请问我要怎么写呢,这个页面的左边还有一个共通组件,我要把共通组件那部分减掉之后,在剩下的这部分页面居中,实在写不出来,有朋友能帮忙演示一下吗?多谢了

Vue是JS文件,他使你写前端代码更加简单

页面的样式直接写就行了

<template>
<div>
    <div class="user">
      <ul></ul>
  </div>
</div>
</template>

<script>
new vue.extend({
    data(){
        return {}
    },
    methods:{}
})
</script>

<style>
.user{
    .....
}
</style>

vue的 话 可以直接写 style样式 或者 引入 .css、scss文件都行 。

style 标签加上 scoped 就是 样式只在 当前组件生效 。不会 污染 其它组件
https://blog.csdn.net/weixin_44869002/article/details/105735995

<style scoped>

</style>