CSS笔记--选择器
CSS笔记--选择器
mate的使用
<meta charset="UTF-8">
<title>Document</title>
<meta name="keywords" content="java培训,大前端培训">
<meta name="description" content="据说中国口碑最好的IT培训机构!">
<meta http-equiv="refresh" content="5; http://www.itcast.cn">
<link rel="stylesheet" href="1.css">
<link rel="icon" href="favicon.ico">
keywords:为了可以方便速索
description:是网站的描述信息
refresh:页面刷新,内容是数字;地址,多久之后跳转到这个地址。
css的外部引入
<link rel="stylesheet" href="1.css">
<link rel="icon" href="favicon.ico">
表格
<table width="400" height="400" border="1" cellspacing="0" align="center" bgcolor="pink">
<tr>
<th colspan="2">京东会员</th>
<!-- <td></td> -->
</tr>
<tr>
<td>用户名:</td>
<td><input type="text" value="请输入用户名" maxlength="6"><font color="red" size="2">最多输入6个字符</font></td>
</tr>
<tr>
<td>密 码:</td>
<td><input type="password" maxlength="6"><font color="red" size="2">最多输入6个字符</font></td>
</tr>
<tr>
<td>验证码:</td>
<td><input type="text"><br><br><img src="作业/yzm.jpg" width="100"></td>
</tr>
<tr>
<td align="center" colspan="2"><a href="dl.html">登录</a>|<a href="zc.html">注册用户</a></td>
<!-- <td></td> -->
</tr>
</table>
介绍:
- table:设置长和高
- 背景色(bgcolor)
- colspan:合并列
选择器
- 标签选择器
- 类选择器
- id选择器
案例
<style type="text/css">
类选择器
.G{
font-size: 200px;//字体大小和颜色
color: #000099;
}
.o1{
font-size: 200px;
color: #990000;
}
.o2{
font-size: 200px;
color: orange;
}
.g1{
font-size: 200px;
color: #000099;
}
.l{
font-size: 200px;
color: #009900;
}
.e{
font-size: 200px;
color: #990000;
}
</style>
</head>
<body>
<span class="G">G</span>
<span class="o1">o</span>
<span class="o2">o</span>
<span class="g1">g</span>
<span class="l">l</span>
<span class="e">e</span>
</body>
通配符选择器
*{
font-size: 100px;
color: red;
}
交集选择器
div.test[标签+类选择器]
div#test[标签+id选择器]
后代选择器
类选择器
/*.box{
font-size:40px;
color:red;
}
后代选择器[标签+标签]
div span{
font-size: 50px;
}*/
类+标签
/*.box span{
background-color: blue;
}*/
/* .box .miss{
color:red;
}*/
.box span{
color:red;
}
子代选择器
div>span{
color:red;
font-size:40px;
}
p>span{
color:green;
font-size:60px;
}
子代和后带的区别就是,后代不论隔了多少代,子代仅仅是一代。
并集选择器
.box,#miss,span,h1{
font-size:100px;
color: #fff;
background-color: green;
}
CSS笔记--选择器的更多相关文章
- CSS 笔记——选择器
1. 选择器 (1)类型选择器(标签选择器) 基本语法 E { sRules } 使用说明 类型选择器.以文档对象(Element)类型作为选择器. 选择面较大,适合做某种标签元素外观的常规设置. 代 ...
- 【CSS复合选择器、元素显示模式、背景】前端小抄(3) - Pink老师自学笔记
[CSS复合选择器.元素显示模式.背景]前端小抄(3) 本学习笔记是个人对 Pink 老师课程的总结归纳,转载请注明出处! 一.CSS的复合选择器 1.1 什么是复合选择器 在 CSS 中,可以根据选 ...
- CSS笔记——属性选择器
1.存在和值(Presence and value)属性选择器这些属性选择器尝试匹配精确的属性值:[attr]:该选择器选择包含 attr 属性的所有元素,不论 attr 的值为何.[attr=val ...
- 前端学习笔记之CSS后代选择器、子元素选择器、相邻兄弟选择器区别与详解
派生选择器用的很多,派生选择器具体包括为后代选择器.子元素选择器.相邻兄弟选择器,我们来理解一下他们之间的具体用法与区别. 1.css后代选择器语法:h1 em {color:red;} 表示的是从h ...
- CSS 笔记之 CSS 选择器
/*先设置背景再设置前景*/ pre{ background-color: #f8f8f8; border: solid 1px #ccc; border-radius: 3px; overflow: ...
- HTML+CSS笔记 CSS笔记集合
HTML+CSS笔记 表格,超链接,图片,表单 涉及内容:表格,超链接,图片,表单 HTML+CSS笔记 CSS入门 涉及内容:简介,优势,语法说明,代码注释,CSS样式位置,不同样式优先级,选择器, ...
- CSS系列(7)CSS类选择器Class详解
这一篇文章,以笔记形式写. 1, CSS 类选择器详解 http://www.w3school.com.cn/css/css_selector_class.asp 知识点: (1) 使用类选择 ...
- CSS的选择器
<div id="demo"> <div class="inner"> <p><a href="#" ...
- JS实战 · 仿css样式选择器
代码如下: <html> <head> <meta http-equiv="Content-Type" content="text/ ...
随机推荐
- Android真机调试访问本地服务器(localhost)的解决方案
Android系统把它自己作为了localhost!当连接localhost都是他自己啊.. 囧,在这里晕了好久才发现.. 网上介绍的都是模拟器连接本地服务器的,我试着把链接改为http://10.0 ...
- jquery.base64.js
(function($) { $.base64 = function(options) { var defaults = { data:"", type:0, unicode:tr ...
- 紫书 例题 9-12 UVa 12186 (树形dp)
这道题还是比较简单的,对于当前节点,算出每个儿子需要的人数 然后再算出当前节点需要多少个人数,然后排个序加上去就好了. #include<cstdio> #include<vecto ...
- [Python] isinstance() for checking object type
isinstance("foo", str) isinstance(1, int) isinstance(4.0, float)
- 华为荣耀3C最新版ROM的root,(4.7.1和4.8.1等等通用方法)
手头一台honor 3c的机器.应该是线刷的时候,把IMEI给刷掉了.导致移动2G卡无法上网. 刷了4.7.1或者4.8.1.尝试了全部方法都root失败了. 正好我手头有6582的代码.我想.既然系 ...
- 5.cocos2d锚点
创建一个层T1LayerAnchorPoint AppDelegate.cpp bool AppDelegate::applicationDidFinishLaunching() { // initi ...
- 如何解决Linux下的软件包依赖问题
650) this.width=650;" border="0" alt="" src="http://img1.51cto.com/att ...
- css相关用法
1. 2. 3.offset([coordinates]) 获取匹配元素在当前视口的相对偏移. 返回的对象包含两个整型属性:top 和 left,以像素计.此方法只对可见元素有效. a.获取当前元素的 ...
- C++中的纯虚函数
---恢复内容开始--- 在C++中的一种函数申明被称之为:纯虚函数(pure virtual function).它的申明格式如下 class CShape { public: ; }; 在什么情况 ...
- 【hdu 3987】Harry Potter and the Forbidden Forest
[Link]:http://acm.hdu.edu.cn/showproblem.php?pid=3987 [Description] 给出一张有n个点的图,有的边又向,有的边无向,现在要你破坏一些路 ...