我正在使用Vue.js和Vuetify(https://vuetifyjs.com/en/)构建Web应用程序。 我有一个简单的布局,有3列。但是,我希望3列填充页面的整个宽度,但是有一块CSS自动将max-width强制为960px。这是为什么?如何使用整个屏幕?您也可以在此处进行检查:https://codepen.io/mlikoga/pen/KeLNvy
<div id="app">
<v-app>
<v-content>
<v-container ma-0 pa-0 fill-height>
<v-layout row>
<v-flex xs4> Chat List </v-flex>
<v-flex xs4> Main Chat</v-flex>
<v-flex xs4> User Profile</v-flex>
</v-layout>
</v-container>
</v-content>
</v-app>
</div>
自动CSS:
@media only screen and (min-width: 960px)
.container {
max-width: 960px;
}
答案 0 :(得分:11)
容器的概念在网站布局中非常普遍。默认情况下,Vuetify使用“固定”容器。 “流体”容器将填充视口。
您可以在Vuetify容器b = type(a)()
上将fluid
道具设置为true
:
<v-container>
以下是有关固定容器与流体容器的一些有用信息:https://www.smashingmagazine.com/2009/06/fixed-vs-fluid-vs-elastic-layout-whats-the-right-one-for-you/
其他Vuetify网格信息可以在这里找到: https://vuetifyjs.com/en/layout/grid
答案 1 :(得分:0)
超级简单答案:与上面的答案类似,但宽度为100%;因为我的工作离不开它。您可能有相同的问题。可能是因为我使用了样式标签而不是它们的类属性。有一点要注意。
<template>
<v-container fluid style="margin: 0px; padding: 0px; width: 100%">
<v-layout wrap>
<div class="container">
Content you want in a container as this takes on the container class.
</div>
<div>
Content you don't want contained as it takes on the fluid 100% width.
</div>
</v-layout>
</v-container>
</template>
基本上,您将整个v容器的宽度设置为100%,以允许任何元素扩展页面的整个宽度。
您想要包含的元素包含在具有容器类的div中。