class

6个强大的CSS选择器

ⅰ亾dé卋堺 提交于 2020-03-17 10:45:46
1. div >a 这个选择器将使我们能够选择所有父元素是div标签的元素。 <!-- This one will be selected --> <div> <a></a> </div> <!-- This one won't be selected --> <p> <a></a> </p> 2. div +a 选择紧接在div元素之后的每个标签。如果我们在div和a标签之间有一个元素,则不会选择该元素。 <main> <!-- This one will be selected --> <div></div> <a></a> <!-- This one won't be selected --> <div></div> <p></p> <a></a> </main> 3. div ~a a标签将选择每个标签,然后在同一级别上添加div标签。换句话说,如果a标签不是紧跟在div标签之后,而是具有div标签作为同级元素,则将选择该标签。 <main> <!-- This one will be selected --> <div></div> <a></a> <!-- This one will be selected --> <div></div> <p></p> <a></a> <section> <!-- This one will be selected --> <div>

JS 瀑布流效果

假装没事ソ 提交于 2020-03-17 08:33:57
JS瀑布流效果 <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>JS瀑布流效果</title> <style> * { margin: 0px; padding: 0px; } #container { position: relative; } .box { padding: 5px; float: left; } .box_img { padding: 5px; border: 1px solid #cccccc; box-shadow: 0 0 5px #ccc; border-radius: 5px; } .box_img img { width: 150px; height: auto; } </style> </head> <body> <div id="container"> <div class="box"> <div class="box_img"> <img src="/Scripts/img/img1/1.jpg" /> </div> </div> <div class="box"> <div class="box_img"> <img src="/Scripts/img/img1/2.jpg" /> </div> </div> <div class="box"> <div class

error C2039: 'string' : is not a member of 'std', header file problem

杀马特。学长 韩版系。学妹 提交于 2020-03-17 06:41:26
问题 I am having problems with a class I am writing. I have split the class into a .h file that defines the class and an .cpp file that implements the class. I receive this error in Visual Studio 2010 Express: error C2039: 'string' : is not a member of 'std' This is the header FMAT.h class string; class FMAT { public: FMAT(); ~FMAT(); int session(); private: int manualSession(); int autoSession(); int mode; std::string instructionFile; }; This is the implementation file FMAT.cpp #include <iostream

morphia进阶

為{幸葍}努か 提交于 2020-03-17 06:09:58
注解原始和级别类型的属性 保存原始和基本类型的属性到Mongo中,你不必为他们添加任何注解: ... private int myInt; private Date myDate; private List<String> myStrings; private String[] stringArray; 默认情况下,Morphia将会试着映射所有支持的基本和原始类型到Mongo,包括这些类型的数组。 MongoDB仅仅有一下数据类型: Integer(32位有符号值) Long(64有符号值) Double(64位IEEE745浮点值) String (字符串) 这里有些有价值的转换: float → double byte → int short → int char → String 并且,依赖于你的模型中存在的类型和数据库将会试着自动为你转换。我的意思是,因为在MongoDB数据库中只存在三种数字类型(32/64有符号, 64位FP)这将相当 容易转换。下面的列表为当前什么样的基本和原始类型可以被保存: enum(在Mongo中作为String保存) java.util.Date(在Mongo中保存为从新纪元UTC的毫秒数) java.util.Locale(作为字符串保存) com.mongodb.DBRef com.mongodb.ObjectId

属性选择符、字体样式和元素样式

