What the heck is that bit of code for indenting the first line of a paragraph?
It’s like &nbps or something.
Help?
What the heck is that bit of code for indenting the first line of a paragraph?
It’s like &nbps or something.
Help?
It’s .
It’s not really intended for indenting paragraphs, as such. What it does is create a “hard” space. When you indent a paragraph with it, you’re really telling the browser to print a space, one for every you include.
As may be…it still functions just fine for my purposes!
Thanks, slortar!
also works, and seems to be preferred by some browsers; I remember nbsp not working on some older versions of Netscape.
I use a transparent one-pixel gif and just set the width to however many spaces I want for an indent. By setting height you can also use them to space between paragraphs.
Damnable board software! Preview and posting parse these things differently, apparently, so that it shows up in one and not the other. In any event, the code I was referring to was #160. Here is a complete special character code list.
just for the record, the BLOCKQUOTE tag is very useful for indenting a paragraph from the right and left ‘margins’ of the page at the same time.
You can use an easy inline CSS statement with an HTML <p> tag for this as well, and it works more reliably in the sense that it is consistent across platforms.
Example:
<p style="text-indent: 20pt">Blah blah blah...</p>
The above indents exactly 20 points. You can use any of the following units:
Relative:
em (the font height)
ex (the height of “x”)
px (number of pixels)
Absolute:
in (inches)
cm (centimeters)
mm (milimeters)
pt (points = 1/72 in)
pc (picas = 12 pt)
Using non-breaking spaces or transparent GIFs may give you better support in old browsers, but the preferred way of indenting a paragraph would be to use CSS:
http://www.w3c.org/Style/Examples/007/indent.html
Easier, more reliable (because seriously, is anyone using browsers old enough not to support it anymore?) and most importantly, I can use my user-defined stylesheet to turn it off so I can read the text without it. I really hate indented text on the web - it’s almost as big a crime as justified text, in my book; it looks awful and it exists only to solve a problem that doesn’t exist on the computer screen.
However, my opinions here are irrelevant as the magic of stylesheets means you can indent to your heart’s content, and I won’t have to see it.
Here’s an example where CSS is used to indent in a way that would look ugly otherwise.
This is 2005; anyone trying to indent a paragraph with non-breaking spaces or transparent GIFs should be flogged.
CSS is Primus’ gift for web designers, folks. Learn it, use it, love it. Visit The CSS Zen Garden if you don’t believe me…