老阿姐 發表於 2023-10-6 00:00:00

dedecms列表页缩略图大小控制的方法

<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        dede列表页缩略图大小控制的方法,列表开始</p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
         </p>
<div class="msgheader" style='margin: 3px auto 0px; padding: 0px 3px; outline: none; line-height: 21.6px; clear: both; border-width: 1px; border-style: solid; border-color: rgb(0, 153, 204); background: rgb(246, 251, 255); overflow: hidden; font-family: tahoma, arial, "Microsoft YaHei";'>
        <div class="right">
                <span><u>复制代码</u></span>
</div>
        代码如下:</div>
<div class="msgborder" id="phpcode1" style='margin: 0px auto 3px; padding: 0px 3px; outline: none; line-height: 25.2px; font-size: 14px; clear: both; border-right: 1px solid rgb(0, 153, 204); background: rgb(221, 237, 251); overflow: hidden; border-left: 1px solid rgb(0, 153, 204); word-break: break-all; border-bottom: 1px solid rgb(0, 153, 204); word-wrap: break-word; font-family: tahoma, arial, "Microsoft YaHei";'>
        <br>
        {dede:list pagesize='10'} ----调用的条数10条---<br>
        &lt;li&gt; <br>
        @me = (empty(@me['litpic']) ? "" : "&lt;a &lt;a href="mailto:href='{@me['arcurl']}'"&gt;href='{@me['arcurl']}'&lt;/a&gt; class='preview'&gt;&lt;img &lt;a href="mailto:src='{@me['litpic']}'/&gt;&lt;/a"&gt;src='{@me['litpic']}'/&gt;&lt;/a&lt;/a&gt;&gt;"); <br>
        ---这里控制的是缩略图----如果要控制<u>图片</u>的高度需要修改: &lt;img &lt;a href="mailto:src='{@me['litpic']}'"&gt;src='{@me['litpic']}'&lt;/a&gt; 这里现在的是宽度:<br>
        img &lt;a href="mailto:src='{@me['litpic']}'"&gt;src='{@me['litpic']}'&lt;/a&gt; iwidth='300' height='370' 这里控制了宽度的大小,以及高度<br>
        --------------------------------------<br>
        [&lt;b&gt;&lt;/b&gt;] ----这里控制的是栏目----<br>
        &lt;a href="" class="title"&gt;&lt;/a&gt; ---这里控制的是标题,标题链接----<br>
        &lt;span class="info"&gt; -----这里控制的是描述<br>
        &lt;small&gt;日期:&lt;/small&gt; &lt;small&gt;点击:&lt;/small&gt; &lt;small&gt;好评:&lt;/small&gt; &lt;/span&gt;<br>
        &lt;p class="intro"&gt; ... &lt;/p&gt; ----描述-----<br>
        &lt;/li&gt;<br>
        {/dede:list}</div>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
         </p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        <br>
        如果要控制图片的高度需要修改:</p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        <strong>方法1:</strong></p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        这个模板的图片大小控制是由CSS控制的<br>
        要修改CSS<br>
        右边图片区域修改<br>
        templets/style/picture.css文件<br>
        .pbox 样式<br>
        如图片大小<br>
        .pbox dl dt{<br>
        width:188px;<br>
        height:132px;<br>
        display:block;<br>
        overflow:hidden;<br>
        }<br>
        .pbox dl dt a img{<br>
        display:block;<br>
        width:expression(this.width &gt; this.height &amp;&amp; this.width &gt;176 ? 176 : true);<br>
        height:expression(this.height &gt; this.width &amp;&amp; this.height &gt; 132? 132 : true);<br>
        max-width:176px;<br>
        max-height:132px;<br>
        margin:0px auto 0px;<br>
        }</p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        <strong>方法2:</strong></p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        {dede:list pagesize='15' imgwidth='100' imgheight='70' infolen='180'}</p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        <strong>方法3:</strong></p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        把调用代码中标签换成<br>
        &lt;a href='' target="_blank"&gt;&lt;img src='' border='0' width='' height=''&gt;&lt;/a&gt;</p>
頁: [1]
查看完整版本: dedecms列表页缩略图大小控制的方法