Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Why is Vanilla Forums using 'clear: both;' for the 'Message' div?

edited March 2012 in Vanilla 2.0 - 2.8

Consider this very forum. Why is clear: both; style attribute used for the 'Message' div?

I mean, this part of HTML code:

<div class="Message">

And this in CSS code custom.css or style.css:

.Preview .Message, .MessageList .Message {
    clear: both;
}

I want to remove that (as it breaks my custom styles). But want to be make sure it's not there for a purpose.

Best Answer

  • 422422 Developer MVP
    Answer ✓

    Usually its there because the theme or file is created dynamically, and its borrowed across from other templates.

    There was an error rendering this rich post.

Answers

  • does it matter?

    Preview .Message, .MessageList .Message {
        clear: none;
    }

    you can also copy style.css to your theme's design folder, it is just advisable to use custom.css, unless you have to.

    grep is your friend.

  • @x00 : I just wanted to confirm if removing that attribute is breaks something I am not noticing.

  • 422422 Developer MVP

    Its just a reset style, i dont use it personally. I prefer clearfix, same shit different bucket. Used mainly to clear divs either side of floats.

    There was an error rendering this rich post.

  • @422 : Yes, but I don't see anything floating around the 'Message' div, and that's what makes me wonder why it's used.

  • 422422 Developer MVP
    Answer ✓

    Usually its there because the theme or file is created dynamically, and its borrowed across from other templates.

    There was an error rendering this rich post.

  • Okay! Thanks for clarifying.

  • 422422 Developer MVP

    There was an error rendering this rich post.

  • edited March 2012

    @422 : Come on, I know that! You are embarrassing me. :P (he he!)

    Like I said, I was asking the question because 'clear:both:' is used even though there's nothing floating around 'Message' div.

  • 422422 Developer MVP

    I posted that so you could play with the code live. :)

    There was an error rendering this rich post.

  • :-o Thanks!

Sign In or Register to comment.