最近有朋友问如何去掉 Discuz!NT 默认的广告样式里的那张小 AD 图片,其实不用改代码,这是样式表控制了,找到你当前使用的网站模板,我的是默认的,所以就在 templates/default/ 里有个dnt.css文件,打开后找到下面这段代码:
- /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Advertisments ~~~~ */
- #ad_headerbanner { float: right; margin-top: 4px; }
- .ad_text { border: 1px solid #DCE6F1; margin-bottom: 10px; padding: 6px; background: #FFF url(images/portalbox_bg.gif); background-repeat: repeat-x; }
- .ad_text table { width: 100%; border-collapse: collapse; }
- .ad_text td { background-repeat: repeat-x; background-position: 0 0; padding: 2px 10px; }
- .ad_textlink1 { float: left; white-space: nowrap; }
- .ad_textlink2 { margin: 10px; }
- .ad_textlink1,.ad_textlink2 { padding-left: 25px; background: url(images/ad_icon.gif) no-repeat 0 50%; }
- .ad_pip { clear: right; float: right; display: inline; margin: 10px 10px 10px; }
- .ad_topicrelated { clear: both; float: right; display: inline; margin: 0 10px 10px; padding: 10px 10px 10px 30px; border: 1px solid #78A73D; background: #CAEEC0; }
- .ad_column { text-align: center; margin-bottom: 10px; }
- .ad_footerbanner { text-align: center; clear: both; margin:5px; }
复制代码这是控制广告样式的CSS,将里面的.ad_textlink相关样式去掉或修改即可,改后如下:
-
- /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Advertisments ~~~~ */
- #ad_headerbanner { float: right; margin-top: 4px; }
- .ad_text { border: 1px solid #DCE6F1; margin-bottom: 10px; padding: 6px; background: #FFF url(images/portalbox_bg.gif); background-repeat: repeat-x; }
- .ad_text table { width: 100%; border-collapse: collapse; }
- .ad_text td { background-repeat: repeat-x; background-position: 0 0; padding: 2px 10px; }
- .ad_textlink1 { float: left; white-space: nowrap; }
- .ad_pip { clear: right; float: right; display: inline; margin: 10px 10px 10px; }
- .ad_topicrelated { clear: both; float: right; display: inline; margin: 0 10px 10px; padding: 10px 10px 10px 30px; border: 1px solid #78A73D; background: #CAEEC0; }
- .ad_column { text-align: center; margin-bottom: 10px; }
- .ad_footerbanner { text-align: center; clear: both; margin:5px; }
复制代码当然你也可以根据自己的喜好修改,完工

文/cobra 出处/
拼吾爱程序人生