473,766 Members | 2,023 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
38 24008
Jukka K. Korpela wrote:
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.)


My interpretation of the spec: the behaviour of the listed whitespace
characters is explicitly defined by the HTML spec, because it is different
from the 'normal' behaviour (consecutive whitespace collapsed to one,
linebreak completly ignore after start tags/before end tags, etc.). That
'this specification' does not define the behaviour of certain characters,
does not imply that their behaviour is undefined - it just means that the
'default' behaviour applies (in this case from unicode).
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
Sep 1 '05 #11
On Thu, 1 Sep 2005, Jukka K. Korpela wrote:
Pierre Goiffon wrote:
But you must add a non breakable space before characters such as
":", "(" or ";"...


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


In some languages (not English), it is conventional typography to
include white space before certain punctuation characters, and I
suspect that Pierre is referring to this (I guess French is such a
language?).

I honestly don't know how this is meant to be handled in HTML. By
rights, the *rendering* agent should apply the correct rules of
typography for the language in question, so there should be no need
for anything extra in the HTML. But, practical issues might indicate
in another direction.

h t h
Sep 1 '05 #12
Benjamin Niemann wrote:

[ comprehensively quoting my message, i.e. using the usual convention
to indicate lack of comprehensive reading ]
My interpretation of the spec: the behaviour of the listed whitespace
characters is explicitly defined by the HTML spec, because it is different
from the 'normal' behaviour (consecutive whitespace collapsed to one,
linebreak completly ignore after start tags/before end tags, etc.).
You are referring to some undefined "'normal' behaviour". What is normal
in HTML is an HTML matter, and what is normal for rendering plain text
is something completely different.
That
'this specification' does not define the behaviour of certain characters,
does not imply that their behaviour is undefined - it just means that the
'default' behaviour applies (in this case from unicode).


There is absolutely no statement in HTML specifications that makes any
claim or requirement on conformance to Unicode. The specifications
_only_ define the meanings of character references in terms of Unicode
(actually, the equivalent ISO 10646).
Sep 1 '05 #13
In article <Pi************ *************** ****@ppepc56.ph .gla.ac.uk>,
"Alan J. Flavell" <fl*****@ph.gla .ac.uk> wrote:
On Thu, 1 Sep 2005, Jukka K. Korpela wrote:
Pierre Goiffon wrote:
But you must add a non breakable space before characters such as
":", "(" or ";"...
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


In some languages (not English), it is conventional typography to
include white space before certain punctuation characters, and I
suspect that Pierre is referring to this (I guess French is such a
language?).


French indeed is. See
http://lists.w3.org/Archives/Public/...4Aug/0073.html

Are there others?
I honestly don't know how this is meant to be handled in HTML.
In practice the NO-BREAK SPACE works.
By rights, the *rendering* agent should apply the correct rules of
typography for the language in question, so there should be no need
for anything extra in the HTML.


I think it would be quite unreasonable to expect the UA to know enough
about every language to implement comprehensive DWIM. Case study: <q>
with language-specific generated quotation marks. I think the author
should put a character there.

--
Henri Sivonen
hs******@iki.fi
http://hsivonen.iki.fi/
Mozilla Web Author FAQ: http://mozilla.org/docs/web-developer/faq.html
Sep 1 '05 #14
On Thu, 1 Sep 2005, Henri Sivonen wrote:
"Alan J. Flavell" <fl*****@ph.gla .ac.uk> wrote:
In some languages (not English), it is conventional typography to
include white space before certain punctuation characters, and I
suspect that Pierre is referring to this (I guess French is such a
language?).
French indeed is. See
http://lists.w3.org/Archives/Public/...4Aug/0073.html


Thanks!
By rights, the *rendering* agent should apply the correct rules of
typography for the language in question, so there should be no
need for anything extra in the HTML.


I think it would be quite unreasonable to expect the UA to know
enough about every language


