Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

First post CSS

edited September 2005 in Vanilla 1.0 Help
Hi Guys, I've been travelling around Vanilla and I have a question: Is there a simple way to change some CSS style properties (e.g background color) of the first post of a thread? I looked into the CSS file and seems that there's no specific style class for the first post. Thanks

Comments

  • i'm almost certain this isnt possible at the moment. Unless someone says otherwise add it to the request list on the wiki.
  • I just had a look at the css, and I can't see a refernce to the first post. Mark, where would you add a div to the source so that you could style the FIRST post only?
  • edited September 2005
    Did anyone look in the HTML source? The class is there but just not used in the CSS, just use FirstComment as the class but make sure you define it after the comment class as the div has those both defined.
  • no... no we didn't. Mini and I look for the easy answer and then give up :-P Thanks for that one jaseone. Your solution is also perfect. does it really matter where you define it in the css? FirstComment is just going to get called after the other stuff anyway, no? I am not great at css, so am likely wrong, but I would like to know why.
  • I'm no guru on CSS either, I didn't know about the specifying multiple class thing until I saw Mark's code, in some quick tests I did though (with Konqueror) any changes didn't take effect until I placed the FirstComment at the end of the CSS assumedly because the style had already been defined with the comment class.
  • edited September 2005
    There are some styles that are position sensitive, pet example are the 'a:styles' a:hover, a:visited and so on, they are pretty sensitive on which order you put them in. If there is a already definitive style for a series of things, the style that will define a one part of the definitive style (i.e. body defines ALL text, but you can change parts of text with Div) will have to come after it. I haven't had the time to check out the CSS makings of Vanilla, but if I had I'd surely would be able to give you more specified answer.
  • I know CSS and I'd recomend adding any of your own changes at the end of the stylesheet. That way, it will overide anything set somewhere further up.
  • what everyone else has said with the addition of

    .FirstComment{
    background-color: #FF0000 !important;
    }

    using the !important for any style rule will give it precedence.
  • right on the spot chap, !important works only some browsers.
  • !important works only some browsers.

    most notably: !important rules DO NOT work in IE for windows.
  • Which is why putting it at the bottom of the CSS file is good.
This discussion has been closed.