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.
Options

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

  • Options
    i'm almost certain this isnt possible at the moment. Unless someone says otherwise add it to the request list on the wiki.
  • Options
    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?
  • Options
    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.
  • Options
    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.
  • Options
    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.
  • Options
    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.
  • Options
    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.
  • Options
    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.
  • Options
    right on the spot chap, !important works only some browsers.
  • Options
    !important works only some browsers.

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