position

安利一个绘制指引线的JS库leader-line

早过忘川 提交于 2019-12-04 10:32:54
前言 之前看到一篇推荐 Magi 这个搜索引擎的新闻,对于这个搜索引擎是否好用咱们不予置评,但是我在这个搜索引擎上面发现了一个好玩的前端功能。 如上图,将鼠标浮动到学习来源上时,会展示一堆指引线。 本博客的右侧文章目录也集成了这个功能,诸位可以玩一玩。 当时觉得这个功能很好玩,而且前端领域其实这种指引线还是有很多用处的,比如新手指引,功能指引,脑图之类的功能。 鉴于以后很可能需要用到,当时就调试了一下这个网站,发现使用了 leader-line 这个库。 然后百度了一下,发现网上也没什么人介绍这个库,所以这里写个安利文吧。 LeaderLine 这个库在Github上的介绍很简单: Draw a leader line in your web page. 意思就是在网页上画指引线。 使用起来也非常方便: <script src="leader-line.min.js"></script> <script> new LeaderLine( document.getElementById('start'), document.getElementById('end') ); </script> new一个LeaderLine对象即可,只需要输入两个dom元素节点而已。 当然也可以输入更多的参数来绘制各种各样的指引线: 具体的使用方法可以去查看lead-line的 Github地址

jQuery UI dialog positioning : adjust position top by 20px -

◇◆丶佛笑我妖孽 提交于 2019-12-04 09:55:49
问题 I have a dialog that gets filled by an ajax call. I want to limit the max-height of dialog and also allow it to be scroll-able if this max-height is exceeded. The code below does exactly what I want. The catch is I can not move the top of the dialog from the top position . I can move it left and right. I can't use center either as the dialog is displayed in a large scroll-able window. If I use firebug I can adjust the top property but cannot find where it is being set to zero. $("#your-dialog

css3mask淡出文字

