div

DIV CSS BackGround属性研究

五迷三道 提交于 2019-11-27 06:15:40
在设置 background-image 属性时,有很多属性 1、background:url("图片路径") [no-repeat]; background:url("../images/images/up.jpg") no-repeat; 表示不重复显示图片 2、background-position 版本:CSS1 兼容性:IE6 7+ FF+ 继承性:无 语法 : background-position :length || length background-position :position || position 取值: position : top | center | bottom | left | center | right 说明 : 设置或检索对象的背景图像位置。必须先指定 background-image 属性。 该属性定位不受对象的补丁属性( padding )设置影响。 默认值为: 0% 0% 。此时背景图片将被定位于对象不包括补丁( padding )的内容区域的左上角。 如果只指定了一个值,该值将用于横坐标。纵坐标将默认为 50% 。如果指定了两个值,第二个值将用于纵坐标。 如果设置值为 right center ,因为 right 作为横坐标值将会覆盖 center 值,所以背景图片将被居右定位。 对应的脚本特性为

Codeforces Round #601 (Div. 2)

徘徊边缘 提交于 2019-11-27 05:29:22
A - Changing Volume 题意:有个遥控器,有+1-1+2-2+5-5,6个键,不允许把音量调整至负数(当音量<5,则无法按-5),求最少按键使得a变成b。 题解:一开始以为音量<5按-5会变成0,这样要多一个特判。由于给的数字的缘故,并不会有穿过去然后反过来减掉更优的,比如+4不需要+5-1,直接+2+2。所以直接模拟。 #include<bits/stdc++.h> using namespace std; typedef long long ll; void test_case() { int a, b; scanf("%d%d", &a, &b); if(a > b) swap(a, b); printf("%d\n", (b - a) / 5 + ((b - a) % 5 + 1) / 2); } int main() { #ifdef KisekiPurin freopen("KisekiPurin.in", "r", stdin); #endif // KisekiPurin int t = 1; scanf("%d", &t); for(int ti = 1; ti <= t; ++ti) { //printf("Case #%d: ", ti); test_case(); } } B - Fridge Lockers 题意:有个n点m边无向图

div不换行的三种方法

房东的猫 提交于 2019-11-27 05:12:58
原文: https://www.cnblogs.com/zouwangblog/p/11149621.html float <div class="div1">123</div> <div class="div2">456</div> <style> .div1 { float: left; } .div2 { float: left; } </style>    inline-block <div class="div1">123</div> <div class="div2">456</div> <style> .div1 { display: inline-block; } .div2 { display: inline-block; } </style> flex 这个是针对父元素设置的!!! <div class="parent"> <div class="div1">123</div> <div class="div2">456</div> </div> <style> .parent { display: flex; } </style>    来源: https://www.cnblogs.com/robinunix/p/11346126.html

图片动态加载在固定宽高div中,图片自适应填充,不拉伸变形

