Community Central
Community Central
Forums: Index Support Requests Br clear not working
Fandom's forums are a place for the community to help other members.
To contact staff directly or to report bugs, please use Special:Contact.
Archive
Note: This topic has been unedited for 4242 days. It is considered archived - the discussion is over. Information in this thread may be out of date. Do not add to unless it really needs a response.

In an article I've just edited, w:c:24:Benjamin, I put in a <br clear="all"/> just before the "live appearances" heading. So, that heading should be pushed down past the sidebar and appear under it. It does when I preview the page, and as the page loads it displays correctly for a second before jumping up to the wrong place. Are other people seeing this happening; has it happened elsewhere on Wikia; and does anyone know why? Thanks--Category:Acer4666 00:16, September 5, 2012 (UTC)

Perhaps it is related to the html5 upgrade (all 1.19 wikis use html5, 1.16 don't) - which made this value deprecated. Try using <br style="clear: both;"> instead, if it continues to create problems. Marc-Philipp (Talk) 02:29, September 5, 2012 (UTC)
No, that didn't work--Category:Acer4666 10:26, September 5, 2012 (UTC)
The code actually does seem to work, but the JavaScript that executes ruins it. The small "3" icon on the top right pushes the infobox down, breaking everything. Seeing as the navbox remains on the bottom, you could probably add a small 100% width table with no content above/around the header. Not a "clean" solution though. - Tjcool007 (Wall) 10:46, September 5, 2012 (UTC)
But the icon template is used on every page and doesn't cause problems like this. Check out w:c:24:William for the same situation (the {{-}} is a template that is just a br clear) and the icon template doesn't ruin that page--Category:Acer4666 18:46, September 5, 2012 (UTC)
And I should probably point out that the reason the icon template pushes the infobox down is it itself has a line break at the end of it. I don't see how having a line break above an infobox would cause all line breaks below it to break--Category:Acer4666 18:49, September 5, 2012 (UTC)
Then you can add clear:right to your infobox and remove your br style="clear:both" after the icon template.  Cafeinlove msg 2012/9/6, 04:08 (KST)

(Reset indent) What about using <div style="clear:both"></div> instead of <br /> which is an inline element?  Cafeinlove msg 2012/9/6, 04:08 (KST)

That does work. This is still a mystery though - why this one particular page is affected and not others, why something on the page load (js according to tjcool?) causes the format to break, why this has never happened before? I don't want to change the code on all our pages to use <div> instead of <br> without understanding why this has happened and if something similar could happen to ruin the new solution. I'll send in a special:contact, thanks for the help!--Category:Acer4666 19:22, September 5, 2012 (UTC)
Haha! I've worked out what it is! There was a space at the end of the text above the line break. What a weird bug? Look:
Red rose

First line of text, then line break
Then next line below pic.

Red rose

First line of text with space at end then line break
Line break doesn't work.


What the hell is that about?--Category:Acer4666 19:47, September 5, 2012 (UTC)

I'm not sure I am following... the page, Benjamin, looks fine to me. logged in/Firefox - logged out/Chrome Rappy 05:11, September 6, 2012 (UTC)
Yes I've fixed the Benjamin page now I know what was up - but look at the demonstration I just did above. Both have line breaks between the two lines of text, yet in the first the second line goes below the picture and in the second it doesn't. The only difference is a spacebar at the end of the first line (next to the second picture)--Category:Acer4666 09:12, September 6, 2012 (UTC)
here's a link to the page before I fixed it--Category:Acer4666 09:15, September 6, 2012 (UTC)
Odd. The above looks fine in FF, but the way you describe in Chrome. Could this simply be a bug with Chrome and the way it handles the HTML? Rappy 13:42, September 7, 2012 (UTC)
Oh yeah, looks OK in Internet Explorer as well. This is only happening with MW1.19 wikis, not 1.16 ones (or html5 wikis I guess)--Category:Acer4666 15:11, September 7, 2012 (UTC)
Yeah, <br> is deprecated and shouldn't be used anyways. It could be a possibility of any of the above... HTML5, deprecated code, Chrome using it oddly. You can always change your {{-}} template to <div style="clear: both"></div> instead and see if that changes the way it is displayed. Rappy 15:32, September 7, 2012 (UTC)

(Reset indent) Awesome, cheers, you can disregard the Special:Contact I sent in about this if you see it--Category:Acer4666 15:38, September 7, 2012 (UTC)

The <br> tag itself isn't deprecated, just the clear attribute (which should be replaced with style="clear: both;"). I guess JS wasn't the problem earlier then (although everything looked fine on my end with JS disabled...). Oh well - Tjcool007 (Wall) 17:41, September 7, 2012 (UTC)