#scrolling_1 { width:635px; height:240px; overflow:hidden; padding:1px; border:1px solid #999; margin:0 auto; text-align: left; }#scrollnews_1 { position:absolute; width:645px; height:240px; overflow:hidden; display:inline; top:1; left:1; }#scrollnews_con_1 { width:645px; overflow:hidden; }#scrolling_1 ul { display:block; height:240px; width:645px; }#scrolling_1 ul li { height: 240px; width: 205px; float: left; overflow:hidden; display: inline; margin-right: 10px; }這個我想給PHP變數付值後輸出。這麼寫了以後,不正常了。我該怎麼寫呢?
回複討論(解決方案)
for (i=0 ;i=100; i++) {
迴圈寫錯了吧
變數前面要加$
即
for ($i=0 ;$i=100; $i++) {
呵呵,
上面的代碼寫錯了。
我從新寫了。
#scrolling_1 { width:635px; height:240px; overflow:hidden; padding:1px; border:1px solid #999; margin:0 auto; text-align: left; }#scrollnews_1 { position:absolute; width:645px; height:240px; overflow:hidden; display:inline; top:1; left:1; }#scrollnews_con_1 { width:645px; overflow:hidden; }#scrolling_1 ul { display:block; height:240px; width:645px; }#scrolling_1 ul li { height: 240px; width: 205px; float: left; overflow:hidden; display: inline; margin-right: 10px; }這個我想給PHP變數付值後輸出。這麼寫了以後,不正常了。我該怎麼寫呢?
echo "****引號位置錯了吧?? $i沒用到 輸出100個同樣的樣式?
呵呵,
上面的代碼寫錯了。
我從新寫了。
#scrolling_1 { width:635px; height:240px; overflow:hidden; padding:1px; border:1px solid #999; margin:0 auto; text-align: left; }#scrollnews_1 { position:absolute; width:645px; height:240px; overflow:hidden; display:inline; top:1; left:1; }#scrollnews_con_1 { width:645px; overflow:hidden; }#scrolling_1 ul { display:block; height:240px; width:645px; }#scrolling_1 ul li { height: 240px; width: 205px; float: left; overflow:hidden; display: inline; margin-right: 10px; }這個我想給PHP變數付值後輸出。這麼寫了以後,不正常了。我該怎麼寫呢?
你下面那些直接寫在裡面?
不用雙引號
ID只能使用一次,你迴圈到第二次的時候,怎麼可能再使用呢?
你的迴圈沒什麼用啊
重複輸出統一的樣式表 ? 不知道你要幹什麼,先把問題理清楚吧。