- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正忙于使用 angular-flex-layout 的元素。据我所知,如果将 fxLayoutWrap 属性应用于容器,则 flex 容器应换行到下一行。出于某种原因,我的 x 溢出非常小。它曾经更大,然后我删除了两个 fxLayout 行容器上的一些 fxLayoutGaps,这使它变得更好。我不知道这可能是什么原因,因为我将 fxLayoutWrap 属性应用于父(仪表板组件的第一行)行容器。知道我做错了什么吗?
向右滚动后的页面图片
和向右滚动前的图片:
我的代码:
我的主页组件的 html:
<mat-sidenav-container position="start" class="custom-sidenav-container">
<mat-sidenav #sidenav mode="side" opened="true">
Navigation
<ul class="sn-list">
<li>
<mat-icon class="sn-item">
<i class="material-icons">dashboard</i>
</mat-icon>
<a class="sn-item" href="#">Dashboard</a>
</li>
<li>
<mat-icon class="sn-item">
<i class="material-icons">archive</i>
</mat-icon>
<span class="sn-item" [matMenuTriggerFor]="stockSystemMenu">Stok System</span>
<mat-menu [overlapTrigger]="false" #stockSystemMenu="matMenu">
<button mat-menu-item>
<mat-icon class="sn-item">
<i class="material-icons">chevron_right</i>
</mat-icon>
<span class="sn-item">Service 1</span>
</button>
<button mat-menu-item>
<mat-icon class="sn-item">
<i class="material-icons">chevron_right</i>
</mat-icon>
<span class="sn-item">Service 2</span>
</button>
<button mat-menu-item>
<mat-icon class="sn-item">
<i class="material-icons">chevron_right</i>
</mat-icon>
<span class="sn-item">Service 3</span>
</button>
</mat-menu>
</li>
<li>
<mat-icon class="sn-item">
<i class="material-icons">shopping_cart</i>
</mat-icon>
<span class="sn-item" [matMenuTriggerFor]="salesMenu">Sales / Purchases</span>
<mat-menu [overlapTrigger]="false" #salesMenu="matMenu">
<button mat-menu-item>
<mat-icon class="sn-item">
<i class="material-icons">chevron_right</i>
</mat-icon>
<span class="sn-item">Service 1</span>
</button>
<button mat-menu-item>
<mat-icon class="sn-item">
<i class="material-icons">chevron_right</i>
</mat-icon>
<span class="sn-item">Service 2</span>
</button>
<button mat-menu-item>
<mat-icon class="sn-item">
<i class="material-icons">chevron_right</i>
</mat-icon>
<span class="sn-item">Service 3</span>
</button>
</mat-menu>
</li> </ul>
</mat-sidenav>
<div class="sn-content">
<!--<button mat-icon-button (click)="sidenav.toggle()">-->
<!--<mat-icon aria-label="menu">-->
<!--<i class="material-icons">restaurant_menu</i>-->
<!--</mat-icon>-->
<!--</button>-->
</div>
<mat-toolbar class="toolbar" color="primary">
<button mat-icon-button (click)="toggleSidenav()">
<mat-icon aria-label="menu">
<i class="material-icons">restaurant_menu</i>
</mat-icon>
</button>
<span>POC Toolbar</span>
<span class="fill-remaining-space"></span>
<div class="rhs">
<mat-icon class="rhs-icon fa fa-home fa-lg"></mat-icon>
<span class="rhs-item">Home</span>
<mat-icon class="rhs-icon fa fa-sign-out fa-lg" aria-hidden="true"></mat-icon>
<span class="rhs-item">Logout</span>
<mat-icon class="rhs-icon fa fa-key fa-lg"></mat-icon>
<span class="rhs-item">Password</span>
<mat-icon class="rhs-icon fa fa-sitemap fa-lg"></mat-icon>
<span class="rhs-item">Site map</span>
</div>
</mat-toolbar>
<router-outlet></router-outlet>
</mat-sidenav-container>
我的 dashboard 组件的 html(这是 home 组件中 router-outlet 的默认路由)
<div fxLayout="row" fxLayoutAlign="start start" fxLayoutWrap>
<br /><br />
<div fxFlex>
<div fxLayout="column" fxLayoutGap="20px">
<div fxFlex>
<h1>Dashboard</h1>
</div>
<div fxFlex>
<p>Lorem ipsum dolor sit amet, eum iuvaret delicata at. Eu postea commodo persius mei. Id est semper constituto, ignota aperiri adversarium ne vix. Id est impetus suscipit, nulla meliore epicuri id eos. <br /> Ad pro modo albucius atomorum. At mel ullum libris debitis, in vero apeirian mediocrem mei.</p>
</div>
<div fxFlex="80%">
<p>Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh.</p>
</div>
<div fxFlex="80%">
<h2>Sample Angular/Flex Column Layout</h2>
</div>
</div>
<div fxLayout fxLayoutGap="15px">
<div fxFlex="26%">
<h3>Notes</h3>
<ul>
<li>we're using responsive css & Angular(Angular-material & Angular/flex) This allows us to show (or hide) things like the left menu and the number of columns displayed by dataTables.</li>
<li>The amount of "Custom" css we've used is actually very little, prefering rather to make use of the framework's built in features.</li>
<li>Angular reactive forms and validators should probably replace the generic php form.</li>
<li>No server side php is used.</li>
</ul>
</div>
<div fxFlex="26%">
<h3>Example views</h3>
<ul>
<li><a href="#">Login Screen</a></li>
<li><a href="#">Home Page</a> » Ledger system » Sales ledger » Customer master files</li>
<li><a href="#">Customer Master Search</a></li>
<li><a href="#">Customer Master List</a></li>
<li><a href="#">detail Customer Master</a></li>
<li><a href="#">update Customer Master</a></li>
<li><a href="#">detail Account</a> - Click on suburb <i class="fa fa-info-circle"></i></li>
<li><a href="#">Lookup Screen(Generic)</a> - Click on suburb <i class="fa fa-search"></i></li>
</ul>
</div>
<div fxFlex="26%">
<h3>Keyboard Shortcuts</h3>
<ul>
<li><Ctrl + b: Go back/li>
<li>Ctrl + i: Launch info</li>
<li>Ctrl + h: Launch help</li>
<li>Ctrl + l: Show or hide menu</li>
<li>Ctrl + n: Add new item</li>
<li>Ctrl + p: Print</li>
<li>Ctrl + r: reload table data</li>
<li>Ctrl + <em>any other</em> page specific function you ned</li>
</ul>
</div>
</div>
<div fxLayout>
<h2>Quick Links & Favourites</h2>
</div>
<div fxLayout>
<div fxFlex="40%">
<mat-list>
<mat-list-item>
<mat-icon mat-list-icon class="fa fa-archive fa-2x"></mat-icon>
<a matLine href="#">Stock System</a>
<span matLine>Nam ultricies enim id sapien dignissim, in facilisis neque blandit, te corrumpit vituperata constituam pri.</span>
</mat-list-item>
<mat-list-item>
<mat-icon mat-list-icon class="fa fa-shopping-cart fa-2x"></mat-icon>
<a matLine href="#">Sales Purchases</a>
<span matLine>Donec cursus augue sit amet suscipit volutpat. Ne dignissim sadipscing pro. Munere scripta temporibus mel at.</span>
</mat-list-item>
<mat-list-item>
<mat-icon mat-list-icon class="fa fa-sticky-note fa-2x"></mat-icon>
<a matLine href="#">Stock Ordering</a>
<span matLine>Integer placerat libero ac dui hendrerit lacinia. Brian semper constituto, ignota aperiri adversarium ne vix.</span>
</mat-list-item>
<mat-list-item>
<mat-icon mat-list-icon class="fa fa-book fa-2x"></mat-icon>
<a matLine href="#">Ledger System</a>
<span matLine><a href="#">Ledger System</a> »
<a href="#">Sales Ledger</a>»
<a href="#">Customer Master Files</a>»
<a href="#">Customer Master</a></span>
<span matLine>Purus scelerisque, dapibus felis sit amet, accumsan est.</span>
</mat-list-item>
<mat-list-item>
<mat-icon mat-list-icon class="fa fa-money fa-2x"></mat-icon>
<a matLine href="#">POS Control</a>
<span matLine>Pellentesque id purus scelerisque, dapibus felis sit amet, accumsan est. Diceret dissentiunt ad sea, te corrumpit vituperata constituam pri.</span>
</mat-list-item>
<mat-list-item>
<mat-icon mat-list-icon class="fa fa-tablet fa-2x"></mat-icon>
<a matLine href="#">PDCU Control</a>
<span matLine>In vestibulum dui sed dapibus accumsan. Id est semper constituto, ignota aperiri adversarium ne vix.</span>
</mat-list-item>
</mat-list>
</div>
<div fxFlex="40%">
<mat-list>
<mat-list-item>
<mat-icon mat-list-icon class="fa fa-line-chart fa-2x"></mat-icon>
<a matLine href="#">Price Change System</a>
<span matLine>Integer placerat libero ac dui hendrerit lacinia. Brian semper constituto, ignota aperiri adversarium ne vix.</span>
</mat-list-item>
<mat-list-item>
<mat-icon mat-list-icon class="fa fa-building fa-2x"></mat-icon>
<a matLine href="#">HO Coms</a>
<span matLine>Donec cursus augue sit amet suscipit volutpat. Ne dignissim sadipscing pro. Munere scripta temporibus mel at.</span>
</mat-list-item>
<mat-list-item>
<mat-icon mat-list-icon class="fa fa-plane fa-2x"></mat-icon>
<a matLine href="#">Auto Pilots</a>
<span matLine>Fusce eget velit tincidunt erat sollicitudin eleifend in in odio. Integer placerat libero ac dui hendrerit lacinia.</span>
</mat-list-item>
<mat-list-item>
<mat-icon mat-list-icon class="fa fa-hashtag fa-2x"></mat-icon>
<a matLine href="#">Additional</a>
<span matLine>Fusce eget velit tincidunt erat sollicitudin eleifend in in odio. In vestibulum dui sed dapibus accumsan.</span>
</mat-list-item>
<mat-list-item>
<mat-icon mat-list-icon class="fa fa-desktop fa-2x"></mat-icon>
<a matLine href="#">Workspaces</a>
<span matLine>matLinePellentesque id <a href="#">Customer Master</a> purus scelerisque, dapibus felis sit amet, accumsan est.</span>
</mat-list-item>
<mat-list-item>
<mat-icon mat-list-icon class="fa fa-cogs fa-2x"></mat-icon>
<a matLine href="#">System Config</a>
<span matLine>Pellentesque id purus scelerisque, dapibus felis sit amet, accumsan est. Diceret dissentiunt ad sea, te corrumpit vituperata constituam pri.</span>
</mat-list-item>
</mat-list>
</div>
</div>
<div fxLayout>
<div fxFlex="80%">
<hr>
<p>Numquam honestatis neglegentur ex duo, ad vix movet tollit tantas. Cu quaeque labores debitis vis, dicta eruditi eligendi ex vim. Est mentitum
voluptaria te. Decore aperiri explicari cu usu, suas saepe accumsan ea usu. In vim modo accusata, ad audire delenit prodesset usu.</p>
<hr>
</div>
</div>
<div fxLayout fxLayoutGap="20px">
<div fxFlex="26%" class="centered">
<h2>Heading</h2>
<p>
Donec sed odio dui. Etiam porta sem malesuada magna mollis euismod. Nullam id dolor id nibh ultricies vehicula ut id elit. Morbi leo risus,
porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna.
</p>
<p><button mat-raised-button><a href="#">View Details</a></button></p>
</div>
<div fxFlex="26%" class="centered">
<h2>Heading</h2>
<p>
Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum.
Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh.
</p>
<p><button mat-raised-button><a href="#">View Details</a></button></p>
</div>
<div fxFlex="26%" class="centered">
<h2>Heading</h2>
<p>
tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.
</p>
<p><button mat-raised-button><a href="#">View Details</a></button></p>
</div>
</div>
<div fxLayout fxLayoutGap="20px">
<div fxFlex="26%" class="centered">
<h2>Heading</h2>
<p>
Donec sed odio dui. Etiam porta sem malesuada magna mollis euismod. Nullam id dolor id nibh ultricies vehicula ut id elit. Morbi leo risus,
porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna.
</p>
<p><button mat-raised-button><a href="#">View Details</a></button></p>
</div>
<div fxFlex="26%" class="centered">
<h2>Heading</h2>
<p>
Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum.
Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh.
</p>
<p><button mat-raised-button><a href="#">View Details</a></button></p>
</div>
<div fxFlex="26%" class="centered">
<h2>Heading</h2>
<p>
tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.
</p>
<p><button mat-raised-button><a href="#">View Details</a></button></p>
</div>
</div>
<div fxLayout>
<div fxFlex class="centered">
<p>Copyright Trade Link © 2017</p>
</div>
</div>
</div>
</div>
我的样式.css:
@import '~@angular/material/prebuilt-themes/deeppurple-amber.css';
body {
font-family: 'Roboto', sans-serif;
max-width: 100%;
x-overflow: hidden;
max-width: 90%;
}
my home component's css:
.fill-remaining-space {
flex: auto;
}
.rhs {
display: flex;
align-items: center;
justify-content: center;
}
.rhs-item {
margin-right: 20px;
}
.rhs-icon {
margin-right: 5px;
display: inline-flex;
vertical-align: middle;
}
/*.custom-sidenav-container {
position: inherit;
display: inherit;
transform: inherit;
}*/
mat-sidenav {
// width: 300px;
margin-top: 65px;
border: 1px solid rgba(0, 0, 0, 0.5);
position: fixed;
left: 0;
}
.sn-list {
list-style: none;
}
.sn-list li {
cursor: pointer;
margin-bottom: 10%;
}
.sn-item {
display: inline-flex;
vertical-align: middle;
}
.toolbar {
position: fixed;
left: 0;
top: 0;
right: 0;
}
我的仪表板组件的 css:
.centered {
text-align: center;
}
最佳答案
没有 x-overflow
这样的 CSS 属性,您可能需要 overflow-x
来代替。
https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-x
您需要将其设置为“隐藏”以禁用滚动。你应该寻找比它应该更宽的元素(导致滚动的元素)。在它的父级上,你应该有 overflow-x: hidden,或者你应该阻止那个元素变宽。
关于css - 无法摆脱 x-overflow(滚动条被隐藏,但我仍然可以向右滚动),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46808728/
我通过 spring ioc 编写了一些 Rest 应用程序。但我无法解决这个问题。这是我的异常(exception): org.springframework.beans.factory.BeanC
我对 TestNG、Spring 框架等完全陌生,我正在尝试使用注释 @Value通过 @Configuration 访问配置文件注释。 我在这里想要实现的目标是让控制台从配置文件中写出“hi”,通过
为此工作了几个小时。我完全被难住了。 这是 CS113 的实验室。 如果用户在程序(二进制计算器)结束时选择继续,我们需要使用 goto 语句来到达程序的顶部。 但是,我们还需要释放所有分配的内存。
我正在尝试使用 ffmpeg 库构建一个小的 C 程序。但是我什至无法使用 avformat_open_input() 打开音频文件设置检查错误代码的函数后,我得到以下输出: Error code:
使用 Spring Initializer 创建一个简单的 Spring boot。我只在可用选项下选择 DevTools。 创建项目后,无需对其进行任何更改,即可正常运行程序。 现在,当我尝试在项目
所以我只是在 Mac OS X 中通过 brew 安装了 qt。但是它无法链接它。当我尝试运行 brew link qt 或 brew link --overwrite qt 我得到以下信息: ton
我在提交和 pull 时遇到了问题:在提交的 IDE 中,我看到: warning not all local changes may be shown due to an error: unable
我跑 man gcc | grep "-L" 我明白了 Usage: grep [OPTION]... PATTERN [FILE]... Try `grep --help' for more inf
我有一段代码,旨在接收任何 URL 并将其从网络上撕下来。到目前为止,它运行良好,直到有人给了它这个 URL: http://www.aspensurgical.com/static/images/a
在过去的 5 个小时里,我一直在尝试在我的服务器上设置 WireGuard,但在完成所有设置后,我无法 ping IP 或解析域。 下面是服务器配置 [Interface] Address = 10.
我正在尝试在 GitLab 中 fork 我的一个私有(private)项目,但是当我按下 fork 按钮时,我会收到以下信息: No available namespaces to fork the
我这里遇到了一些问题。我是 node.js 和 Rest API 的新手,但我正在尝试自学。我制作了 REST API,使用 MongoDB 与我的数据库进行通信,我使用 Postman 来测试我的路
下面的代码在控制台中给出以下消息: Uncaught DOMException: Failed to execute 'appendChild' on 'Node': The new child el
我正在尝试调用一个新端点来显示数据,我意识到在上一组有效的数据中,它在数据周围用一对额外的“[]”括号进行控制台,我认为这就是问题是,而新端点不会以我使用数据的方式产生它! 这是 NgFor 失败的原
我正在尝试将我的 Symfony2 应用程序部署到我的 Azure Web 应用程序,但遇到了一些麻烦。 推送到远程时,我在终端中收到以下消息 remote: Updating branch 'mas
Minikube已启动并正在运行,没有任何错误,但是我无法 curl IP。我在这里遵循:https://docs.traefik.io/user-guide/kubernetes/,似乎没有提到关闭
每当我尝试docker组成任何项目时,都会出现以下错误。 我尝试过有和没有sudo 我在这台机器上只有这个问题。我可以在Mac和Amazon WorkSpace上运行相同的容器。 (myslabs)
我正在尝试 pip install stanza 并收到此消息: ERROR: No matching distribution found for torch>=1.3.0 (from stanza
DNS 解析看起来不错,但我无法 ping 我的服务。可能是什么原因? 来自集群中的另一个 Pod: $ ping backend PING backend.default.svc.cluster.l
我正在使用Hibernate 4 + Spring MVC 4当我开始 Apache Tomcat Server 8我收到此错误: Error creating bean with name 'wel
我是一名优秀的程序员,十分优秀!