class

实现圣杯布局的三种方法

和自甴很熟 提交于 2020-01-20 14:20:22
第一题:实现左边固定200px, 左右自适应布局的方法(圣杯布局) 用flex布局方式 把左边的框度写死,右边的设置flex:1 < ! -- 外层框架 -- > < div class = "box" > < div class = "left" > 左边 < / div > < div class = "right" > 右边 < / div > < / div > < div class = "footer" > < / div > < style > . box { height : 200 px ; width : 600 px ; display : flex ; } . left { width : 200 px ; height : 200 px ; } . right { height : 200 px ; flex : 1 ; } < / style > 2.## Css3新盒子模型给左边一个200px的padding 道理和代码同上,就是把rigt 的盒子模型给为display:border-box 宽度不设置 3.## 普通盒子模型,但是子盒子不设置框度,加浮动实现给左边一个200px的margin 首先创建一个大的div盒子,起类名为bix,它含有两个子div盒子,一个类名为left ,一个为right 然后底部区域清除浮动,防止跟随上边的区域一起浮动。

基于HTML+JS实现线上点单平台

一笑奈何 提交于 2020-01-20 13:38:37
HTML部分: <!doctype html> <html lang="zh"> <head> <title>喜茶</title> <!-- Required meta tags --> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <!-- Bootstrap CSS --> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"> </head> <body> <!-- 容器 --> <div class="container-fluid px-0"> <!-- 展板 --> <div class="jumbotron px-0 py-2 bg-success"> <h1 class="display-3 text-white ml-5">喜茶<

Spring环绕通知

孤街醉人 提交于 2020-01-20 10:30:10
public class CustomerDao { public void find(){ System.out.println("查询客户..."); } public void save(){ System.out.println("保存客户..."); } public void update(){ System.out.println("修改客户..."); } public void delete(){ System.out.println("删除客户..."); } } public class MyAroundAdvice implements MethodInterceptor { public Object invoke(MethodInvocation invocation) throws Throwable { System.out.println("环绕前增强==================="); Object obj = invocation.proceed(); System.out.println("环绕后增强==================="); return obj; } } <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework

Javascript “this” in static methods

五迷三道 提交于 2020-01-20 08:25:06
问题 I have a code like that: User = function(){} User.a = function(){ return "try"; } User.b = function(){ } ​ From User.b() I can call User.a() using: User.b = function(){ return User.a(); } but not using this since it's not an instance of user (User.a() and User.b() are something like "static methods"). What i want to do is to be able to call User.a() from User.b() without knowing which is the main function, in this case User. Something like this to be used in static methods. 回答1: In reality

Javascript “this” in static methods

岁酱吖の 提交于 2020-01-20 08:22:45
问题 I have a code like that: User = function(){} User.a = function(){ return "try"; } User.b = function(){ } ​ From User.b() I can call User.a() using: User.b = function(){ return User.a(); } but not using this since it's not an instance of user (User.a() and User.b() are something like "static methods"). What i want to do is to be able to call User.a() from User.b() without knowing which is the main function, in this case User. Something like this to be used in static methods. 回答1: In reality

单例模式

落花浮王杯 提交于 2020-01-19 15:49:56
Java 单例模式 单例模式 非延迟加载单例类 public class Singleton {    private Singleton ( ) { }    private static final Singleton instance = new Singleton ( ) ;    public static Singleton getInstance ( ) {      return instance ;    } } 简单的同步延迟加载 public class Singleton {    private static Singleton instance = null ;    public static synchronized Singleton getInstance ( ) {      if ( instance == null )       instance = new Singleton ( ) ;      return instance ;    } } 双重检查成例延迟加载 public class Singleton {    private static volatile Singleton instance = null ;    public static Singleton getInstance ( ) {      if (

HTML+CSS+JAVASCRIPT幻灯片

≯℡__Kan透↙ 提交于 2020-01-19 15:41:43
没性能的啊,就是循环遍历操作DOM HTML----code: <body> <div class="slide-wrap"> <div class="slide"> <ul class="slide-list"> <li class="slide-item active"> <img src="HOME/images/1.jpg"> </li> <li class="slide-item"> <img src="HOME/images/2.jpg"> </li> <li class="slide-item"> <img src="HOME/images/3.jpg"> </li> </ul> </div> <!--缩略图--> <div class="thumbs"> <ul class="thumbs-list"> <li class="thumbs-item cur"> <img src="HOME/images/1.jpg"> </li> <li class="thumbs-item"> <img src="HOME/images/2.jpg"> </li> <li class="thumbs-item"> <img src="HOME/images/3.jpg"> </li> </ul> </div> </div> <script type="text

Java基础方面:

不想你离开。 提交于 2020-01-19 03:54:51
Java基础方面:   1、作用域public,private,protected,以及不写时的区别   答:区别如下:   作用域 当前类 同一package 子孙类 其他package   public √ √ √ √   protected √ √ √ ×   friendly √ √ × ×   private √ × × ×   不写时默认为friendly   2、ArrayList和Vector的区别,HashMap和Hashtable的区别   答:就ArrayList与Vector主要从二方面来说.   一.同步性:Vector是线程安全的,也就是说是同步的,而ArrayList是线程序不安全的,不是同步的   二.数据增长:当需要增长时,Vector默认增长为原来一培,而ArrayList却是原来的一半   就HashMap与HashTable主要从三方面来说。   一.历史原因:Hashtable是基于陈旧的Dictionary类的,HashMap是Java 1.2引进的Map接口的一个实现   二.同步性:Hashtable是线程安全的,也就是说是同步的,而HashMap是线程序不安全的,不是同步的   三.值:只有HashMap可以让你将空值作为一个表的条目的key或value   3、char型变量中能不能存贮一个中文汉字?为什么?   答

CSS ID vs Class

北城以北 提交于 2020-01-19 03:44:25
问题 What is the basic difference between CSS ID and CSS Class? Someone told me that, ID can be used only once in a page. But I found that it can be used multiple times. like body { background-color: #3399FF; } div#menuPane{ position: absolute; left: 25px; top: 25px; width: 25%; } div.menu { display: block; font-size: 14px; margin: 0; padding: 0; border: 2px solid #7FC07F; } div.menu a { display: block; font-weight: bold; text-decoration: none; text-align: right; letter-spacing: 1px; margin: 0px;

bootstrap

☆樱花仙子☆ 提交于 2020-01-18 09:47:23
< ! DOCTYPE html > < html lang = "en" > < head > < meta charset = "UTF-8" > < meta name = "viewport" content = "width=device-width, initial-scale=1.0" > < meta http - equiv = "X-UA-Compatible" content = "ie=edge" > < title > Document < / title > < link rel = "stylesheet" href = "../static/css/bootstrap.min.css" > < style > div { border : 1 px solid red ; } < / style > < / head > < body > < div class = "container" style = "height : 2000 px ; background - color : lightblue ; " > < div class = "row" > < div class = "col-xs-12 col-sm-6 col-md-6" > . col - md - 6 < / div > < div class = "col-xs-12