Difference between revisions of "Template:PBR/doc"
m (→SPAN) |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 7: | Line 7: | ||
===Problems=== | ===Problems=== | ||
Because of the unorthodox (ab)use of this mix of CSS, HTML and MediaWiki we end up with a situation where strange things happen that | Because of the unorthodox (ab)use of this mix of CSS, HTML and MediaWiki we end up with a situation where strange things happen that few web browser authors have given much thought to. Specifically when copying the text the result is different depending upon which web browser you use. The only browser to support this flawlessly at present are those based on Webkit (Google Chrome, Safari). Both IE 8.0 and Firefox 3.0 are buggy. | ||
===Name=== | ===Name=== | ||
Line 33: | Line 33: | ||
<hr> | <hr> | ||
| | | | ||
===SPAN {{HoverText|D:B|display:block}}=== | |||
===SPAN | |||
<hr> | <hr> | ||
<div> | <div> | ||
Line 66: | Line 50: | ||
| | | | ||
===SPAN + {{HoverText| | ==={{HoverText|SPAN|display:block;}} + {{HoverText|BR|display:none;}}=== | ||
<hr> | <hr> | ||
<div> | <div> | ||
Line 113: | Line 97: | ||
<hr> | <hr> | ||
|- valign="top" | |- valign="top" | ||
| | |||
===DIV=== | |||
<hr> | |||
<div> | |||
test<div></div> | |||
test<div></div> | |||
test<br>test<div></div> | |||
test<div></div> | |||
test<div></div>test<div></div> | |||
test<div></div> | |||
<div></div> | |||
<div></div> | |||
<div></div> | |||
test<div></div> | |||
</div> | |||
<hr> | |||
| | | | ||
===CENTER=== | ===CENTER=== | ||
Line 130: | Line 130: | ||
<hr> | <hr> | ||
| | | | ||
===BR | ===BR {{HoverText|D:T|display:table;}}=== | ||
<hr> | <hr> | ||
<div> | <div> | ||
Line 146: | Line 146: | ||
<hr> | <hr> | ||
| | | | ||
===BR | ===BR {{HoverText|D:B|display:block;}}=== | ||
<hr> | <hr> | ||
<div> | <div> |
Revision as of 15:30, 8 May 2009
WTF?
Template:PBR is intended to give the outward appearance and effect of the BR tag with the exception that multiple uses of it will not cause multiple lines of whitespace. You use it everywhere you want a linebreak but don't want to have extra whitespace associated with linebreaks piling up. Essentially PBR is a conditional BR, if a BR is needed it works as a BR, if it's not needed it has no effect. It's the bees knees.
How it works
The original version used an empty "div" tag but it had the side effect that you would have to fight the wiki engine to keep it from inserting "p" tags. The solution is to *not* fight the wiki engine and use a tag that it will let you include in "p" tags. The new version uses an empty "span" tag, which is "p" friendly but with inline style we convert the tag to "block" from "inline".
Problems
Because of the unorthodox (ab)use of this mix of CSS, HTML and MediaWiki we end up with a situation where strange things happen that few web browser authors have given much thought to. Specifically when copying the text the result is different depending upon which web browser you use. The only browser to support this flawlessly at present are those based on Webkit (Google Chrome, Safari). Both IE 8.0 and Firefox 3.0 are buggy.
Name
Q: Why PBR?
A: Pseudo-BReak
Breaking Lines
BR Tagtest |
SPAN D:Btest
test
test |
SPAN + BRtest |
PBR Templatetest
test
test |
Goaltest |
DIV
test
test
test
test test testtest test test |
CENTER
test
test |
BR D:Ttest |
BR D:Btest |
Goaltest |