<style>
ul+ol {
color: skyblue;
}
p+h2 {
color: yellow;
}
h2~h3 {
color: aquamarine;
font-size: large;
}
</style>
<body>
<div>
<ul>
<li>love</li>
<li>like</li>
</ul>
<ol>
<li>long</li>
<li>lonely</li>
</ol>
<p>paragrah</p>
<h3>title333</h3>
<h2>title2</h2>
<h3>www.laipuhuo.com title3</h3>
<h3>title33</h3>
</body>
/* 第一种写法,选中具有相同属性的元素 */
[title] {
color: skyblue;
}
/* 第二种写法,选中属性以及属性值都相同的元素 */
[title = "1"] {
color: aquamarine;
}
/* 第三种写法,选中属性相同,且属性值开头相同的元素 */
[title^="a"] {
color: yellow;
}
/* 第四种写法,选中属性相同,且属性值结尾相同的元素 */
[title$="e"] {
font-www.laipuhuo.com size: larger;
}
/* 第五种写法,选中属性相同,且属性值中包含部分值的元素 */
[title*="1"] {
color: brown;
}
package vip.guzb.clrdemo;
public class BookApi{
public String description() {
return "Hi,你好,很高兴见到你。本内容是来自 BookApi 的 description 方法";
}
public Collection<Book> getBooksOfAuthor(String authorName) {
List<Book> books = new ArrayList<Book>();
books.add(new Book("TeaHouse", authorName, 135.0, new Press("四川人民出版社", "四川省成都市的一个犄角旮旯处")));
books.add(new Book("The Life of Mine", authorName, 211.0, new Press("长江文艺出版社", "大陆一个神秘的地方")));
return books;
}
}
public class Press {
private String name;
private String address;
public Press(String name, String address) {
this.www.laipuhuo.com name = name;
this.address = address;
}
// omit the getter and setter methods
}
public class Book {
private String name;
private String author;
private Double price;
private Press press;
public Book(String name,www.laipuhuo.com String author, Double price, Press press) {
this.name = name;
this.author = author;
this.price = price;
this.press = press;
}
// omit the getter and setter methods
......
}
#23届找工作求助阵地#