absolute

How do you make a Zip/Jar in Java that will not contain the absolute pathname

萝らか妹 提交于 2019-12-11 06:57:50
问题 I'm generating a .jar file in Java, but the .jar contains an absolute pathname of where it is in the system (/tmp/tempXXX/foo instead of /foo). The tree is like this: . |-- META-INF |-|- .... |-- tmp |-|- tempXXX |-|-|- foo |-|-|- bar Instead of this: . |-- META-INF |-|- .... |-- foo |-- bar Is it possible to fix this? Here is the function that makes it: public static void add(File source, JarOutputStream target, String removeme) throws IOException { BufferedInputStream in = null; try { File

Absolute div shifts when scrollbar is present

一个人想着一个人 提交于 2019-12-11 04:19:24
问题 i have a problem with the entire content of my page. The problem being without a scrollbar present my content is about 20px to the right, but when a scrollbar is present it shifts to the left. I have to compensate for this for an absolute postioned div by positioning it over the content by 20px until a scrollbar is present as it rests at the right hand side of the page. This is a crappy fault on my behalf but i just want an easy way to fix this. Any quick and easy suggestions? Would i be

前端css基础(二)布局定位三种方式 文档流,浮动,层定位 clear

↘锁芯ラ 提交于 2019-12-11 03:32:06
对盒子进行定位 定位方式分为三类:(1)文档流(2)浮动定位(3)层定位 文档流flow 默认的方式,相当于平常写字一样,从上到下,从左到右 浮动定位float 想要盒子并列排列一般采用浮动定位 层定位layer 使用position属性设定,像图层一样前后层叠在一起 一.文档流flow 文档元素分类 block,inline,inline-block 1.block元素 独占一行 元素的height、width、margin、padding都是可以设置的 常见的block元素: div、段落、列表、标题、表格、表单等 <div>div标签</div> <p>p标签</p> <h1>h标签</xmp></h1> <ul>ul标签</ul> <table>table标签</table> <form>form标签</form> 2.inline 不单独占一行 width、height不可设置 width是由元素里面的文字和图片的宽度决定的,不能改变 常见的inline元素:<span>、<a> <a>a标签</a> <span>span标签</span> 3.inline-block元素: 不单独占一行 元素的height、width、margin、padding都可以设置 常见元素:<image> display属性 二.浮动定位float 1.float属性 float属性

Position absolute prevents browser to calculate correct height. Is it possible to fix this issue

淺唱寂寞╮ 提交于 2019-12-11 00:25:24
问题 I am developing a browser game. Until now i was using all position absolute. Because of that i have to set every page height myself. Now trying to pass this problem but since i used position absolute at my everything it always prevent browser to calculate correct height of div. Is it possible to achieve this. I mean for example i have div and inside many divs which uses position absolute feature. So i want this main div to calculate its height automatically which would be sum of nested divs

How an absolutely positioned element overlaps the following/next element without any z-index?

不打扰是莪最后的温柔 提交于 2019-12-10 17:54:28
问题 Please see my fiddle here. I'm trying to understand how the absolutely positioned "red hexagon" icon overlaps the input/textarea element without a z-index ? <style> .c-icon-error-a { height: 17px; width: 18px; } .c-icon-v2 { background-image: url("http://i.stack.imgur.com/RSjot.jpg"); background-repeat: no-repeat; display: inline-block; height: 14px; vertical-align: middle; width: 14px; } .c-icon-error-a { margin: 4px; position: absolute; } ul li { margin-bottom:15px; } </stlye> <body> <ul>

CSS position absolute - next positioned element is body?

做~自己de王妃 提交于 2019-12-10 15:05:23
问题 Quoting from msdn : "Object is positioned relative to parent element's position— or to the body object if its parent element is not positioned " Lets say I set a div with certain dimension to bottom 0; and left: 0; it will not be positioned at the bottom of body but at bottom left of viewport . Also when giving body a margin - the div will still be at bottom left of viewport . I know how to work with these properties but I am looking for reasoning. Is it not the body to which the absolute

