css3 之 一行分列自适应

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/liuguichenglove/article/details/84810456

一行分列并自适应有很多方法,此次使用方法为css3的:flex-flow  属性,方法如下:

 

display: flex;
flex-flow: row;

 flex-flow取值有:

nowrap
wrap
wrap-reverse
initial
inherit
默认值是 "nowrap"

    

案例:

.container {
	margin: 0;
	padding: 0;
	display: flex;
	flex-flow: row;
	-webkit-flex-flow:row;
	padding-top: 5px;
	padding-bottom: 5px;
	margin-top: -1px;
}
.main {
	flex: 1;
	-webkit-flex:1;
	color: black;
	text-align: center;
	line-height: 20px;
}
.main a {
	color: black;
}
.left img,
.main img,
.right img {
	vertical-align: middle;
}
.left {
	flex: 1;
	-webkit-flex:1;
	text-align: center;
	line-height: 20px;
}
.right {
	flex: 1;
	-webkit-flex:1;
	color: black;
	text-align: center;
	line-height: 20px;
}
.right a {
	color: black;
}

 效果(忽律两边的黑边):



 

 

 

展开阅读全文

首页调用,分列改成不分列

06-29

本人才学ASP,从网上下了一个源代码学习,这个代码里是分列有图片的,我想把它改成不分列,即只有一列下来,还有,把其中的图片改大一些,请教各位大侠怎么改啊           rnrnsub jsbigclass3rn javastr="document.write('" rn if RSCount>0 thenrn dim model,picid rn tr=0rn javastr=javastr+" "rn for i=1 to RSCountrn BigClassName=ArrayBigClassName(i)rn if ArrayBigClassType(i)=1 and ArrayBigClassView(i)=1 thenrn tr=tr+1rn sql="select newsid from News where BigClassName='" & BigClassName &"' and checked=1"rn rs.open sql,conn,1,1rn totalNews=rs.recordcountrn rs.close rn sql="select top 1 newsid,model from News where BigClassName='" & BigClassName &"' and checked=1 and image>0 order by updatetime desc"rn rs.open sql,conn,1,1rn if not rs.eof thenrn model=rs("model")rn picid=rs("newsid")rn elsern picid=""rn end ifrn rs.close rn sql="select newsid from News where BigClassName='" & BigClassName &"' and OnTop=1 and checked=1"rn rs.open sql,conn,1,1rn totalontop=rs.recordcountrn rs.closern classurl="BigClass.asp?BName="&BigClassName&"&Template="&ArrayBigTemplate(i)rn if tr mod 2=1 then javastr=javastr+" " rn javastr=javastr+" "rn javastr=javastr+" "rn javastr=javastr+TTitle("center_2",BigClassName)rn javastr=javastr+"');"&vbcrlfrn javastr=javastr+"document.write('" rn javastr=javastr+" "rn if showClassImg=1 and picid<>"" thenrn javastr=javastr+" "rn javastr=javastr+imagefile(picID,1,40,50)rn javastr=javastr+""rn end ifrn javastr=javastr+" "rn msql=NoContent&" from News where BigClassName='" & BigClassName &"' and checked=1 "rn if totalontop=0 thenrn Thissql="select top " & MaxNewsList & msql & " order by updatetime DESC"rn showontop=""rn javastr=javastr+ClassTitle3(Thissql,picID)rn end ifrn if totalontop>=MaxNewsList thenrn Thissql="select top " & MaxNewsList & msql & " and OnTop=1 order by updatetime DESC"rn showontop="¡ü" rn javastr=javastr+ClassTitle3(Thissql,picID) rn end if rn if totalontop>0 and totalontop"rn rn javastr=javastr+" "rn if tr mod 2=0 thenrn javastr=javastr+""rn elsern if i=RSCount then javastr=javastr+""rn end ifrn javastr=javastr+"');"&vbcrlfrn '//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// rn if tr=2 then javastr=javastr+"document.write(' "&jsad("Ê×Ò³´óÀàÒ»ÅÅÏÂ")&"');"&vbcrlfrn if tr=4 then javastr=javastr+"document.write(' "&jsad("Ê×Ò³´óÀà¶þÅÅÏÂ")&"');"&vbcrlfrn if tr=6 then javastr=javastr+"document.write(' "&jsad("Ê×Ò³´óÀàÈýÅÅÏÂ")&"');"&vbcrlfrn if tr=8 then javastr=javastr+"document.write(' "&jsad("Ê×Ò³´óÀàËÄÅÅÏÂ")&"');"&vbcrlfrn '//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// rn javastr=javastr+"document.write('"rn end if rn nextrn javastr=javastr+""rnelsern javastr=javastr+"ÉС¡ÎÞ¡¡´ó¡¡Àà"rnend ifrn javastr=javastr+"');"&vbcrlfrn dim fsrn Set fs = CreateObject("Scripting.FileSystemObject")rn Set f = fs.CreateTextFile(Server.MapPath("../js")&"/"&"bigclass3.js", True)rn f.write(javastr)rn f.closern Set f = nothingrn Set fs = nothingrn Response.Write " Ê×Ò³´óÀà(·ÖÁÐÓÐͼƬ)ÒÑÉú³É!µ÷Ó÷½·¨£º "rnEnd subrn'===========================================================================================================rnFunction ClassTitle0(strsql)rn rs.open strsql,conn,1,1rn ClassTitle0=""rn while not rs.EOFrn n=n+1rn ClassTitle0=ClassTitle0+""rn ClassTitle0=ClassTitle0+shownewfrn ClassTitle0=ClassTitle0+showTitle("MainContentB",40)&showImg&showTime(rs("updatetime"),"md")rn ClassTitle0=ClassTitle0+showclick & showOntop rn 'ClassTitle0=ClassTitle0+shownewrn ClassTitle0=ClassTitle0+""rn ClassTitle0=ClassTitle0+"';"&vbcrlfrn ClassTitle0=ClassTitle0+"html+='" rn rs.MoveNextrn wend rn rs.closernend FunctionrnrnFunction ClassTitle1(strsql)rn rs.open strsql,conn,1,1rn ClassTitle1=""rn while not rs.EOFrn n=n+1rn if n mod 2=1 then javastr=javastr+""rn ClassTitle1=ClassTitle1+""rn ClassTitle1=ClassTitle1+shownewfrn ClassTitle1=ClassTitle1+showTitle("MainContentS",20)&showImgrn ClassTitle1=ClassTitle1+showclick & showOntop rn 'ClassTitle1=ClassTitle1+shownewrn ClassTitle1=ClassTitle1+""rn if n mod 2=0 then ClassTitle1=ClassTitle1+""rn ClassTitle1=ClassTitle1+"';"&vbcrlfrn ClassTitle1=ClassTitle1+"html+='" rn rs.MoveNextrn wend rn rs.closernend FunctionrnrnFunction ClassTitle2(strsql)rn rs.open strsql,conn,1,1rn ClassTitle2=""rn while not rs.EOFrn ClassTitle2=ClassTitle2+Shownewfrn ClassTitle2=ClassTitle2+ShowTitle("MainContentS",28)rn 'ClassTitle2=ClassTitle2+ShowImgrn 'ClassTitle2=ClassTitle2+showTime(rs("updatetime"),"md")rn 'ClassTitle2=ClassTitle2+showclick & showOntoprn ClassTitle2=ClassTitle2+" "rn ClassTitle2=ClassTitle2+"';"&vbcrlfrn ClassTitle2=ClassTitle2+"html+='" rn rs.MoveNextrn wendrn rs.closernend FunctionrnrnFunction ClassTitle3(strsql,strpicid)rn dim maxlenrn rs.open strsql,conn,1,1rn ClassTitle3=""rn while not rs.EOFrn maxlen=34rn if showClassImg=1 and strpicid<>"" then maxlen=28 rn if showOntop<>"" then maxlen=maxlen-2rn if rs("image")>0 then maxlen=maxlen-4rn if showClassImg=0 or strpicid="" then ClassTitle3=ClassTitle3+" "rn ClassTitle3=ClassTitle3+Shownewf rn ClassTitle3=ClassTitle3+ShowTitle("MainContentS",maxlen)rn ClassTitle3=ClassTitle3+ShowImgrn 'ClassTitle3=ClassTitle3+showTime(rs("updatetime"),"md")rn ClassTitle3=ClassTitle3+Showclickrn ClassTitle3=ClassTitle3+showOntoprn ClassTitle3=ClassTitle3+" "rn ClassTitle3=ClassTitle3+"');"&vbcrlfrn ClassTitle3=ClassTitle3+"document.write('" rn rs.MoveNextrn wendrn rs.closernend Function 论坛

没有更多推荐了,返回首页