Difference between revisions of "Template:PBR/doc"

From Second Life Wiki
Jump to navigation Jump to search
m (Do it Wikipedia style!)
 
(7 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{Documentation subpage}}
{{RightToc}}
{{RightToc}}
==WTF?==
==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.
[[: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===
===How it works===
Line 7: Line 8:


===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 no web browser author has ever given much thought to. Specifically when copying the text the result is different depending upon which web browser you use. I'm currently thinking about including a hidden br to make FF happy.
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===
Q: Why PBR?
'''Q:''' Why PBR?<br/>
A: Pseudo-BReak
'''A:''' '''P'''seudo-'''BR'''eak


==Breaking Lines==
==Breaking Lines==
{|
{| border="1" cellspacing="0"
|-valign="top"
|-valign="top"
|
|
===BR Tag===
===BR Tag===
<hr>
<div>
<div>
test<br>
test<br>
Line 32: Line 34:
<hr>
<hr>
|
|
===DIV===
===SPAN {{HoverText|D:B|display:block}}===
<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>
<hr>
|
===SPAN===
<div>
<div>
test<span style="display:block;"></span>
test<span style="display:block;"></span>
Line 63: Line 51:
|
|


===SPAN BR===
==={{HoverText|SPAN|display:block;}} + {{HoverText|BR|display:none;}}===
<hr>
<div>
<div>
test<span style="display:block;"></span><br style="display:none;">
test<span style="display:block;"></span><br style="display:none;">
Line 78: Line 67:
<hr>
<hr>
|
|
===BR Tag + Style===
===PBR Template===
<div>
test<br style="display:table;">
test<br style="display:table;">
test<br>test<br style="display:table;">
test<br style="display:table;">
test<br style="display:table;">test<br style="display:table;">
test<br style="display:table;">
<br style="display:table;">
<br style="display:table;">
<br style="display:table;">
test<br style="display:table;">
</div>
<hr>
<hr>
|
===PBR Template===
<div>
<div>
test{{PBR}}
test{{PBR}}
Line 109: Line 84:
|
|
===Goal===
===Goal===
<hr>
<div>
<div>
test<br>
test<br>
Line 122: Line 98:
<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===
<hr>
<div>
<div>
test<center></center>
test<center></center>
Line 135: Line 128:
<center></center>
<center></center>
test<center></center>
test<center></center>
</div>
<hr>
|
===BR {{HoverText|D:T|display:table;}}===
<hr>
<div>
test<br style="display:table;">
test<br style="display:table;">
test<br>test<br style="display:table;">
test<br style="display:table;">
test<br style="display:table;">test<br style="display:table;">
test<br style="display:table;">
<br style="display:table;">
<br style="display:table;">
<br style="display:table;">
test<br style="display:table;">
</div>
<hr>
|
===BR {{HoverText|D:B|display:block;}}===
<hr>
<div>
test<br style="display:block;">
test<br style="display:block;">
test<br>test<br style="display:block;">
test<br style="display:block;">
test<br style="display:block;">test<br style="display:block;">
test<br style="display:block;">
<br style="display:block;">
<br style="display:block;">
<br style="display:block;">
test<br style="display:block;">
</div>
</div>
<hr>
<hr>
|
|
===Goal===
===Goal===
<hr>
<div>
<div>
test<br>
test<br>
Line 155: Line 181:
==Links of Interest==
==Links of Interest==
http://www.quirksmode.org/css/display.html
http://www.quirksmode.org/css/display.html
<includeonly>{{Sandbox other||
<!--Categories below this line, please; interwikis at Wikidata-->
[[Category:Template documentation pages]]
}}</includeonly>

Latest revision as of 12:13, 3 February 2023

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 Tag


test
test
test
test
test
test
test
test



test


SPAN D:B


test test test
test test testtest test test


SPAN + BR


test
test
test
test
test
test
test
test



test


PBR Template


test test test
test test testtest test test


Goal


test
test
test
test
test
test
test
test
test


DIV


test
test
test
test
test
test
test
test
test

CENTER


test
test
test
test
test
test
test
test
test

BR D:T


test
test
test
test
test
test
test
test



test


BR D:B


test
test
test
test
test
test
test
test



test


Goal


test
test
test
test
test
test
test
test
test


Links of Interest

http://www.quirksmode.org/css/display.html