ぃ、小莉子 提交于 2019-11-27 04:58:38
需求: 1.如果高≥宽 图片不变形 图片的宽=缩略图框的宽 宽高比不变 从中心开始展示,如果高度超出显示区域,超出部分不显示 2.如果高≤宽 图片不变形 图片的高=缩略图框的高 宽高比不变 从中心开始展示,如果宽度超出显示区域,超出部分不显示 vue v-for 遍历get到的datalist item in datalist .img-box flex布局 垂直局中img标签 <div class="img-box"> <img :src="item.cover" class="imgbackground" :class="{cover: !item.iscover}" :style="{width: item.width + 'px', height: item.height + 'px'}"> </div> .img-box { // img容器 width: 279px; height: 157px; background-size: cover; background-position: center; overflow: hidden; display: flex; justify-content: center; align-items: center; .imgbackground { // img标签 width: 279px; height: 157px; }

当鼠标移入移出div时,触发事件(此处为图片的可见和不可见)

↘锁芯ラ 提交于 2019-11-27 04:40:36
<div οnmοuseοver='showDel(this)' οnmοuseοut='hideDel(this)' class='selector" + quesNum + " selector-style'><input type='radio' name='S" + quesNum + "'><input type='text' placeholder='选项' class='ST" + quesNum + "'><image id='" + quesNum + "' style='width:10px;height:10px;margin-left:10px;cursor:pointer;visibility:hidden' src='img/addsel.png' alt='添加' οnclick='addSelector(this)' ><image class='image" + quesNum + "' name='image" + quesNum + "' style='width:10px;height:10px;margin-left:10px;cursor:pointer;visibility:hidden' src='img/delsel.gif' alt='删除' οnclick='delSelector(this)' ></div> function

Div获得鼠标焦点时自动放大

不打扰是莪最后的温柔 提交于 2019-11-27 04:39:13
//method 1(id选择器) < html > < head > < meta charset = "UTF-8" > < title > Test </ title > < style type = "text/css" > #extend :HOVER { cursor : pointer ; transition : all 0.6 s ; transform : scale( 1.5 ) ; } </ style > </ head > < body > < div id = "extend" style = "background-color:#09FFCB; height:100px; width:100px;float:left;" > test1 </ div > < div id = "extend" style = "background-color:#ABFE05; height:100px; width:100px;float:left;margin-left:50px;" > test2 </ div > </ body > </ html > //method 2(元素选择器) < html > < head > < meta charset = "UTF-8" > < title > Test </ title > < style type =

鼠标移上去div边框阴影慢慢出现

偶尔善良 提交于 2019-11-27 04:36:09
.reg1,.reg2{width:260px;height:265px;border:1px solid #e5e5e5;margin-top:4%;float:left;margin-left:4%;transition: all 0.15s; } .reg1:hover,.reg2:hover{ -webkit-box-shadow: 2px 2px 8px 1px rgba(20, 20, 20, 0.15); -moz-box-shadow: 2px 2px 8px 1px rgba(20, 20, 20, 0.15);box-shadow: 2px 2px 8px 1px rgba(20, 20, 20, 0.15);} 来源: CSDN 作者: lowers_sunshine 链接: https://blog.csdn.net/lowers_sunshine/article/details/75352526

鼠标移动到div上,div中的img放大

浪子不回头ぞ 提交于 2019-11-27 04:35:02
<!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <title>鼠标移动到div上,div中的img放大</title> <style> #photo1{ overflow: hidden; width: 411px; height: 548px; cursor:pointer; float:left; margin-top: 50px; margin-left: 350px; } #photo2{ cursor:pointer; float:right; margin-top: 50px; margin-right: 350px; } img:hover{ transition: .5s transform; transform: scale(1.15); } .tupian{ width: 411px; height: 548px; } </style> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> </head> <body> <div id="photo1"> <img class="tupian" src="https://oscimg.oschina.net/oscnet/up

div实现遮罩层效果( div弹出层,后面变色不可编辑转)

北战南征 提交于 2019-11-27 04:17:05
转自: http://forlab.iteye.com/blog/1767843 <! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > < html xmlns ="http://www.w3.org/1999/xhtml" > < head > < meta http-equiv ="Content-Type" content ="text/html; charset=gb2312" /> < title > Jquery遮罩层 </ title > < style type ="text/css" > #BgDiv { background-color : #e3e3e3 ; position : absolute ; z-index : 99 ; left : 0 ; top : 0 ; display : none ; width : 100% ; height : 100% ; opacity : 0.5 ; filter : alpha(opacity=50) ; -moz-opacity : 0.5 ; } #DialogDiv { position : absolute ;

缺角的DIV

北战南征 提交于 2019-11-27 03:37:58
如何让方方正正的DIV缺了一角? 首先想到的 利用before/after伪元素的绝对定位并让它的背景颜色和外部颜色保持一致, 用这种方法的好处在于你可以同时使用:before和:after在DIV上实现两个缺角 代码如下: .block{ background:gray; height:60px; width:60px; position: relative; border-radius: 10px; } .block:before{ border-top-right-radius: 10px; background: white; position: absolute; left: 0; bottom: 0; content: ''; display: block; width: 20px; height: 20px; } .block:after{ border-bottom-left-radius: 10px; background: white; position: absolute; right: 0; top: 0; content: ''; display: block; width: 20px; height: 20px; } CodePen - http://codepen.io/huming0618/pen/XbEKNZ?embed-id=14064