Not signed in (Sign In)

Categories

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.

Help keep Vanilla free:
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthorldelgado
    • CommentTimeSep 5th 2005
     # 1
    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
  1.  # 2
    i'm almost certain this isnt possible at the moment. Unless someone says otherwise add it to the request list on the wiki.
    •  
      CommentAuthornathan
    • CommentTimeSep 5th 2005
     # 3
    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?
    • CommentAuthorjaseone
    • CommentTimeSep 5th 2005 edited
     # 4
    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.
    •  
      CommentAuthornathan
    • CommentTimeSep 5th 2005
     # 5
    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.
    • CommentAuthorjaseone
    • CommentTimeSep 6th 2005
     # 6
    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.
    •  
      CommentAuthorKosmo
    • CommentTimeSep 6th 2005 edited
     # 7
    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.
    •  
      CommentAuthorBen
    • CommentTimeSep 6th 2005
     # 8
    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.
    • CommentAuthorandy
    • CommentTimeSep 6th 2005
     # 9
    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.
    •  
      CommentAuthorKosmo
    • CommentTimeSep 6th 2005
     # 10
    right on the spot chap, !important works only some browsers.
    •  
      CommentAuthornifkin
    • CommentTimeSep 7th 2005
     # 11
    !important works only some browsers.

    most notably: !important rules DO NOT work in IE for windows.
    •  
      CommentAuthorBen
    • CommentTimeSep 8th 2005
     # 12
    Which is why putting it at the bottom of the CSS file is good.
Add your comments
    Username Password
  • Format comments as