js+css简单效果(幕布,跑马灯)
2.js普通的盒子,css的优先级
css的优先级
!important >>>>> style 行内样式 >>>>> #id选择器 # >>>>>>>> calss选择器 .类 :hover(猥类)>> p标签 属性选择 >> 继承 >> 默认值
同等 看优先,
3.引入js 有·3种 头部 行内 外部
点击变色
<div id="chb" onclick="chb.style.color='#9eff97'">ssssss</div>
行内js 控制属性
行内 值 就是css的值 值用‘’ 写多个用 ;隔开 用id选择器获取 复杂单词,就是单词里面有 -号 的 去掉,然后后面的一个字母变成大写
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>js</title>
<style type="text/css">
.chb01{width: 200px; height: 30px;color: #FFF ;font-size: 14px; line-height: 30px ;text-align: center;background-color: #063}
.chb02{width: 200px;
height: 200px;
background-color: #b3d4fc;
display: none;
}
</style>
</head>
<body>
<div id="chb" onclick="chb.style.color='#9eff97'">ssssss</div>
<div class="chb01" onclick="tan.style.display='block';this.style.color='red'">登 录</div>
<div class="chb02" id="tan" ></div>
</body>
</html>
例子: 简单的弹出div 隐藏div
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>j22s</title>
<style type="text/css">
.main{width: 1000px;
height: 2000px;
background-color:#930;
margin: 0px auto;
}
.moban{
width: 100%;
height: 2000px;
background-color: black;
opacity: 0.5;
position: fixed;
left: 0px;
top: 0px;
display: none;
}
.deng{
width: 650px;
height: 300px;
background-color: brown;
position: fixed;
left: 50%;
top: 50%;
margin-left: -325px;
margin-top: -150px;
display: none;
}
</style>
</head>
<body>
<div class="main">
<input type="button" value="登录" onclick="m.style.display='block';d.style.display='block'">
</div>
<div class="moban" id="m" onclick="this.style.display='none'" ></div>
<div class="deng" id="d" onclick="this.style.display='none'" >登录页面</div>
</body>
</html>
4.marquee标签 跑马灯
direction="down" 方向
scrollamount="1" 速度
behaviro="alternate" 行为 往返运动 scroll 转圈 slide 停靠
loop 循环 -1无限 对 slide无效
onmouseover="this.stop()" 鼠标移上去 就停止了
onmouseout="this.start()" 鼠标移除就 就开始了
display : inline-block; 有宽高。不换行 img
div display : block 有宽高,换行
a display :inline 无宽高 不换行
例子:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>跑马灯</title>
<style type="text/css">
*{margin: 0px; padding: 0px; list-style-type: none}
.pao{
display: block;
margin: 0px auto;
padding: 10px;
width: 980px;
height: 185px;
background-color: #888888;
}
.pao ul li
{
width: 150px;
height: 185px;
float: left;
margin-right: 10px;
background-color: #993300;
overflow: hidden;
}
.pao ul li a
{
position: relative;
left: 0px;
top: 0px;
}
.pao ul li a:hover
{
left: 2px;
top: 2px;
}
</style>
</head>
<body>
<marquee class="pao" behaviro="alternate" onmouseover="this.stop()" onmouseout="this.start()">
<ul>
<li><a><img src="../img/QQ图片20160913204411.jpg" height="185" width="180"/> </a></li>
<li><a> <img src="../img/QQ图片20160913204421.jpg" height="185" width="180"/></a></li>
<li><a><img src="../img/QQ图片20160913204713.jpg" height="185" width="180"/> </a></li>
<li><a><img src="../img/QQ图片20160913204906.jpg" height="185" width="180"/> </a></li>
</ul>
</marquee>
</body>
</html>
js+css简单效果(幕布,跑马灯)的更多相关文章
- 设置TextView的密码效果以及跑马灯效果
密码效果以及跑马灯效果: xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout ...
- vue.js(4)--字符串跑马灯
制作一个字符串的跑马灯效果 (1)实例代码 <!DOCTYPE html> <html lang="en"> <head> <meta c ...
- CSS效果:跑马灯按钮
HTML代码 <html lang="en"> <head> <meta charset="UTF-8"> <meta ...
- JS+CSS简单实现DIV遮罩层显示隐藏【转藏】
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- 前端用户体验优化: JS & CSS 各类效果代码段
前言 不定时更新 在线预览 https://zzyper.github.io/opti... 在线预览的源码 https://github.com/zzyper/opt... 部分内容仅兼容webki ...
- js实现图片无缝循环跑马灯
html 代码 <div class="myls-out-div" style="overflow: hidden;"> <ul id=&qu ...
- JS+CSS简单实现DIV遮罩层显示隐藏
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- Vue-使用计时器实现跑马灯效果
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- iOS中跑马灯效果小结
时光过得好快,记忆中刚刚从春节返回没有多久,清明.五一已飞逝而过,眨眼已到盛夏季节.不过还好,济南这两年不算太热,刚开始升温几天,一场及时雨总能让温度保持适宜.为了纪念一下青春的尾巴,也为了能有个健康 ...
随机推荐
- 【DP+树状数组】BZOJ1264-[AHOI2006]基因匹配Match
[题目大意] 给定n个数和两个长度为n*5的序列,两个序列中的数均有1..n组成,且1..n中每个数恰好出现5次,求两个序列的LCS. [思路] 预处理每个数字在a[i]中出现的五个位置.f[i]示以 ...
- 消除重复 Exercise07_15
import java.util.Scanner; /** * @author 冰樱梦 * 时间:2018年下半年 * 题目:消除重复 */ public class Exercise07_15 { ...
- UDP和TCP的区别和联系
UDP特点 将数据源和目的封装在数据包中,不需要简历连接 每个数据报的大小在限制在64K内 因无连接,是不可靠协议 不需要建立连接,速度快 TCP 建立连接.形成传输数据通道. 在连接中进行大量数据量 ...
- Fatal error: Call to undefined function mb_detect_encoding()
1.找到php扩展目录(我的php扩展目录的路径是:C:\Program Files\AppServ\php\extensions) 在extensions目录下面找到php_mbstring ...
- <摘录>GCC 中文手
GCC 中文手册 作者:徐明 GCC Section: GNU Tools (1) Updated: 2003/12/05 Index Return to Main Contents -------- ...
- Multivariate Adaptive Regression Splines (MARSplines)
Introductory Overview Regression Problems Multivariate Adaptive Regression Splines Model Selection a ...
- iOS- dispatch_semaphore和NSOperationQueue并发
并发:同一个时间内运行多个任务.又叫共行性,是指处理多个同时性活动的能力. 并行:是指两个并发的任务同时发生. 并发不一定并行,并发不一定要同时发生. 举个例子: 有两个快递分别要送到目的地,有以下两 ...
- B. Suffix Structures 模拟吧,情况比較多要想周全
这道题须要考虑的情况比較多,flag1表示情况是:b数组里有的字母而a里没有和b里面的同一个字母个数比a里面的多 flag2表示情况:b里面的左右字母能不能在a中同等顺序的存在 flag3表示情况:a ...
- XssEncode
0x00 闲扯 好吧继上一篇文章之后,就没发文章了!(其实是一直在写但是写的很少还凑不起一篇文章而已) 但是这几天对插件进行了一定的改良了 因为在自己在实际的XSS过程中也发现了自己的插件 还不够强大 ...
- Mount CIFS
mount -t cifs -o username="共享用户",password="密码" //ip/sharing_folder /mountpoint [ ...