overflow

H5实现横向滚动的方法总结

自作多情 提交于 2019-11-30 16:05:03
小程序中有横向滚动的swiper,H5中目前得手动实现。 实现方法如下: 外层需要设置: overflow: scroll;white-space: nowrap; 内层需要设置: display: inline-block; <div class="noticeListBox"> <div class="noticeList" v-for="(item,index) in 10"> </div> </div> .noticeListBox { width: 100%; box-sizing: border-box; overflow: scroll; white-space: nowrap; } .noticeListBox::-webkit-scrollbar { display: none; } .noticeList{ display: inline-block; } 来源: https://www.cnblogs.com/teamemory/p/11603123.html

Hide overflow on elements with fixed position

左心房为你撑大大i 提交于 2019-11-30 14:01:52
问题 Is there any way to hide the overflow of a fixed div with a container? I thought fixed inside fixed would do it, but it seems it's not the case. The only workaround I can think of is "inverted" masks: other fixed divs hiding everything around the one, but it'd be better if there are any other solutions. Here's the fiddle: http://jsfiddle.net/pjFa6/1/ 回答1: Unfortunately it seems to be impossible to nest a fixed element within another element (fixed or not) and expect the outer element to wrap

【css】 样式

随声附和 提交于 2019-11-30 13:36:39
1、背景颜色渐变情况 background: linear-gradient(to left,#FA4DBE 0,#FBAA58 100%); border-bottom-color: transparent; padding: 8px 10px 2、滚动条的出现 .nav_lf{ width:0.8rem; background:#F4F4F4; height:100%; overflow: hidden; overflow-y: auto; position: fixed; left: 0; top: 0; z-index:0; } 来源: https://www.cnblogs.com/yuanjili666/p/11594831.html

BFC

拜拜、爱过 提交于 2019-11-30 12:38:32
什么是BFC 在一个web页面的CSS渲染中,块级格式化上下文 (Block Fromatting Context)是按照块级盒子布局的。W3C对BFC的定义如下: 浮动元素和绝对定位元素,非块级盒子的块级容器(例如 inline-blocks,table-cells,和table-captions),以及overflow值不为“visiable”的块级盒子,都会为他们的内容创建BFC(块级上下文)。 为了便于理解,我们换一种方式来重新定义BFC。一个HTML元素要创建BFC,则满足下列的任意一个或多个条件即可: 1. float的值不是none。 2.position的值不是static或者relative。 3.display的值是inline-block、table-cell、flex、table-caption或者inline-flex 4.overflow的值不是visible BFC是一个独立的布局环境,其中的元素布局是不受外界的影响,并且在一个BFC中,块盒与行盒(行盒由一行中所有的内联元素所组成)都会垂直的沿着其父元素的边框排列。 怎么创建BFC 要显式的创建一个BFC是非常简单的,只要满足上述4个CSS条件之一就行。例如: <div class="container"> 你的内容 </div> 在类container中添加类似 overflow: scroll

CSS总结(三)

时间秒杀一切 提交于 2019-11-30 12:31:46
盒子大小计算 影响盒子大小的因素: 边框会影响盒子的大小 , padding 也会影响盒子大小 计算盒子的大小: 盒子的真实宽度 = width + 左右的border + 左右的padding 盒子的真实高度 = height + 上下的border + 上下的padding 内外边距初始化 * { margin: 0; /*外边距初始化*/ padding: 0; /*内边距初始化*/ } 盒子水平居中 /*水平居中:*/ /*margin: 0 auto;*/ CSS布局 css中的三种布局机制: 页面布局的本质:布局页面其实就是摆放盒子的过程 就是用来在页面布局的时候用来摆放盒子(怎么去摆放盒子) 1.标准流(普通流/文档流) 遵循HTML的标准文档规范,在页面显示的时候 从上到下、从左到右的这种方式称为标准流 2.浮动 3.定位 浮动 浮动的最初目的: 实现文字环绕图片的效果 浮动现在的目的:帮助我们实现页面的快速布局 img { /*float: left;*/ float: right; } 浮动的特点: 1.脱标(脱离标准流),不占原来的位置 2.浮动能改变元素的显示方式(针对行内元素) 3.浮动的元素以顶部对齐 4.如果元素有包含关系,子元素浮动不会占据父元素的padding和border的位置 5.如果多个块级元素,前面不浮动,后面浮动

Issue with scrolling in iOS 5 using -webkit-overflow-scrolling

大城市里の小女人 提交于 2019-11-30 11:59:16
问题 I have an HTML page with a fixed-height div which should be scrollable (only vertically). In iOS 5 this can be achieved using: overflow-y: auto; -webkit-overflow-scrolling: touch; The div contains an unordered list with about 10 items. The scrolling works, but sometimes it scrolls only if I swipe my finger diagonally or even horizontally and not vertically as it should be. I'm wondering if anyone has encountered this issue. I don't want to think that it is a bug in iOS5, but I can't figure

How to place two divs side by side where one sized to fit and other takes up remaining space?

浪子不回头ぞ 提交于 2019-11-30 11:58:55
This should be easy... why is this not easy? I am looking to have 2 divs side by side, where one div will auto size to the content inside and the second div will simply fill the remaining width. I need the text in the 'remaining width' div to be truncated if it is too large though, as I can only have these divs occupy one line. I have been searching all day and the closest I found was this post which suggested using tables that STILL didn't fix the issue. Here is the jsfiddle code that reproduces my issue: http://jsfiddle.net/ssawchenko/gMxWc/ I am hoping that one of you stack-peeps can help

Body set to overflow-y:hidden but page is still scrollable in Chrome

流过昼夜 提交于 2019-11-30 10:57:27
I'm having an issue with the overflow-y property in Chrome. Even though I've set it to hidden , I can still scroll the page with the mouse wheel. Here is my code: html, body { overflow-y: hidden; } #content { position: absolute; width: 100%; } .step { position: relative; height: 500px; margin-bottom: 500px; } <body> <div id="content"> <div class="step">this is the 1st step</div> <div class="step">this is the 2nd step</div> <div class="step">this is the 3rd step</div> </div> </body> Does anybody know how to block the vertical scrolling in Chrome? Thanks! Setting a height on your body and html

jQuery: How to get content not visible with overflow: hidden?

房东的猫 提交于 2019-11-30 10:51:34
I'm trying to span content across multiple pages (divs) set at a height of 950px per div, so I can properly output to pdf. I start off with one div which nests all of the content using overflow: hidden. Ideally I'd like to use jquery to find content which is out of the viewing scope (hidden), but I can't see any functionality to do this. $...(':visible') just applies to display: none or visibility: hidden... The content on these pages is basic html markup (p, br, ol, ul, li, h1, h2). I've tried the route of looping these children elements and finding their offset from the top. The problem with

How to limit a table cell to one line of text using CSS?

左心房为你撑大大i 提交于 2019-11-30 10:46:23
I have a table of users where each row contains their names, e-mail address, and such. For some users this row is one text line high, for some others two, etc. But I would like that each row of the table be one text line high, truncating the rest. I saw these two questions: A column of a table needs to stay in one line (HTML/CSS/Javascript) CSS: limit element to 1 line In fact my question is exactly similar to the first one, but since the link is dead I can't study it. Both answers say to use white-space: nowrap . However this doesn't work, maybe I'm missing something. Since I can't show you