overflow

flex 布局下,css 设置文本不换行时,省略号不显示的解决办法

泪湿孤枕 提交于 2019-12-22 05:18:48
大致是有一个 main 容器是 flex 布局,左边一个 logo 固定宽高,右边 content 动态宽度。 <div class="main"> <img alt="" class="logo" src="pic.jpg"> <div class="content"> <h4 class="name">a name</h4> <p class="info">a info</p> <p class="notice">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt

IE10 line-height bug with display:inline-block; and overflow:hidden;

自闭症网瘾萝莉.ら 提交于 2019-12-22 04:46:19
问题 I've recently run in to a peculiar problem in IE10 ( sigh ). It appears that if you use display:inline-block; in conjunction with overflow:hidden; IE10 messes up your line-height. I tried fixing it using vertical-align:middle; but that only almost fixes the problem in IE10 and then introduces baseline problems in other browsers. The only code needed to trigger the bug is: CSS: .bug { display:inline-block; overflow:hidden; } HTML: <p>This should <span class="bug">be buggy</span> in IE10</p> I

Overflow scrolling on dynamically moving elements

故事扮演 提交于 2019-12-22 04:09:26
问题 var block = document.getElementById('block') function myFunct() { block.style.transform = 'translateX(-400px)' } .container { position:relative; width:400px; height:150px; margin:auto; background-color: blue; overflow:scroll; } #block { position:absolute; height:25px; width:100%; left:50%; bottom:50%; overflow: scroll; background-color: yellow; border:1px solid black; align-self: flex-end; } <div class="container"> <div id="block"></div> <button onclick='myFunct()'>CLICK</button> </div> In my

Sticky scrollbar at bottom of table

不问归期 提交于 2019-12-22 02:32:09
问题 I'm not sure if "sticky" is the term for this, but is there a way to make the scrollbar from overflow:auto stay visible? I have a rather large table that I want to be scrollable horizontally; however, the table is fairly tall as well, so when the page loads the horizontal scrollbar is not within the viewport of the browser, so it's rather hard to tell that the table is scrollable at all. <div style = 'width:900px;overflow:auto'> <table> <!-- Very large table here --> </table> </div> The

Scroll an overflowing div by scrolling anywhere on the page

风格不统一 提交于 2019-12-21 19:30:49
问题 I'd like to trigger scrolling of a div with overflowing content by scrolling anywhere on the page, not just by moving the mouse and clicking within the div. Also, i'd like to hide the div's scrollbar such that only the page's scrollbar is visible. Preferably the solution would be CSS-based but a JS solution would work too. here's my jsfiddle that demonstrates the problem: http://jsfiddle.net/trpeters1/RMZsX/8/ I'd copy the code here but there I put a bunch of filler text to trigger the

jquery scrollLeft not working on Android

删除回忆录丶 提交于 2019-12-21 18:31:57
问题 The code below is not working in Android browser! How do I fix it? <input id="sannn" type="button" value="SAN" /> <div id="sann" style="width:640px; height:200px; overflow:scroll; border:solid 1px red;"> <div style="border:solid 1px green; width:3000px; height:200px;">4545</div> </div> $('#sannn').bind('click', function () { $('#sann').scrollLeft(10); }); 回答1: Looks like it is a bug in Android Browsers 4.0.3+ http://code.google.com/p/android/issues/detail?id=38505&thanks=38505&ts=1350315570

jquery scrollLeft not working on Android

泄露秘密 提交于 2019-12-21 18:31:06
问题 The code below is not working in Android browser! How do I fix it? <input id="sannn" type="button" value="SAN" /> <div id="sann" style="width:640px; height:200px; overflow:scroll; border:solid 1px red;"> <div style="border:solid 1px green; width:3000px; height:200px;">4545</div> </div> $('#sannn').bind('click', function () { $('#sann').scrollLeft(10); }); 回答1: Looks like it is a bug in Android Browsers 4.0.3+ http://code.google.com/p/android/issues/detail?id=38505&thanks=38505&ts=1350315570

Arithmetic operation resulted in an overflow in unsafe C#

馋奶兔 提交于 2019-12-21 18:05:35
问题 Background We've been using some code copied verbatim from Joe Duffy's "Concurrent Programming on Windows" (page 149) in production for over a year. The code (below) is used in our Asp.Net web application to probe if there's enough stack space. Our site allows users to script out their own web pages and control logic in a simple proprietry scripting language - it's possible for a user to script something nasty and cause a stackoverflow exception, so we use Duffy's code example to stop

Arithmetic operation resulted in an overflow in unsafe C#

孤街浪徒 提交于 2019-12-21 18:03:06
问题 Background We've been using some code copied verbatim from Joe Duffy's "Concurrent Programming on Windows" (page 149) in production for over a year. The code (below) is used in our Asp.Net web application to probe if there's enough stack space. Our site allows users to script out their own web pages and control logic in a simple proprietry scripting language - it's possible for a user to script something nasty and cause a stackoverflow exception, so we use Duffy's code example to stop

css3重要知识点和bug解决方法

谁都会走 提交于 2019-12-21 12:32:24
1.图片向下撑大3像素问题 在一个盒子里面放一张图片,默认情况下,图片会向下撑大3像素,有以下几种解决方法: 1.1 给图片添加display:block; 1.2 给图片添加 float:left; 1.3 给图片添加 vertical-align:middle; 1.4 给他的父元素加font-size:0; 2.如何实现一张未知宽高的图片在一个盒子里面做水平垂直居中? 给父元素添加宽高,添加行高 添加 text-align:center 给图片添加 :vertical-align:center 3.元素的类型分类哪几种?各自都有什么特点? 块元素 独占一行,竖着排,能设置宽高 行内元素 默认情况下文本一行显示,不能设置宽高 行内块状元素 inline-block,既有行内元素的特点又有块状元素的特点 可变元素 添加float:left 相当于display:block 4.如何实现一个元素消失和出现? display:none display:block opcity:0; opcity:1; 5.单行文本溢出显示省略号怎么实现? 添加width; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; 6.定位的属性值有哪几个?分别有什么特点? position:absolute 绝对定位, 脱离文档流