查看完整版本 : 【求助】附加CSS 問題
因為小弟想在首頁的右方加入廣告
所以改法如下
修改模板
header
<td background="$stylevar[imgdir_misc]/top_splashbg.gif"><img src="$stylevar[imgdir_misc]/top_splash.gif" width="557" height="85" /></td>
替代為
<td background="$stylevar[imgdir_misc]/top_splashbg.gif"><div style="float:left"><img src="$stylevar[imgdir_misc]/top_splash.gif" width="557" height="85" /></div>
<!--ad-->
<div id=randlogo>
<SCRIPT Language="JavaScript">
var how_many_ads = 3;
var now = new Date()
var sec = now.getSeconds()
var ad = sec % how_many_ads;
ad +=1;
if (ad==1) {
txt="****";
url="****";
alt="****";
banner="****";
width="300";
height="83";
}
if (ad==2) {
txt="****";
url="****";
alt="****";
banner="****";
width="400";
height="83";
}
if (ad==3) {
txt="****";
url="****";
alt="****;
banner="****";
width="300";
height="83";
}
document.write('<center>');
document.write('<a href=\"' + url + '\" target=\"_blank\">');
document.write('<img src=\"' + banner + '\" width=')
document.write(width + ' height=' + height + ' ');
document.write('alt=\"' + alt + '\" border=0><br>');
document.write('</center>');
</SCRIPT>
</div>
附加css 定義
#randlogo {float:right;position:relative;margin:0 auto;background:transparent;height:82px;width:450px;top:3px}
請問是要怎麼修改呢
備註:風格使用SMOOTHBLUE
yoching
2007-04-17, 01:37 AM
看了一下你的寫法。就知道這樣不是正統的寫法。當然會出問題了。
首先~~你等於是要原來的表格要多增加一個欄位。但並沒看到你有新增加的td語法。
再來就是。圖片本身的寬度就很大了。這樣也容易造成排版不容易。(指向圖片中有設定寬度557。就快佔一大半去了)
解決的方式你得將圖片改掉。正常來講這張圖片應該是logo圖。可是我記得logo圖很少那麼大的。所以我並沒辦法知道你這張圖是什麼。可以的話你給我top_splash.gif這張圖。
另外發現這還有指定一個背景圖。背景圖有分材質性的跟固定性的。材質性的比較沒有問題。固定性的就會比較麻煩。不過還是可以處理。
我可以幫你改良。不過我需要top_splash.gif跟top_splashbg.gif這兩個圖片。這樣我才能知道該怎麼幫你改。才是比較好的。
另外我發現。你這是輪放式廣告圖片吧。我記得有更好的寫法才對。不過算了。
如果想自已研究的話。可試試將程式改成以下這樣。
不過我不保証能成功。
<td background="$stylevar[imgdir_misc]/top_splashbg.gif"><div style="float:left"><img src="$stylevar[imgdir_misc]/top_splash.gif" width="557" height="85" /></div>
<td background="$stylevar[imgdir_misc]/top_splashbg.gif">
<!--ad-->
<div id=randlogo>
<SCRIPT Language="JavaScript">
var how_many_ads = 3;
var now = new Date()
var sec = now.getSeconds()
var ad = sec % how_many_ads;
ad +=1;
if (ad==1) {
txt="****";
url="****";
alt="****";
banner="****";
width="300";
height="83";
}
if (ad==2) {
txt="****";
url="****";
alt="****";
banner="****";
width="400";
height="83";
}
if (ad==3) {
txt="****";
url="****";
alt="****;
banner="****";
width="300";
height="83";
}
document.write('<center>');
document.write('<a href=\"' + url + '\" target=\"_blank\">');
document.write('<img src=\"' + banner + '\" width=')
document.write(width + ' height=' + height + ' ');
document.write('alt=\"' + alt + '\" border=0><br>');
document.write('</center>');
</SCRIPT>
</div>附加css 定義
</td>
先說聲抱歉
沒看到星空老大的回文>"<
附上附件 真是麻煩您了
http://img257.imageshack.us/img257/9862/topsplashcm4.gif (http://img257.imageshack.us/img257/9862/topsplashcm4.gif)
http://img213.imageshack.us/img213/8936/topsplashbghg7.gif (http://img213.imageshack.us/img213/8936/topsplashbghg7.gif)
上面是top_splash.gif
下面是top_splashbg.gif
按照星空大哥的方法
<!--adedit-->
<td background="$stylevar[imgdir_misc]/top_splashbg.gif"><div style="float:left"><img src="$stylevar[imgdir_misc]/top_splash.gif" width="557" height="85" /></div>
<td background="$stylevar[imgdir_misc]/top_splashbg.gif">
<!--ad-->
<div id=randlogo>
<SCRIPT Language="JavaScript">
var how_many_ads = 3;
var now = new Date()
var sec = now.getSeconds()
var ad = sec % how_many_ads;
ad +=1;
if (ad==1) {
txt="我想要廣告!!";
url="http://nknush.org/showthread.php?t=726";
alt="我想要廣告!!";
banner="http://ck.tp.edu.tw/~ck940490/vb/banner/banner000.jpg";
width="300";
height="83";
}
if (ad==2) {
txt="我想要廣告!!";
url="http://nknush.org/showthread.php?t=726";
alt="我想要廣告!!";
banner="http://ck.tp.edu.tw/~ck940490/vb/banner/banner000.jpg";
width="300";
height="83";
}
if (ad==3) {
txt="我想要廣告!!";
url="http://nknush.org/showthread.php?t=726";
alt="我想要廣告!!";
banner="http://ck.tp.edu.tw/~ck940490/vb/banner/banner000.jpg";
width="300";
height="83";
}
document.write('<center>');
document.write('<a href=\"' + url + '\" target=\"_blank\">');
document.write('<img src=\"' + banner + '\" width=')
document.write(width + ' height=' + height + ' ');
document.write('alt=\"' + alt + '\" border=0><br>');
document.write('</center>');
</SCRIPT>
</div>
</td>
<!--ad-->
附加css
#randlogo {float:right;position:relative;margin:0 auto;background:transparent;height:82px;width:450px;top:1px}
產生的結果如下...
上面多出了一個空白@@"
yoching
2007-05-02, 08:27 AM
看樣子有比之前好了。那多的空白因該是td分割欄位沒做對應造成。
這樣子好了~~~你把header的完整內容給我。我一次修改好之後再給你。
現在有圖了也比較好處理
luoxiaosang
2010-08-13, 11:51 AM
When I archlord money (http://www.archlord-money.com), was about 13, my parents decided to buy an old house in the country. They found an old school house for sale and the main quarters were the headmaster’s house. The headmaster’s house being the larger of the two was the one we lived in. The school house was used as guest accommodation when family and friends came to visit. I loved living there because whenever I had friends stay over, we could use the school house unsupervised and because the place had a kitchen and a bathroom we never had to go to the main archlord money house.
This one dog clothes (http://www.dogsmartway.com),night in particular I had two people staying in the house with me my best friend Sandy and my cousin Shane. We collected all the things we would need for the night and set up our sleeping bags in the middle of the room. We talked until the early hours of the morning, and as we were all getting sleepy we thought it was a good time to say goodnight. We were doing our rip-off of the Waltons "good night Jim Bob, etc." when I saw something out the corner of my eye. It was one green orb about the size of a small dinner plate and it went from one side of the room straight over to the fire place and just stopped. My friends had also noticed and we were all whispering, "What is dog clothes that?"
Feeling unusually maple story mesos (http://www.maplestorymesosshop.com),brave, I decided to prove that it was the moon because that’s all it could have been; we were out in the middle of nowhere and there were no lights of any kind. I got up and went to look out the window. But there was no light source; the moon was behind the clouds and outside was pitch maple story mesos black.
Just as I was flyff penya (http://www.flyff-penya-store.com), about to say this, all the windows in the room started to shake and the orb was changing in colour from green to orange to red and getting brighter all the time. I backed away from the windows and sat back down between my two friends, trying to hide the fact that I was flyff penya petrified.
When all last chaos gold (http://www.last-chaos-gold.com),the shaking stopped and the place calmed down, my cousin dared me to go and see if I could touch the orb. A dare is a dare so I accepted. I got up and somehow made my feet walk over to the orb. I reached up and it disappeared. yelling at us for making so much noise and waking him up. He said it sounded like we were banging on the walls and he also said he could see lights on in the school house. But he said it was when we started screaming that he really got fed up and decided to tell us to shut up and go to last chaos gold bed.
We tried Designer Glasses (http://www.glassesale.com),to convince him that we hadn’t done anything, that we hadn’t even made a noise, but he didn’t belive us. We didn’t see any point in arguing, so we called it a night we decided to take our chances in the school house because dad was to mad to reason with.After he left, I felt the immediate need to go to the bathroom. I put the light on and made my friends stand lookout on the other side of the door. Just as I sat down, the darn thing flushed and I nearly hit the roof. I don’t know how it happened, but I didn’t hang around to find out. I went outside instead. We stayed awake until it was morning and I haven’t slept in there Designer Glasses since.
vBulletin® v3.7.3,版權所有 ©2000-2010,Jelsoft Enterprises Ltd.