解决重叠的问题:
1、子级有浮动的父级盒子加overflow:hidden
.boxa{ overflow:hidden}
【由于相邻两个DIV一个使用浮动一个没有使用浮动,这样照成两个DIV覆盖重叠现象。】
2、要么都不使用浮动;要么都使用float浮动;要么对没有使用float浮动的DIV设置margin样式。
遍历map的2种方法
public static void main(String[] args) {
// TODO Auto-generated method stub
HashMap map = new HashMap();
map.put("010", "北京");
map.put("020", "广州");
map.put("021", "上海");
map.put("028", "成都"); //遍历 //1.先获得键的集合,再取值。
Set keys = map.keySet();
Iterator it = keys.iterator();
while(it.hasNext()) {
String code = (String)it.next();
System.out.println(code+"="+map.get(code)); } System.out.println("\n--------------------------\n");
//2.获得关系的集合,遍历每一个关系
Set> sets = map.entrySet();
it = sets.iterator();
while(it.hasNext()) {
Entry entry = (Entry)it.next(); System.out.println(entry.getKey()+"="+entry.getValue()); } }
共同学习,写下你的评论
评论加载中...
作者其他优质文章