湖南传媒职业技术学院:如何用asp循环显示字体的由大到小的显示?
字体大小由大到小的从6号字显示到1号字,怎样来用asp循环语句来写呢?
谢谢大家,急需!
根据你的要求,以及参考上面几位的回答,经过总结,给出几个答案:
1.
<%
for i=6 to 1 step -1
response.write "<font size="&i&">欢迎你来到本站!</font><br>"
next
%>
2.
<%
Dim i
i=6
while i>0
response.write "<font size="&i&">欢迎你来到本站!</font><br>"
i=i-1
wend
%>
3.
<%
Dim i
i=6
do while i>0
response.write "<font size="&i&">欢迎你来到本站!</font><br>"
i=i-1
loop
%>
<%
for i=6 to 1 step -1
response.write "<h"&i&">欢迎你来到本站!</h"&i&">"
next
反过来
for i=1 to 6
response.write "<h"&i&">欢迎你来到本站!</h"&i&">"
next
%>
除了用上面的for循环还可以用do...while和while循环
<%Dim i
i=1
do while i<7
response.write "<font size="&i&">欢迎你来到本站!<font><br />"
i=i+1
loop%>
<%Dim i
i=1
while i<7
response.write "<font size="&i&">欢迎你来到本站!<font><br />"
i=i+1
wend%>
<%
for i=6 to 1 step -1
response.write "<font size='" & i & "'>欢迎</font><br>"
next
%>
for i=1 to 24
response.write "<font size="&i&">欢迎你来到本站!<font>"
next
牛B
我顶