Something of the kind is essential for some writing systems, e.g
Arabic. HTML specs don't really make it too clear how far that
should go, however.
Case study: <q> with language-specific generated quotation marks.


Well, that attempt was problematic on two levels, IMHO.

1. it wasn't implemented widely enough (and has no graceful fallback
behaviour)

2. the HTML specification is unclear about how its language
sensitivity should behave. Under the <q> element it's not defined, it
merely says:

User agents should render quotation marks in a language-sensitive
manner (see the lang attribute).

and the example has been carefully chosen to avoid illustrating the
issue!

Neither here nor under the "lang=" attribute can I find it made
clear whether the quotes should be rendered in the language of the
quotation, or of the enclosing text, or the base language.

Books on typography which I have consulted require the *latter*, so it
would seem that in this kind of pattern:

<sometag lang="A">blah blah <q lang="B">twas brillig</q> blah blah

the <q lang="B"> mark should be rendered according to the
quotation mark convention of language "A", which some might find
counter-intuitive.

The only (English-language) publishing style guide which I found where
the issue was addressed of a quote inside a quote inside regular
(English) text, where all three languages were different, firmly
required *all* the quotation marks to conform to English[1]
conventions, i.e "double" quotes on the inner quote and 'single'
quotes on the outer one. I.e NOT using the quotation mark convention
of the outer quote's language to delimit the inner quote!

best regards

[1] That's the opposite of the American rule, btw.
Sep 1 '05 #15
Henri Sivonen wrote:
But you must add a non breakable space before characters such as
":", "(" or ";"...

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
In some languages (not English), it is conventional typography to
include white space before certain punctuation characters, and I
suspect that Pierre is referring to this (I guess French is such a
language?).


French indeed is. See
http://lists.w3.org/Archives/Public/...4Aug/0073.html


Yes, thanks Alan and Henri, and sorry I thought it was a very common
typographic use (I mean, practiced for many languages)
So yes, in french there are precise rules to follow with punctuations
marks and spaces. And when you have a space before a punctuation sign,
then it must be a non breakable space, in order to avoid something like :

Bonjour et bienvenue<wrap to new line>
<space>!

ie keep the exclamation mark on the same line as the text.
In practice the NO-BREAK SPACE works.


We discussed about that point a lot in fr.comp.infosys temes.www.auteurs,
and the point is that &nbsp; as the equivalent character is widely
supported - in fact, no one has never reported that this wasn't behaving
as expected (display as a normal space but prevents a line break) in any
browser (which isn't enough to think any brower will behave exactly the
same, but you know what can be said : curious coincidence :) ).

Maybe the assumption made by Benjamin Niemman (see
<df**********@o nline.de>) is a good explanation.
Sep 2 '05 #16
Tim
"Alan J. Flavell":
By rights, the *rendering* agent should apply the correct rules of
typography for the language in question, so there should be no need for
anything extra in the HTML.

Henri Sivonen:
I think it would be quite unreasonable to expect the UA to know enough
about every language to implement comprehensive DWIM.
Hmm, I dunno. Browsers already have a lot of options about what language
you prefer, how to handle various types of data content, etc. I don't
think it's too much for a browser that has a French release, for instance,
to use French methods of typology by default. I don't think that should
extend to putting in extra spaces where the author ought to have put them
in themselves, but perhaps the line wrapping should be aware of where it's
*not* a good place to break lines, following the language's general rules,
for instance.
Case study: <q> with language-specific generated quotation marks. I
think the author should put a character there.


I agree about this. I think a document ought to be typed as you'd
normally *type* it, just add markup around content to give more/specific
meanings to things.

--
If you insist on e-mailing me, use the reply-to address (it's real but
temporary). But please reply to the group, like you're supposed to.

This message was sent without a virus, please destroy some files yourself.

Sep 2 '05 #17
Under Subject: Re: adding white space in <p>
Pierre Goiffon <pg******@free. fr.invalid> wrote:
So yes, in french there are precise rules to follow with punctuations
marks and spaces. And when you have a space before a punctuation sign,
then it must be a non breakable space, in order to avoid something like :