我是研究僧i 提交于 2019-12-04 09:23:19
css3mask淡出文字 <pre> .p0_11wrap { width: 0.299rem; height: 7.68rem; overflow: hidden; background: url(/weiyeweiwangzhan/images/0/p0_11.png) no-repeat; background-size: 100%; background-position: 0rem 3.8rem; -webkit-mask: url(/weiyeweiwangzhan/images/0/p0_11zhezhao.png) no-repeat; -webkit-mask-size: 0.299rem 7.68rem; -webkit-mask-position: 0 0; position: absolute; left: 76.933%; top: 21.891%; } .p0_11warpzhezhao { width: 0.299rem; height: 7.68rem; background: url(/weiyeweiwangzhan/images/0/p0_11zhezhao.png); background-size: 0.299rem 7.68rem; background-position: 0rem 0rem; position: absolute;

博客园界面美化

怎甘沉沦 提交于 2019-12-04 09:01:09
0.感谢原作 https://www.cnblogs.com/menxin- ... 1.页面css代码 /** 原有样式修改 */ #sideBar{ display: none; } #mainContent{ width: 100%; box-shadow: 0 0 0; border-radius: 0px; opacity: 0; transition:0.5s; margin-top:40px; } #main{ width: 60%; background-color: white; /*max-width: 700px;*/ } @media screen and (max-width: 1000px) { #main {width: 100%;} } body{ background-image: none; background-color:white; font-family: Menlo,Bitstream Vera Sans Mono,DejaVu Sans Mono,Monaco,Consolas,monospace !important; line-height: 1.8; } #cnblogs_post_body{ font-size: 16px; } #green_channel{ display: none; } #post_next_prev{

css居中-水平居中,垂直居中,上下左右居中

孤街浪徒 提交于 2019-12-04 08:40:22
网页布局居中必不可少,其中包括水平居中,垂直居中,上下左右居中,下面一一详述。 水平居中 <div class="container"> <div class="item">居中</div> </div> 1.text-align: center;  对父元素设置text-align: center;子元素即可居中。但子元素是有限制的,只对图片,文字等行内元素有效。  如果子元素有一定宽度,可以设置子元素display:inline-block;   <style> .container { text-align: center; } .item{ display: inline-block; width: 100px; background-color: #ff266e; } </style> 效果 2.margin: 0 auto;  元素本身设置 margin: 0 auto; 这种方法对能设置宽度的元素起作用. <style> .container { text-align: center; background-color: #a08b8b; } .item{ margin: 0 auto; width: 100px; background-color: #ff266e; } </style> 效果 3.position:absolute;  

How to save scroll position of recyclerview in fragment

旧城冷巷雨未停 提交于 2019-12-04 08:34:55
I have followed so many answers from here.. but not a single one solving my issue .. that's why i am asking. I want to save scroll position in a fragment. In So many articles they have suggested to follow @Override protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); } and @Override protected void onRestoreInstanceState(Bundle savedInstanceState) { super.onRestoreInstanceState(savedInstanceState); } But this two method is not available in fragment. My code: private int mPositionIng = RecyclerView.NO_POSITION; private String KEY_POSITION_ING =

【100个前端小项目-1】HTML & CSS 实现可爱卡通画

六月ゝ 毕业季﹏ 提交于 2019-12-04 08:10:50
一直以来对前端抱有莫名的兴趣,这次换工作后如愿以偿的接手了很多前端的任务。借着之前粗浅的经验上手的还算快,可是深入的方面就不太跟得上了。众所周知,前端的学习离不开实践和积累,为了快速而有效的进步,在此制定了第一阶段的学习任务 -- 收集和实现CodePen上100个前端小项目。此阶段的目的是借着一个个小项目快速熟悉HTML, CSS, JS的简单应用和套路。 下面开始进入正题,第一个项目是我在CodePen上看到的,觉得图案可爱就把代码扒了下来实现了一遍(图案见下图)。这个项目精髓主要在于CSS,研究完这个项目,基本上可以对CSS盒模型,瀑布流模式,DOM分层有基本的掌握。 https://codepen.io/xinxhe/pen/PooQNXJ?editors=1100 image.png 下面是HTML的实现,这里是用了pug,语法上更简洁。可以看出,HTML元素的分层是自外向内的,最外面是一个大的container,向内一层分为了三个大块:笑脸,下划线,和背景装饰物,再向内就是三大块中的各种细节。 1 div.container 2 div.smiley__face.smiley__face--01 // 笑脸中间 3 div.face 4 div.eyes 5 div.eye.eye__left 6 div.eye.eye__right 7 div.mouth 8 div

前端

对着背影说爱祢 提交于 2019-12-04 07:09:22
目录 前端 CSS 前端 <!DOCTYPE html> <html> <head> <title>考试了</title> <link rel="stylesheet" href="css/style.css"> <meta charset="utf-8"> </head> <body> <div id="b"> <div id="b1"><img src="images/banner.jpg" alt=""></div> <div id="b2"><img src="images/content_bg.jpg" alt=""> <div id="b2_1"><img src="images/toplink.jpg" alt=""> <div id='b2_1_font'> <font>首页    </font> <font>论坛    </font> <font>推荐    </font> <font>最新日志    </font> <font>最新评论    </font> <font>尚未登陆    </font> </div> </div> <div id="c"> <div id="c1"> <div id="c1_tu"><img src="images/recommendblog.jpg" alt=""></div> <div id="c_font"> <font

css的定位类型

依然范特西╮ 提交于 2019-12-04 06:51:01
static 定位 HTML 元素的默认值,即没有定位,遵循正常的文档流对象。 静态定位的元素不会受到 top, bottom, left, right影响。 fixed 定位 元素的位置相对于浏览器窗口是固定位置。 即使窗口是滚动的它也不会移动: relative 定位 相对定位元素的定位是相对其正常位置。 absolute 定位 绝对定位的元素的位置相对于最近的已定位父元素,如果元素没有已定位的父元素,那么它的位置相对于<html>: absolute 定位使元素的位置与文档流无关,因此不占据空间。 absolute 定位的元素和其他元素重叠。 sticky 定位 sticky 英文字面意思是粘,粘贴,所以可以把它称之为粘性定位。 position: sticky; 基于用户的滚动位置来定位。 粘性定位的元素是依赖于用户的滚动,在 position:relative 与 position:fixed 定位之间切换。 它的行为就像 position:relative; 而当页面滚动超出目标区域时,它的表现就像 position:fixed;,它会固定在目标位置。 元素定位表现为在跨越特定阈值前为相对定位,之后为固定定位。 这个特定阈值指的是 top, right, bottom 或 left 之一,换言之,指定 top, right, bottom 或 left 四个阈值其中之一

【CSS】水平居中和垂直居中

大城市里の小女人 提交于 2019-12-04 06:48:44
水平居中和垂直居中 2019-11-12 15:35:37 by冲冲 1、水平居中 (1)父级元素是行内元素,子级元素是行内元素,子级元素水平居中 ① 设置父级元素为块级元素 display:block; ② 给父级元素添加 text-aglin:center; 1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title>居中测试</title> 6 <style> 7 #father { 8 background-color: skyblue; 9 display:block; 10 text-align:center; 11 } 12 #son { 13 background-color: green; 14 } 15 </style> 16 </head> 17 18 <body> 19 <span id="father"> 20 <span id="son">我将居中</span> 21 </span> 22 </body> 23 </html> (2)父级元素是块级元素,子级元素是行内元素,子级元素水平居中 ① 给父级元素添加 text-aglin:center; (3)父级元素是块级元素,子级元素是块级元素,子级元素水平居中 方案一 (31)父级元素和子级元素有宽度 ① 给子级元素添加