search
HomeWeb Front-endCSS TutorialHow to modify css in dedecms

How to modify css in dedecms

May 28, 2019 am 09:49 AM
css

Dreamweaver DedeCMS Modify Template Default CSS File Analysis: First, open the background-template-default template management-index.htm.

I saw a sentence, Explanation, our template is based on this CSS to layout the web page , so we open templets\style\dedecms.css under the website directory. Then let’s analyze the composition of CSS.

How to modify css in dedecms

We study CSS based on the calls on the homepage so that it is easy to understand. We open the homepage template and find:

/*This sentence controls all structural styles except the website header and friendly links*/

So what is defined by w960 center clear mt1? We open DEDECMS.CSS and look for the relevant definitions.

/*---------- stock ---------*/ 
.center{ 
    margin:0px auto; 定义了CSS模块的边缘位置都是0,也就是这个center的层 距离上右下左都是0px;
} 
.w960{ 
    width:960px; 定义了整体的宽度为960px;
    /*position:relative;*/ 
} 
.pright .infos_userinfo { 
    margin-bottom: 0px; 定义了首页右部下的 互动中心的下面边缘为0px;
} 
.mt1{/* ( margin-top * 1 ) */ 
    margin-top:8px; 定义了mt1的顶部边缘为8px;
} 
.pright .mt1{ 
    margin-top:0px; 定义了pright 下面的mt1顶部边缘为0px;
} 
.mt2{/* ( margin-top * 2 ) */ 
    margin-top:16px; 顶部边缘为16px;
} 
.clear{ 
    overflow:hidden; 如果clear层里面的内容超出了 层的范围 就隐藏起来。
} 
    
         <div class="pleft">这个pleft 的定义 没有在dedecms.css 中,但是我们会发现一句话
@import url("layout.css");
@import url("page.css");
这说明,在dedecms.css 中引用了 page.css 和layout.css 这两个样式表,于是我们就在page.css 中找到了pleft 的定义
.pleft{
width:712px;定义了宽度
float:left;该层向左浮动
overflow:hidden;超出范围则隐藏
}
    <div class="bignews">
     在该层下面调用的是新闻头条的内容,看看它的css
.index .bignews{
width:424px;
height:400px;
float:right; 向右浮动
border:1px solid #DFF2F5;表示边框线用 #dff2f5的实体颜色填充
background:url(../images/headbg-top.gif) repeat-x;背景图片为 headbg-top.gif   并且横向平铺
overflow:hidden;超出则隐藏。
}
所以,我们看到头条的这部分是在flash幻灯片右边显示,并且加上了浅蓝色的边框线。
    <!--头条-->
        <div class="onenews">       再来看看 onenews是如何定义的。
        .index .bignews .onenews{
margin:0 3px 0 3px; 左右外边距分别空3个像素
padding:7px 6px;上左内边距分别空7,6个像素
border-bottom:1px dashed #EBEBEB;下边框加一个 #ebebeb的虚线
}
所以我们看见头条的文章左右都有一定的距离,并且下面还有一个虚线显示       
</div>
      <!-- /onenews -->
          这个下面调用的是以往的头条,默认的有4篇文章,调用了d1 d1arc 2个css
.index .bignews div.d1{
padding:6px 10px;
clear:both;这句话是清除浮动,如果不加它,大家可以试试看,是不是 d1 这个层就跑到 头条的右边了。
width:406px;
overflow:hidden;
}
.index .bignews div.d1arc{
margin-right:12px;
width:190px;
float:left;因为此时要调用4篇文章,改文章是2*2排列的,如果不加这个属性,新闻就应该垂直排列了(因为你刚才用clear:both 清除浮动啦),大家试试看是不是这样的。
height:24px;
line-height:24px;行间距,即字体最底端与字体内部顶端之间的距离
overflow:hidden;
}
      <!--/头条-->
        <div class=&#39;newarticle&#39;>最新文章</div>
下面看看 newarticle 这个css吧,还是拿快学网的首页举例子,上面的这句是用来显示 “最近更新”那几个绿颜色字的,看看它是怎么定义的。    
   .index .bignews div.newarticle{
height:24px; 高度
background:url(../images/new-article.gif) 8px 3px no-repeat;背景图片在x轴8px 和y轴3px出出现
font-size:0px;
color:#fff;
}    所以,我们能看到那个 最近更新 并且还有一个横条,其实它是个图片,大家右键图片另存为看看就知道了
<ul class="c2 ico1">
                这里面调用了 c2 和ico1 两个 css
