PHP變數中加CSS代碼。

來源:互聯網
上載者:User
#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只能使用一次,你迴圈到第二次的時候,怎麼可能再使用呢?

你的迴圈沒什麼用啊

重複輸出統一的樣式表 ? 不知道你要幹什麼,先把問題理清楚吧。


  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.