是否可以通过CSS使所有h3元素都属于responsive-heading类。要更好地了解我要实现的目标,请参阅下面的CSS代码:
h3 { .responsive-heading }
/* The class responsive-heading is implemented inside another CSS file and its contents are:
.responsive-heading { font-size: 30px; .... etc. }
*/
我知道我可以使用Javascript和/或JQuery为每个h3分配类.responsive-heading,
我想做的是:制作一个全宽的图片作为网站的介绍,然后,当用户滚动时,图像慢慢地滑走。我已经把所有事情都做好了,我的问题只是关于一个细节。这是javascript代码
<script type="text/javascript">
(function() {
var introEl = $('div.intro'), //where intro is the full width div
introHeadingH = introEl.find('h1').height(),
我想使用JavaScript来操作我的CSS。首先,它被认为是一个很好的小脚本,可以为我的手风琴菜单尝试不同的颜色,以及不同的背景/标题-/内容-/...背景-输入字段中的颜色。
我了解如何使用js获取输入值。
我了解如何使用getElementById()、getElementsByClassName()、getElementsByTag()和getElementsByName()来操作CSS。
现在,问题是我的CSS看起来像这样:
.accordion li > a {
/* some css here */
}
.sub-menu li a {
/* some css here