div

给三个不同的div变色

北战南征 提交于 2020-01-25 05:31:58
<!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>无标题文档</title> <style> #div1{width:100px;height:100px;background:red;} </style> <script type="text/javascript"> function setColor(color) { var oDiv=document.getElementById("div1"); oDiv.style.background=color; } </script> </head> <body> <input type="button" value="变红" onclick="setColor('red')"/> <input type="button" value="变黄" onclick="setColor(

Codeforces Round #613 (Div. 2)A. Mezo Playing Zoma

橙三吉。 提交于 2020-01-25 01:46:12
A. Mezo Playing Zoma time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Today, Mezo is playing a game. Zoma, a character in that game, is initially at position x=0x=0. Mezo starts sending nn commands to Zoma. There are two possible commands: 'L' (Left) sets the position x:=x−1x:=x−1; 'R' (Right) sets the position x:=x+1x:=x+1. Unfortunately, Mezo's controller malfunctions sometimes. Some commands are sent successfully and some are ignored. If the command is ignored then the position xx doesn't change and Mezo simply proceeds to the next

css的div动态水平垂直居中

依然范特西╮ 提交于 2020-01-24 20:52:48
div动态水平垂直居中,思路如下: (1)先定位。如果相对于距离最近的父元素,用absolute;如果相对于body,用fixed。 (2)然后,top和left都设为50%。 (3)要居中的div的margin-top和margin-left,都设置为该div高度和宽度的一半。 position:absolute; width:200px; height:100px; left:50%; top:50%; border:1px solid red; margin-left:-100px; margin-top:-50px; 如果只是水平居中,只用一个margin就行了。 margin:0 auto; 来源: https://www.cnblogs.com/lsongyang/p/7493712.html

[JavaScript]公告DIV实现

点点圈 提交于 2020-01-24 14:57:33
公告窗口如果用弹出式窗口的话,有可能会被些什么上网助手给屏蔽了!所以写了个公告DIV的JS。 演示地址: http://blog.csdn.net/bgu/ 代码如下:(放入到Body区域即可) < div id = " affiche " ondblclick = " closeDiv(); " style = " BORDER-RIGHT: black 1px outset; BORDER-TOP: black 1px outset; BORDER-LEFT: black 1px outset; WIDTH: 30%; CLIP: rect(auto auto auto auto); BORDER-BOTTOM: black 1px outset; POSITION: absolute; HEIGHT: 30%; BACKGROUND-COLOR: whitesmoke; TEXT-ALIGN: center; " align = " center " > < table height = " 100% " width = " 100% " > < tr > < td vAlign = " middle " align = " center " height = " 100% " > 此处为公告内容 < div id = " timeout " ></ div > </ td

Codeforces Round #615 (Div. 3) E Obtain a Permutation (思维)

ⅰ亾dé卋堺 提交于 2020-01-23 21:49:05
题目链接 E. Obtain a Permutation time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given a rectangular matrix of size n×mn×m consisting of integers from 11 to 2⋅1052⋅105. In one move, you can: choose any element of the matrix and change its value to any integer between 11 and n⋅mn⋅m, inclusive; take any column and shift it one cell up cyclically (see the example of such cyclic shift below). A cyclic shift is an operation such that you choose some jj (1≤j≤m1≤j≤m) and set a1,j:=a2,j,a2,j:=a3,j,…,an,j:=a1,ja1,j:=a2,j,a2,j:=a3,j,…,an

上中下三个DIV,高度自适应(上高度固定,下固定,中间自适应)(代码来自X人)

为君一笑 提交于 2020-01-23 05:35:07
本人开发的开发者技术变现资源聚集地,大家支持下,下面是网址 https://www.baiydu.com <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DivDemo.aspx.cs" Inherits="EkaduoBackstageLeadingToEnd.DivDemo" %> <!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 runat="server"> <title></title> <style type="text/css"> *{ margin:0; padding:0; } html{ padding:0 !important; padding:100px 0; width:100%; height:100%; overflow:hidden; } body{ padding:100px 0; padding:/**/0; height:100%; overflow: hidden; }