如何实现优美的骨架屏

江枫思渺然 提交于 2019-12-10 09:46:05
对于前端来说,最重要的莫过于用户体验了,这次我们聊一聊骨架屏 - Skeleton Screen 我们平常对于需要请求加载的内容,可能用的比较多的是loading动画,比如在内容区域放一个菊花图,当请求结束,并且render tree构造完成后,将菊花图移除,展示用户想看的内容。虽然这种方式没啥缺点,但是现在更多的网站开始使用骨架屏代替,因为它能带过来更好的用户体验。 我们看几个例子: facebook jira linkedin slack 上图展示中,我们可以看到每个site从骨架图到真实内容的一个变化。如果你细心一点你会发现,不同site对于骨架图的block位置是不一致的: facebook将用户固定的头像,author,日期和一小部分文字作为骨架主体 jira则是标题和logo对应的很整齐 linkedin可以说完全没有对齐,而是使用一种更加的展示骨架布局 slack则是使用混合的loading方式,有骨架图也有旋转圆,不仅如此,slack并没有全部使用同一种灰色值,不同的block的颜色代表的该区域的字体颜色,这又是一种切换顺滑度的提升。 不过他们都有一个共同点,就是采用简约的方式布局,我们可以以此为例,创造出独一无二的风格,来提高用户体验和加强品牌的风格,我想这会比一个loading logo带来更好的效果。 上面简单的介绍了一下骨架图,接下来我们来说一下具体实现吧。

CSS布局基础

六眼飞鱼酱① 提交于 2019-12-10 05:39:27
(初级)css布局 一、单列布局 1、基础知识 块级元素 div p ul li dl dt 行级元素 img span input strong同一行显示、无换行 2、盒子模型 盒子模型 (边框border、外边距margin、内边距padding、内容content) 盒子模型3维立体图:自上往下(边框、内容和内边距、背景图片、背景颜色、 外边距) 样式追求就近原则(行内样式>内部样式>外部样式) 3、自动居中 margin: 0px auto;实现自动居中(原理:外边距=(浏览器的宽度-外包含层的宽度)/2)(此时不能同时设置浮动和绝对定位) 一般情况下: 父层设置一宽度,子层设置100%就可以。(子层继承父层宽度) 4、css布局笔记 4-1 margin:auto #main { width: 600px; margin: 0 auto; } 设置块级元素的 width 可以阻止它从左到右撑满容器。然后你就可以设置左右外边距为 auto 来使其水平居中。元素会占据你所指定的宽度,然后剩余的宽度会一分为二成为左右外边距。 唯一的问题是,当浏览器窗口比元素的宽度还要窄时,浏览器会显示一个水平滚动条来容纳页面。让我们再来改进下这个方案。 4-2 max-width 在这种情况下使用 max-width 替代 width 可以使浏览器更好地处理小窗口的情况

How do I get the absolute position of a mouse click from an onClick event on the body?

痞子三分冷 提交于 2019-12-10 04:09:43
问题 I am trying to get the absolute position (top and left) of a mouse click relative to the browser/body, not any parent elements within the body. I have a listener bound to the body, but e.pageX and e.pageY are giving me the position relative to a div. Note that I can leverage jQuery and YUI functions. Code that currently does not work correctly: //getting the position function _handleClick(e) { var data = { absX: e.pageX, absY: e.pageY}; _logClickData(data); } //binding the function var

Parallax effect - calculate child offset to parent on scroll

情到浓时终转凉″ 提交于 2019-12-09 22:42:15
问题 I'm trying to create a parallax effect whereby an absolutely positioned child element should move at a rate slower than it's parent on scroll. The child will always be 130% height of the parent but the parent can be any height: HTML: <div class="parallax-window lg"> <div class="parallax-image image-1"></div> <div class="parallax-content">Hello World</div> </div> <div class="parallax-window"> <div class="parallax-image image-2"></div> <div class="parallax-content">Hello World</div> </div> CSS: