Difference between revisions of "Template:PBR/doc"

From Second Life Wiki
Jump to navigation Jump to search
m
Line 1: Line 1:
__NOTOC__
__NOTOC__
==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.


Unfortunately it is not a BR and you end up with having to fight off the evil P tag because of this. This can be gotten around by using a styled BR but IE 6&7 do not support [http://www.quirksmode.org/css/display.html display:table] (I'm sure this isn't what that modes was intended for but it works in FF).
===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".
==Breaking Lines==
{|
{|
|-valign="top"
|-valign="top"
|
|
==BR Tag==
===BR Tag===
<div>
<div>
test<br>
test<br>
Line 22: Line 26:
<hr>
<hr>
|
|
==DIV==
===DIV===
<div>
<div>
test<div></div>
test<div></div>
Line 37: Line 41:
<hr>
<hr>
|
|
==SPAN Block==
===SPAN Block===
<div>
<div>
test<span style="display:block;"></span>
test<span style="display:block;"></span>
Line 52: Line 56:
<hr>
<hr>
|
|
==PBR Template==
===PBR Template===
<div>
<div>
test{{PBR}}
test{{PBR}}
Line 67: Line 71:
<hr>
<hr>
|
|
==BR Tag + Style==
===BR Tag + Style===
<div>
<div>
test<br style="display:table;">
test<br style="display:table;">

Revision as of 20:46, 17 April 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".

Breaking Lines

BR Tag

test
test
test
test
test
test
test
test



test


DIV

test
test
test
test
test
test
test
test
test

SPAN Block

test test test
test test testtest test test


PBR Template

test test test
test test testtest test test


BR Tag + Style

test
test
test
test
test
test
test
test



test


Bold text