kamirura
05-10-2011, 08:44 AM
Im trying to change the background color of my news posts for the main page.
What I want is to have every second post a darker grey than the one before.
In my css file Ive added the following lines to accomplish this. Sectiontable1 and 2 beeing the different posts.
Code:
.sectiontableentry,
.sectiontableentry0 { padding: 5px; }
.sectiontableentry1 {
border-bottom: 1px solid #ccc;
padding: 5px;
background-color: #ffffff;
}
.sectiontableentry2 {
border-bottom: 1px solid #ccc;
padding: 5px;
background-color: #f6f6f6;
}
The code look like this(see below) when inspecting in the browser and I can cleary see that there is a blank space in between the class name and the number. But the problem is I have no clue how I can write that space in css. Cause if I just add a blank space in the css it thinks its another class or rather a standard tag like h1 and it doesnt work. Is there some way to write a space like that in css?
Code:
<span class=contentpane>
<div class=sectiontableentry 1></div>
<div class=sectiontableentry 2></div>
<div class=sectiontableentry 1></div> /* see there is a space between sectiontableentry and 1*/
</span>
What I want is to have every second post a darker grey than the one before.
In my css file Ive added the following lines to accomplish this. Sectiontable1 and 2 beeing the different posts.
Code:
.sectiontableentry,
.sectiontableentry0 { padding: 5px; }
.sectiontableentry1 {
border-bottom: 1px solid #ccc;
padding: 5px;
background-color: #ffffff;
}
.sectiontableentry2 {
border-bottom: 1px solid #ccc;
padding: 5px;
background-color: #f6f6f6;
}
The code look like this(see below) when inspecting in the browser and I can cleary see that there is a blank space in between the class name and the number. But the problem is I have no clue how I can write that space in css. Cause if I just add a blank space in the css it thinks its another class or rather a standard tag like h1 and it doesnt work. Is there some way to write a space like that in css?
Code:
<span class=contentpane>
<div class=sectiontableentry 1></div>
<div class=sectiontableentry 2></div>
<div class=sectiontableentry 1></div> /* see there is a space between sectiontableentry and 1*/
</span>