• Before posting a question, please check our Frequently Asked Questions page as well as previous threads here. Odds are you aren't the first to ask, and you may find the answer without having to post!

CSS Source Threads Override

Fable

₮ⱧɆ ₥Ɏ₮Ⱨ, ₮ⱧɆ ⱠɆ₲Ɇ₦Đ, ₮ⱧɆ ₣₳฿ⱠɆ
Roleplay Availability
Roleplay Type(s)
So, I am working on CSS in my private workshop.  I tend to use div class tags for a majority of what I code, and if I create a main box div tag, I use that tag in other version with a main box.  I discovered while doing this that the div class rules coded in a previous thread post becomes "inherit." 


Example:


POST A


<style>
.mainbox {
background: url('URL');
}
</style>

<div class="mainbox">Lorem</div>


POST B


<style>
.mainbox {
background-color:#ccc;
}
</style>

<div class="mainbox">Lorem</div>


Post A's div style of the same name will OVERRIDE Post B's and combine them so the result would be as if in POST be the div was:


<style>
.mainbox {
background: #ccc url('URL');
}
</style>

<div class="mainbox">Lorem</div>


Now, I know it's an easy fix; use a different div name.  Not a problem, but I figured I would at least report this as a problem because I've never experienced this kind of behavior before with forums.
 
test2
This isn't a problem at all. You simply have not specified that you only want it to occur in one post; css applied to the whole page, not to individual posts. You need to contain individual posts in a div with a specifying class if you want to use the same class to different effects on the same page. So you could say....


.firstpost .mainbox


And...


.secondpost .mainbox


And that would work.


In fact, it's a good idea to do that in anything you code on RPN, to avoid interfering with other people's.
 

Users who are viewing this thread

Back
Top