.index .bignews ul.c2{
width:416px;
padding:0px 4px 0px; 内边距为 上0 右4下0
clear:both;清除浮动 和上面的意思一样
overflow:hidden;
}
ico1 这个css 在layout.css 中了。
.ico1 li{
padding-left:16px; 指的是 新闻列表左内边距为16px
background:url(../images/ico-1.gif) 7px 11px no-repeat; 背景在7px,11px 处出现,所以我们看到最新文章的列表左边都有一个小黑点,这个小黑点就是 ico-1.gif
}
             </ul>
           </div>
    <!-- /bignews --> 到此,中部的头条新闻和最近更新已经分析完了。
    <div class="flashnews">
           看看flash的 css 定义
.index .flashnews{
width:280px;
height:192px;
overflow:hidden;
float:left;这句决定了,flash 的新闻列表在 头条的左边显示。如果你把bignews 和flashnews 的float 属性互换一下应该是上面结果呢?大家试试看。
}
       </div>
    <!-- /flashnews -->
    <div class="latestnews">这边是特别推荐调用的样式,还是来看看css
.index .latestnews{
width:280px;
height:200px;
margin-top:8px;
float:left;
}
.index .latestnews dl dd{
padding:2px 5px;
}
.index .latestnews ul a{
color:#555;
}

The above is the detailed content of How to modify css in dedecms. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Next Level CSS Styling for CursorsNext Level CSS Styling for CursorsApr 23, 2025 am 11:04 AM

Custom cursors with CSS are great, but we can take things to the next level with JavaScript. Using JavaScript, we can transition between cursor states, place dynamic text within the cursor, apply complex animations, and apply filters.

Worlds Collide: Keyframe Collision Detection Using Style QueriesWorlds Collide: Keyframe Collision Detection Using Style QueriesApr 23, 2025 am 10:42 AM

Interactive CSS animations with elements ricocheting off each other seem more plausible in 2025. While it’s unnecessary to implement Pong in CSS, the increasing flexibility and power of CSS reinforce Lee's suspicion that one day it will be a

Using CSS backdrop-filter for UI EffectsUsing CSS backdrop-filter for UI EffectsApr 23, 2025 am 10:20 AM

Tips and tricks on utilizing the CSS backdrop-filter property to style user interfaces. You’ll learn how to layer backdrop filters among multiple elements, and integrate them with other CSS graphical effects to create elaborate designs.

SMIL on?SMIL on?Apr 23, 2025 am 09:57 AM

Well, it turns out that SVG's built-in animation features were never deprecated as planned. Sure, CSS and JavaScript are more than capable of carrying the load, but it's good to know that SMIL is not dead in the water as previously

'Pretty' is in the eye of the beholder'Pretty' is in the eye of the beholderApr 23, 2025 am 09:40 AM

Yay, let's jump for text-wrap: pretty landing in Safari Technology Preview! But beware that it's different from how it works in Chromium browsers.

CSS-Tricks Chronicles XLIIICSS-Tricks Chronicles XLIIIApr 23, 2025 am 09:35 AM

This CSS-Tricks update highlights significant progress in the Almanac, recent podcast appearances, a new CSS counters guide, and the addition of several new authors contributing valuable content.

Tailwind's @apply Feature is Better Than it SoundsTailwind's @apply Feature is Better Than it SoundsApr 23, 2025 am 09:23 AM

Most of the time, people showcase Tailwind's @apply feature with one of Tailwind's single-property utilities (which changes a single CSS declaration). When showcased this way, @apply doesn't sound promising at all. So obvio

Feeling Like I Have No Release: A Journey Towards Sane DeploymentsFeeling Like I Have No Release: A Journey Towards Sane DeploymentsApr 23, 2025 am 09:19 AM

Deploying like an idiot comes down to a mismatch between the tools you use to deploy and the reward in complexity reduced versus complexity added.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

Atom editor mac version download

Atom editor mac version download

The most popular open source editor