你说的是响应式设计吧?bootstrap框架有专门的语言,但是css也可以实现。写两个css文件用于定义样式(包括不同大小)的p;然后引入;代码如下: <link rel="stylesheet" type="text/css" href="minscreen.css" media="screen and (max-width:899px) and (min-width:500px)"> <link rel="stylesheet" type="text/css" href="midscreen.css" media="screen and (max-width:1400px) and (min-width:900px)"> 其中href是css文件的路径,css文件的名字自定义;media=窗口大小区间;
加个闭包立即执行,或者 autoResize()写在外面跑一下
resize() 方法监控
你说的是响应式设计吧?bootstrap框架有专门的语言,但是css也可以实现。写两个css文件用于定义样式(包括不同大小)的p;然后引入;代码如下:
<link rel="stylesheet" type="text/css" href="minscreen.css" media="screen and (max-width:899px) and (min-width:500px)">
<link rel="stylesheet" type="text/css" href="midscreen.css" media="screen and (max-width:1400px) and (min-width:900px)">
其中href是css文件的路径,css文件的名字自定义;media=窗口大小区间;