I'm currently in the process of building myself a new homepage and would like to embed both a news feed and a "latest blog entry" on it.
I've been using http://feed2js.org/ to convert the RSS feeds for both a news source and my blog's Atom feed.
However, I am getting stuck on how to apply two different CSS styles to the two page elements.
How do I do that?
CSS & RSS
Wrap your Feed2JS tags in a div with a classname, and then use that classname to select your different style rules.
Code: Select all
<div class="feed_one"><script src="http://feed2js.org//feed2js.php?src=..."></script><noscript>...</noscript></div>
<div class="feed_two"><script src="http://feed2js.org//feed2js.php?src=..."></script><noscript>...</noscript></div>
<style>
div.feed_one .rss_box { border: 2px solid #f0f; }
div.feed_two .rss_box { border: 2px solid #4f0; }
</style>
Hasn't worked
Apologies I'm really crap at basic coding, more of a WYSYWYG person myself.
I've put div tags round the two scripts as instructed, and named them "news" and "blog" respectively, and inserted your code into my CSS sheet, but the blog script is still showing at the same width and with the same fonts/sizes as the news script.
Here is what I have in my CSS style sheet:
div.news
.rss-box {
margin: 0em;
width: 400px;
background-color: #FFFFFF;
border: 0px dashed #240;
}
.rss-items {
font-family: Georgia, sans-serif;
margin-top:0px;
margin-bottom:10px;
font-size: 14pt;
padding:0em; 5em;
margin-left:0px;
color:#000000;
}
.rss-item {
font-family: Trebuchet MS, sans-serif;
font-size: 10pt;
font-weight : normal;
list-style:none;
padding-bottom:20px;
color:#000000;
}
.rss-item a {
text-decoration : none;
color: black;
font-size: 14pt;
font-weight:light;
font-family: Georgia, sans-serif;
margin-bottom:20px
color:#000000;
}
.rss-item a:visited {
color:white;
}
.rss-date {
font-size: 10pt;
font-weight : normal;
color: black;
padding-bottom:10px;
}
div.blog
.rss-box {
margin: 0em;
width: 200px;
background-color: #FFFFFF;
border: 0px dashed #240;
}
.rss-items {
font-family: Georgia, sans-serif;
margin-top:0px;
margin-bottom:10px;
font-size: 14pt;
padding:0em; 5em;
margin-left:0px;
color:#000000;
}
.rss-item {
font-family: Trebuchet MS, sans-serif;
font-size: 10pt;
font-weight : normal;
list-style:none;
padding-bottom:20px;
color:#000000;
}
.rss-item a {
text-decoration : none;
color: black;
font-size: 14pt;
font-weight:light;
font-family: Georgia, sans-serif;
margin-bottom:20px
color:#000000;
}
.rss-item a:visited {
color:white;
}
.rss-date {
font-size: 10pt;
font-weight : normal;
color: black;
padding-bottom:10px;
}
I expect I don't need half of that, but there we go.

I've put div tags round the two scripts as instructed, and named them "news" and "blog" respectively, and inserted your code into my CSS sheet, but the blog script is still showing at the same width and with the same fonts/sizes as the news script.
Here is what I have in my CSS style sheet:
div.news
.rss-box {
margin: 0em;
width: 400px;
background-color: #FFFFFF;
border: 0px dashed #240;
}
.rss-items {
font-family: Georgia, sans-serif;
margin-top:0px;
margin-bottom:10px;
font-size: 14pt;
padding:0em; 5em;
margin-left:0px;
color:#000000;
}
.rss-item {
font-family: Trebuchet MS, sans-serif;
font-size: 10pt;
font-weight : normal;
list-style:none;
padding-bottom:20px;
color:#000000;
}
.rss-item a {
text-decoration : none;
color: black;
font-size: 14pt;
font-weight:light;
font-family: Georgia, sans-serif;
margin-bottom:20px
color:#000000;
}
.rss-item a:visited {
color:white;
}
.rss-date {
font-size: 10pt;
font-weight : normal;
color: black;
padding-bottom:10px;
}
div.blog
.rss-box {
margin: 0em;
width: 200px;
background-color: #FFFFFF;
border: 0px dashed #240;
}
.rss-items {
font-family: Georgia, sans-serif;
margin-top:0px;
margin-bottom:10px;
font-size: 14pt;
padding:0em; 5em;
margin-left:0px;
color:#000000;
}
.rss-item {
font-family: Trebuchet MS, sans-serif;
font-size: 10pt;
font-weight : normal;
list-style:none;
padding-bottom:20px;
color:#000000;
}
.rss-item a {
text-decoration : none;
color: black;
font-size: 14pt;
font-weight:light;
font-family: Georgia, sans-serif;
margin-bottom:20px
color:#000000;
}
.rss-item a:visited {
color:white;
}
.rss-date {
font-size: 10pt;
font-weight : normal;
color: black;
padding-bottom:10px;
}
I expect I don't need half of that, but there we go.