473,749 Members | 2,432 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

adding white space in <p>

sometimes i wish to add white space in <p> as to achived effects
similar to tab.

what should i do?

using empty image seems the sure way but rather complicated. (and
dosen't change size with font) Woudl some of the space character in
unicode work? (my html files uses unicode)

Xah
xa*@xahlee.org
∑ http://xahlee.org/

Aug 31 '05 #1
38 24005
Xah Lee wrote:
sometimes i wish to add white space in <p> as to achived effects
similar to tab.

what should i do?

using empty image seems the sure way but rather complicated. (and
dosen't change size with font) Woudl some of the space character in
unicode work? (my html files uses unicode)


How about &nbsp; (codepoint 160).

'tab' is often used as a 'poor mans table' in wordprocessing software - if
you have tabular data, use the table element.

An URL that shows what you are trying to achive would help both of us.

--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
Aug 31 '05 #2
ah, &nbsp; is it! I always thought it just prevent linebreak...

btw, is there a unicode equivalent?

Xah
xa*@xahlee.org
∑ http://xahlee.org/
Benjamin Niemann wrote:
Xah Lee wrote:
sometimes i wish to add white space in <p> as to achived effects
similar to tab.

what should i do?

using empty image seems the sure way but rather complicated. (and
dosen't change size with font) Woudl some of the space character in
unicode work? (my html files uses unicode)


How about &nbsp; (codepoint 160).

'tab' is often used as a 'poor mans table' in wordprocessing software - if
you have tabular data, use the table element.

An URL that shows what you are trying to achive would help both of us.

--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/


Sep 1 '05 #3
ah, Thanks!

a was asking unicode equivalent... as you said, it's code point 160, or
00A0.
http://en.wikipedia.org/wiki/List_of...ity_references

Xah
xa*@xahlee.org
∑ http://xahlee.org/
Benjamin Niemann wrote:
Xah Lee wrote:
sometimes i wish to add white space in <p> as to achived effects
similar to tab.

what should i do?

using empty image seems the sure way but rather complicated. (and
dosen't change size with font) Woudl some of the space character in
unicode work? (my html files uses unicode)


How about &nbsp; (codepoint 160).

'tab' is often used as a 'poor mans table' in wordprocessing software - if
you have tabular data, use the table element.

An URL that shows what you are trying to achive would help both of us.

--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/


Sep 1 '05 #4
Xah Lee wrote:
sometimes i wish to add white space in <p> as to achived effects
similar to tab.


p {
text-indent: 2em;
}
Sep 1 '05 #5
Xah Lee wrote:
sometimes i wish to add white space in <p> as to achived effects
similar to tab.

what should i do?

using empty image seems the sure way but rather complicated. (and
dosen't change size with font) Woudl some of the space character in
unicode work? (my html files uses unicode)


This is the province of css dealing as it does with presentation.

Can any of these css rules be adapted

<p><span style="padding-right:5em;">Thi s text is followed by a 5em
space.</span> <span style="word-spacing: 2em;" >This following text has
a 5em space between each word.</span></p>

<p style="text-indent: 2em;"><i>This text is indented 2em</i>.
fiuev8f9nngy98b we0ifmn09n ojc ecomoiejck moc98ef dskjdvn doijvc iojc9n
v9iuhjc mojm lwj lkjfsm lmoiu98m dlkvmf09j</p>

<p style="margin-left: 2em;"><i>This para appears indented 2em</i>.
fiuev8f9nngy98b we0ifmn09n ojc ecomoiejck moc98ef dskjdvn doijvc iojc9n
v9iuhjc mojm lwj lkjfsm lmoiu98m dlkvmf09j</p>

Louise
Sep 1 '05 #6
In article <11************ **********@g44g 2000cwa.googleg roups.com>,
Xah Lee favored us with...
ah, &nbsp; is it! I always thought it just prevent linebreak...

btw, is there a unicode equivalent?


That _is_ Unicode; but if you're going to use more than one, use a
style instead.

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2.1 spec: http://www.w3.org/TR/CSS21/
validator: http://jigsaw.w3.org/css-validator/
Why We Won't Help You:
http://diveintomark.org/archives/200..._wont_help_you
Sep 1 '05 #7
Xah Lee wrote:
ah, &nbsp; is it!
No it isn't. (P.S. The usual way on Usenet to tell that you failed to
understand a message in its entirety is to quote it in its entirety
after your own comments. This time, there wasn't much to be understood,
though, and although you understood the message correctly, the message
was wrong.)

If you check the HTML specification (as people should do at least before
offering advice on HTML in public), you will see that explicitly says
that the rendering effect of no-break space is undefined.

On the practical side, although most browsers render no-break space as
"noncollaps ible space" of some fixed font-dependent width, this gives
you horribly poor "control" over layout, as compared with the nice tools
of CSS. Besides, using &nbsp; (or the no-break space character itself)
unnecessarily obfuscates your HTML source. It's not meant to be part of
the content but just affect visual rendering.
I always thought it just prevent linebreak...


Keep thinking that way, for the most of it.
Sep 1 '05 #8
Jukka K. Korpela wrote:
If you check the HTML specification (as people should do at least before
offering advice on HTML in public), you will see that explicitly says
that the rendering effect of no-break space is undefined.
Do you have any URL ? I just checked the HTML 4.01 recommandation and
didn't find nothing :/
using &nbsp; (or the no-break space character itself)
unnecessarily obfuscates your HTML source. It's not meant to be part of
the content but just affect visual rendering.


But you must add a non breakable space before characters such as ":",
"(" or ";"... It's not just all about an entire phrase that you want to
stay on the same line.
Sep 1 '05 #9
Pierre Goiffon wrote:
Jukka K. Korpela wrote:
If you check the HTML specification (as people should do at least
before offering advice on HTML in public), you will see that
explicitly says that the rendering effect of no-break space is undefined.
Do you have any URL ?


Of course.
I just checked the HTML 4.01 recommandation and
didn't find nothing :/


Well, if you did not find anything explicit about the rendering effect
being defined or undefined, then you should regard it as undefined,
right? So revealing the URL will just make this explicit:
http://www.w3.org/TR/REC-html40/struct/text.html#h-9.1

Oh well, I might quote the relevant bits:

"In HTML, only the following characters are defined as white space
characters:

ASCII space (&#x0020;)
ASCII tab (&#x0009;)
ASCII form feed (&#x000C;)
Zero-width space (&#x200B;)

Line breaks are also white space characters."

and somewhat later

"This specification does not indicate the behavior, rendering or
otherwise, of space characters other than those explicitly identified
here as white space characters. For this reason, authors should use
appropriate elements and styles to achieve visual formatting effects
that involve white space, rather than space characters."

(Taken literally, this also means that the effect of no-break space on
line breaking is undefined, too. But they hardly meant that.)
using &nbsp; (or the no-break space character itself)
unnecessarily obfuscates your HTML source. It's not meant to be part
of the content but just affect visual rendering.


But you must add a non breakable space before characters such as ":",
"(" or ";"... It's not just all about an entire phrase that you want to
stay on the same line.


I have no idea of what you are talking about here and how it relates to
the piece of my text you quoted, or to the original question (which was
fairly vague, since there are so many ways to add white space to a
paragraph).
Sep 1 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
8647
by: Matt Adams | last post by:
I want to move the following <PRE> defintion to a css file: <TABLE><TR><TD><PRE>sample text</PRE></TD> <TD> not predefined font</TD></TR></TABLE> should be <TABLE><TR><TD class=aaa>sample text</TD> <TD> not predefined font</TD></TR></TABLE>
11
13721
by: Les Paul | last post by:
I'm trying to design an HTML page that can edit itself. In essence, it's just like a Wiki page, but my own very simple version. It's a page full of plain old HTML content, and then at the bottom, there's an "Edit" link. So the page itself looks something like this: <HTML><HEAD><TITLE>blah</TITLE></HEAD><BODY> <!-- TEXT STARTS HERE --> <H1>Hello World!</H1> <P>More stuff here...</P>
5
718
by: Michael Shell | last post by:
Greetings, Consider the XHTML document attached at the end of this post. When viewed under Firefox 1.0.5 on Linux, highlighting and pasting (into a text editor) the <pre> tag listing will preserve formatting (white space and line feeds). However, this is not true when doing the same with the <code> tag listing (it will all be pasted on one line with multiple successive spaces treated as a single space) despite the fact that...
11
5173
by: namenotgivenhere | last post by:
My design goal is to make the white space above and below <p> and <ul> equal to the height of my font. The first step to achieving this I believe is to have an equal amount of white space above or below <p> and <ul>. Can someone suggest a method using css to accomplish this? I have succeeded in doing this in IE6 but I'd also like to know if there's a method to achive this goal that will have a similar visual look in other modern browsers....
9
5548
by: Eric Lindsay | last post by:
I can't figure how to best display little snippets of shell script using <pre>. I just got around to organising to bulk validate some of my web pages, and one of the problems occurs with Bash shell pieces like this: <pre><code> #!/bin/sh ftp -i -n ftp.server.com&lt; &lt;EOF user username password epsv4 cd /
5
13534
by: Agix | last post by:
Hi there, Please check out : http://clarifysolutions.co.uk/certenroll/ The source is included below. This page is a test, so I can play about with paddings, margins and layouts using divs as semantically meaningless containers for bunch's of other elements - like everyone keeps telling me to make my code standards compliant. This request is not because I want a fix, but because I want to
1
2435
by: munnaj | last post by:
hai all, Help me with a style code for firefox. Below is the code which is working fine in IE. But does not work well in firefox. I have also tried with another class for firefox that too not working. Do help me..... <td width='75%' align='left' valign='top' style='width:700px;word-wrap:break-word'><p align='justify'>$Description</p></td>"
1
3478
by: Viken Karaguesian | last post by:
Hello everyone, I have a slight problem that I can't seem to solve. I'm not sure if it's a CSS problem, HTML problem or simply an IE-6 bug. I chose this forum as I suspect the fix may be with CSS. I have styled hyperlinks on a website to show a small "new window" icon when I have a link that opens in a new window. This works as designed in FF. In IE-6, however, when a hyperlink wraps to the next line, the icon does not wrap along...
8
10047
prino
by: prino | last post by:
Hi all, I've written code (in REXX) that takes files in legacy languages (PL/I, COBOL, z/OS assembler, etc) and converts them into HTML in a format similar to what's displayed in the z/OS ISPF editor. A fellow member of the PCG has helped me by creating a bit of Javascript to emulate the scrolling and using Google I've now gotten it into a state where it almost passes the W3C Markup Validation Service. However, the one error, Error Line 166,...
0
8833
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9568
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9335
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9256
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6079
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4881
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3320
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2794
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2218
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.