这可能是一堆你无法理解的蠕虫。我只是想知道,如果有写CSS样式,以避免我贴在下面的一塌糊涂一个更好的办法...这个CSS代码可以被压缩吗?
.Cool .Caption, .CoolL .Shadow2, .CoolR .Shadow2, .NoteL, .NoteR { background: #fefeee; color: #900; }
.Black, .Black.Caption, .CoolL .Black, .CoolR .Black, .NoteL.Black, .NoteR.Black { background: #000; color: #fff; }
.Blue, .Blue.Caption, .CoolL .Blue, .CoolR .Blue, .NoteL.Blue, .NoteR.Blue { background: #00f; color: #fff; }
.Navy, .Navy.Caption, .CoolL .Navy, .CoolR .Navy, .NoteL.Navy, .NoteR.Navy { background: #009; color: #fff; }
.Red, .Red.Caption, .CoolL .Red, .CoolR .Red, .NoteL.Red, .NoteR.Red { background: #f00; color: #fff; }
.Hot, .Hot.Caption, .CoolL .Hot, .CoolR .Hot, .NoteL.Red, .NoteR.Red { background: #f00; color: #ff0; }
.Cold, .Cold.Caption, .CoolL .Cold, .CoolR .Cold, .NoteL.Cold, .NoteR.Cold { background: #009; color: #fff; }
.White, .Caption.White, .CoolL .White, .CoolR .White, .NoteL.White, .NoteR.White { background: #fff; color: #000; }
.Yellow, .Yellow.Caption, .CoolL .Yellow, .CoolR .Yellow, .NoteL.Yellow, .NoteR.Yellow { background: #ff0; color: #000; }
.Fire, .Fire.Caption, .CoolL .Fire, .CoolR .Fire, .NoteL.Fire, .NoteR.Fire { background: #ff0; color: #f00; }
.Lime, .Lime.Caption, .CoolL .Lime, .CoolR .Lime, .NoteL.Lime, .NoteR.Lime { background: #0f0; color: #000; }
.BGNone, .divCenter.BGNone, .BGNone.Shadow2, .BGNone.Caption, .Cool .BGNone, .CoolL .BGNone, .CoolR .BGNone, .NoteL.BGNone, .NoteR.BGNone { background: none; }
为了帮助您了解什么是怎么回事,.NoteL和.NoteR简单的div设计容纳文本。 .NoteL浮动到左侧,.R到右侧。
.Cool,.CoolL和.CoolR可以包含图像,文本或两者。 .Cool是居中的,而其他的则是向左或向右漂移。浮动版本还包含div(Shadow2类),它们被偏移以产生阴影效果。
这里是包含图像的.Cool DIV的一个例子:
<div class="CoolL">
<div class="Shadow2"><img src=""></div>
</div>
下面是包含图像和文本.Cool DIV:
<div class="CoolL">
<div class="Shadow2">
<img src="">
<div class="Caption Fire">Text</div>
</div>
</div>
的。注意和.Cool一系列兼具有其他属性,如填充和字体大小。在最后一个例子中,我添加了Fire类,将默认(白色背景,黑色文本)更改为带有红色文本的黄色背景。
对不起,如果我给你一罐蠕虫,但我只是想知道是否有人可以看到我正在犯的任何明显的错误。我知道编写CSS样式的一般规则,但我对最新的进展略有落后。谢谢。
您需要开始使用LESS或SCSS。 –