Bonjour et bienvenue<wrap to new line>
<space>!


Actually if you wrote just
Bonjour et bienvenue !
and a nasty line break occurred, it would appear between the space and the
exclamation mark, leaving just the latter and not the space on the next
line.
In practice the NO-BREAK SPACE works.


We discussed about that point a lot in fr.comp.infosys temes.www.auteurs,
and the point is that &nbsp; as the equivalent character is widely
supported - in fact, no one has never reported that this wasn't behaving
as expected (display as a normal space but prevents a line break) in any
browser


That's right, but HTML specifications do not _require_ such behavior.

Moreover, the actual browser behavior does _not_ produce typographically
(or orthographicall y, depending on your definitions) correct results for
French punctuation. The no-break space is treated as having the width of a
normal space, which is too much - the spacing should be "espace fine",
which is considerably narrower. Moreover, in justification (which
admittedly should be avoided on Web pages) a no-break space acts as a
fixed-width space, i.e. it is neither shrunk nor expanded according to
justification needs.

The problem is that we would need a suitably narrow space, but there is no
such character in Unicode. (There is narrow no-break space, but it is
both theoretically questionable here and practically almost useless
due to lack of browser support.) There's no good solution at present, and
the no-break space is probably the least of evils in most cases. On special
occasions, where typography really matters, you might take the extra
trouble of adding some relatively unnatural markup in order to be able to
use CSS to reduce the spacing, as outlined at
http://www.cs.tut.fi/~jkorpela/html/french.html#spacing
(old document, partly dated, sorry).

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Sep 2 '05 #18
In article <pa************ *************** *@mail.localhos t.invalid>,
Tim <ti*@mail.local host.invalid> wrote:
"Alan J. Flavell":
By rights, the *rendering* agent should apply the correct rules of
typography for the language in question, so there should be no need for
anything extra in the HTML.


Henri Sivonen:
I think it would be quite unreasonable to expect the UA to know enough
about every language to implement comprehensive DWIM.


Hmm, I dunno. Browsers already have a lot of options about what language
you prefer, how to handle various types of data content, etc. I don't
think it's too much for a browser that has a French release, for instance,
to use French methods of typology by default.


I think the rendering should not depend on the UI language of the
browser release. The approach might work for French, but there are many
more languages in the world and no one is going to build special
releases with different layout rules for all of them. (Arabic [writing
system--not just one language] was mentioned in the thread, but to the
extent Arabic is supported, it is supported regardless of the language
of the browser release.)

--
Henri Sivonen
hs******@iki.fi
http://hsivonen.iki.fi/
Mozilla Web Author FAQ: http://mozilla.org/docs/web-developer/faq.html
Sep 3 '05 #19
On Sat, 3 Sep 2005, Henri Sivonen wrote:
Tim <ti*@mail.local host.invalid> wrote:
Hmm, I dunno. Browsers already have a lot of options about what
language you prefer, how to handle various types of data content,
etc. I don't think it's too much for a browser that has a French
release, for instance, to use French methods of typology by
default.


I think the rendering should not depend on the UI language of the
browser release. The approach might work for French, but there are
many more languages in the world and no one is going to build
special releases with different layout rules for all of them.
(Arabic [writing system--not just one language] was mentioned in the
thread, but to the extent Arabic is supported, it is supported
regardless of the language of the browser release.)


I agree with you. Supporting the document rendering conventions for a
particular language or writing system might be an optionally-
installable extra[1], but if the support is present then I'd prefer
that it should be used dependent on the /document being rendered/, and
not on the current /user interface language/ selection.

all the best

[1] in the sense that the browser designer might want to keep a "lean
and mean" browser installation for users who don't grok other writing
systems.
Sep 3 '05 #20

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
13723
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
5175
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
13539
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
10168
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
9959
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
9837
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
6651
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
5279
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3929
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
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
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.