DIV或者DIV里面的图片水平与垂直居中的方法

戏子无情 提交于 2020-01-23 04:46:34
<div class=“box”>   <img /> </div> 水平居中的常用方式:     text-align:center ——这可以实现子元素字体,图片的水平居中 。    margin:0 auto —— 这是针对块元素的水平居中方法 垂直居中的常用方式:    vertical-align: middle;——这个垂直居中属性,只对 inline 或者 inline-block 元素有效。    这里没考虑flex的垂直居中的用法 div中图片水平和垂直居中方式:    第一种方式 : 直接手动计算的方式。已知box的高度和图片的高度 .box{ width: 300px; height: 300px; border: 1px solid red; text-align: center; } img{ width: 80px; height: 80px; padding-top: 110px; } 备注:这种方式是: 用box的高度减去图片的高度再除以2 ,就是padding-top的值,当然也可以使用margin-top,这样也可以实现图片在div里垂直居中。水平居中就用 text-align: center; 就行了。    第二种方式 : 图片已知宽高 1 img{ 2     position:relative; 3     top:50%; 4    

2020 CCPC Wannafly Winter Camp Day1 Div.1&2——密码学【构造 & 模拟】

喜欢而已 提交于 2020-01-22 08:02:19
题目传送门 题目描述 考虑一种加密方式,它需要一个任意长度的原文 {m}m 和秘钥 {key}key,其中要求原文和秘钥只包含大写和小写的英文字符。 首先定义字符之间的加密,用字符 a a a 去加密字符 b b b 的结果是: 首先把 a a a 和 b b b 转成数字 x x x 和 y y y 。转换的规则是,小写字母 a a a 到 z z z 依次对应 0 0 0 到 25 25 2 5 ,大写字母依次对应 26 26 2 6 到 51 51 5 1 。 计算 x x x 和 y y y 的和 z z z ,对 52 52 5 2 取模,即计算 ( x + y )   m o d   52 (x+y) \bmod 52 ( x + y ) m o d 5 2 。 返回数字 z z z 对应的字符。 现在来讲如何用秘钥 k e y key k e y 来加密原文 m m m : 如果秘钥的 k e y key k e y 的长度小于 m m m ,那么不停重复 k e y key k e y 直到长度不小于 m m m 为止。举例来说,如果原文是 b e i j i n g beijing b e i j i n g ,秘钥是 P K U S A A PKUSAA P K U S A A ,那么秘钥需要被重复称 P K U S A A P K U S A A

盒子模型(div标签)以及其属性

丶灬走出姿态 提交于 2020-01-22 04:46:58
盒子模型(div标签) 作用: 用于网页布局[画盒子] 组成: 内容区域 边框 内边距:内容区域与边框之间的距离 外边距:盒子与盒子之间的距离 盒子模型相关属性 边框属性(border) 设置边框的样式(没有|实线|点线|虚线|双实线) border - style : none ( 默认 ) | solid | dotted | dashed | double ; 设置边框宽度 border - width : ~ ~ px ; 设置边框颜色 border - color : red ; 边框属性的联写: border : 样式 宽度 颜色; 顺序和个数任意,省略的部分取默认值 也可以单独设置某一条边框的样式 或者单独指定每一个边框的样式 去掉边框的方法: border - style : none ; 或者 border : none ; 或者 border - top : none ; 去掉边框input轮廓线 outline - style : none ; 点击文字也能设置控件光标 圆角边框 border - radius: 50 % ; border - radius : 水平半径参数 / 垂直半径参数 ( 满足上右下左的顺序 ) (水平和垂直半径参数均包含四个参数,分别对应矩形的四个圆角的水平和垂直半径参数) border - radius : 20 px 30 px