梦想的初衷 提交于 2020-03-17 05:28:35
属性选择符: body内的代码如下: <a href="##" class="columnNews">我的背景想变成红色</a> <a href="##" class="columnVideo">我的背景想变成红色</a> <a href="##" class="columnAboutUs">我的背景想变成红色</a><br/> <a href="1.doc">我的背景想变成绿色</a> <a href="2.doc">我的背景想变成绿色</a><br/> <a href="##" title="this is a box">我的背景想变成蓝色</a> <a href="##" title="box1">我的背景想变成蓝色</a> <a href="##" title="there is two boxs">我的背景想变成蓝色</a> <style type="text/css"></style>中代码如下: E[att]        选择具有att属性的E元素。 <style type="text/css">a[class]{ background-color: red; /*含class属性的背景颜色变红*/ } </style> E[att="val"]      选择具有att属性且属性值等于val的E元素。  a[class="columnAboutUs"]{

jQuery作用

眉间皱痕 提交于 2020-03-17 02:41:04
jquery是前端里面比较总要的,是很强大的一个选择器。 表单: 1、$(":input") 查找所有的input元素 2、$("text") 匹配所有的单行文本框 3、$(":password") 匹配所有密码框 4、$("radio") 匹配所有单选按钮 5、$("checkbox") 匹配所有复选框 6、$("submit") 匹配所有提交按钮 7、$("image") 匹配所有图像域 8、$("button") 匹配所有按钮 9、$("file") 匹配所有文件域 10、$("hidden") 匹配所有不可见元素,或者type为hidden的元素 1、$("#id"): 根据给定的ID匹配一个元素。 2、$("dom元素名"):根据给定的元素名匹配所有元素 3、$(".Class类名"): 根据给定的类匹配元素。 4、$("*") :匹配所有元素。 5、$("dom元素.class类名"):选择所有class属性为指定类名的dom元素。 6、$(".stripe tr"): 获取class属性为stripe的table元素下的所有行 层级: 1、$("ancestor descendant"):在给定的祖先元素下匹配所有的后代元素 2、$("parent > child"):在给定的父元素下匹配所有的子元素 3、$("prev + next"):匹配所有紧接在 prev

实现响应式——Bootstrap的删格系统详解

人盡茶涼 提交于 2020-03-16 17:28:41
Bootstrap 今天和大家一起学习如今很流行的前端框架之一, Bootstrap框架。 前言   今天带大家看看Bootstrap框架,其实我呢主要还是用里面的删格系统,单单这个删格系统就比较强大了。其他的css样式我个人用的比较少。但是你要做一些简单的响应式那么Bootstrap框架是一个很不错的选择。  01 Bootstrap下载方式方法 ① 用于生产环境的 Bootstrap   编译并压缩后的 CSS 、 JavaScript 和字体文件,不包含文档和源码文件。 ② Bootstrap 源码   Less 、 JavaScript 和字体文件的源码,并且带有文档,需要 Less 编译器和一些设置工作。 ③ Sass   这是 Bootstrap 从 Less 到 Sass 的源码移植项目,用于快速地在 Rails 、 Compass 或 只针对 Sass 的项目中引入。 下载地址: http://v3.bootcss.com/ 大家可以在上面的网址进行下载Bootstrap 文件,下面就先带大家看一下Bootstrap 的一些排版样式。   <meta charset="utf-8"> <!--让浏览器使用最新的IE内核进行渲染页面--> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-

frameset

我是研究僧i 提交于 2020-03-16 17:10:47
刚刚快速帮别人做了一个frameset。以后不想再做了。就copy上来咯。^_^ frameset.html <html> <head> <title>框架菜单</title> <link href="style.css" rel="stylesheet" type="text/css" /> </head> <!-- 框架开始 --> <frameset rows="218*,239*" cols="*" framespacing="0" frameborder="NO" border="1" > <frame src="top.html" name="topFrame" scrolling="NO" noresize/> <frameset rows="*" cols="250,500,250" framespacing="0" frameborder="NO"> <frame src="left.html" name="leftFrame" scrolling="NO" noresize/> <frame src="main.html" name="mainFrame" scrolling="no" noresize/> <!-- scrolling 框架滚动条显示 yes/no (可视化助理) --> <frame src="right.html" name=

C++ previous definition error

自闭症网瘾萝莉.ら 提交于 2020-03-14 11:09:13
问题 So, thanks to this website, I found the answer to my previous problem. I'm adding a function to a class in a GNU automake project that uses a pointer to a doc object. Dependencies were included in the Makefile.am file to include doc.h and plsa.h in the respective order. However, when I compiled, I would get a doc has not been declared error. Then, I tried adding the #include statement here, which gives a previous redefinition of 'class doc' error. I learned that I have to declare doc by using

issubclass,type,isinstance反射

与世无争的帅哥 提交于 2020-03-13 05:41:34
1, issubclass 判断前一个是不是后一个的子类,或者说是后辈 1 class Animal: 2 pass 3 class Cat(Animal): 4 pass 5 class Boshicat(Cat): 6 pass 7 8 print(issubclass(Cat,Animal)) 9 print(issubclass(Boshicat,Animal)) 10 print(issubclass(Cat,Boshicat)) 11 12 13 运行结果 14 True 15 True 16 False 2,type type: 精准的给出对象的类 1 class Animal: 2 pass 3 class Cat(Animal): 4 pass 5 class Boshicat(Cat): 6 pass 7 8 9 c = Cat() 10 print(type(c)) 11 print(type(c) == Cat) 12 print(type(c) == Animal) 13 print(type(c) == Boshicat) 14 15 16 运行结果 17 18 <class '__main__.Cat'> 19 True 20 False 21 False 3,isinstance isinstance:判断一个对象是不是一个类