What does this line of code do?

Topics: ASP.NET 2.0, Themes
Jan 23, 2011 at 1:42 PM

I was looking in the postcomment page and found this:


class="comment<%= Post.Author.Equals(Comment.Author, StringComparison.OrdinalIgnoreCase) ? " self" : "" %>


What does this do?


From the css file:


.self { background-color:#eae5da; }


Isnt it better to just put the background-color:#eae5da in the div class such as .comment {....... ?



Jan 23, 2011 at 2:48 PM

I think it sets a different colour background to comments posted by the author of the post. So they stand out from the others...

Jan 23, 2011 at 3:19 PM
Edited Jan 23, 2011 at 6:52 PM

Nm decidied not to use it.