By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,960 Members | 1,009 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,960 IT Pros & Developers. It's quick & easy.

"white-space: pre-wrap" is not working for <a> tag

P: n/a
If I have white space in the <atag, IE interpretes it as line break.
I tried setting "whie-space: pre" and it did not seem to affect.
Here is a sample.

-----------------------------------------------------

CSS
--------
.TimeIndexThumbAnchor
{
text-decoration: none;
padding: 0px;
border-style:none;
height: 1px;
width: 1px;
white-space: pre-wrap ;

}

HTML
------

<a class = "TimeIndexThumbAnchor" style="color:#f5ac5d"

href="http://aa.usno.navy.mil/data/docs/RS_OneYear.html">
Sunrise and Sunset </a>

Output Rendered by IE
-------------------------------
Sunrise
and
Sunset
I would like to see "Sunrise and Sunset" in sameline.
-------------------------------------------------------------

Please help me..

Thanks
Ramesh

Nov 5 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
as*******@gmail.com wrote:
If I have white space in the <atag, IE interpretes it as line break.
I tried setting "whie-space: pre" and it did not seem to affect.
Here is a sample.
white-space: pre-wrap ;
pre-wrap is an invalid value. Paste your CSS here and see:
http://www.htmlhelp.com/tools/csscheck/
I would like to see "Sunrise and Sunset" in sameline.
<a class = "TimeIndexThumbAnchor"
href="http://aa.usno.navy.mil/data/docs/RS_OneYear.html">
Sunrise&nbsp;and&nbsp;Sunset</a>

What is the width of the area in which you are using this link? How
about a URL to the page?

--
-bts
-Motorcycles defy gravity; cars just suck
Nov 5 '06 #2

P: n/a
Beauregard T. Shagnasty <a.*********@example.invalidwrote:
pre-wrap is an invalid value. Paste your CSS here and see:
No, "pre-wrap" is perfectly valid. Just read the CSS specification:
<http://www.w3.org/TR/CSS21/text.html#white-space-prop>

The problem is that only a few browsers do support this special value.
And IE doesn't support this value (like many other parts of the web
standards).

--
Alexander
Nov 5 '06 #3

P: n/a
Alexander Clauss wrote:
Beauregard T. Shagnasty <a.*********@example.invalidwrote:
>pre-wrap is an invalid value. Paste your CSS here and see:

No, "pre-wrap" is perfectly valid. Just read the CSS specification:
<http://www.w3.org/TR/CSS21/text.html#white-space-prop>
Sorry, I was going by the link supplied by the mentioned CSS check page,
which is:
<http://www.w3.org/TR/REC-CSS2/text.html#propdef-white-space>

Yes, this is CSS2, and not CSS21 ...
The problem is that only a few browsers do support this special value.
And IE doesn't support this value (like many other parts of the web
standards).
Exactly.

--
-bts
-Motorcycles defy gravity; cars just suck
Nov 5 '06 #4

P: n/a
Scripsit Alexander Clauss:
No, "pre-wrap" is perfectly valid. Just read the CSS specification:
http://www.w3.org/TR/CSS21/text.html#white-space-prop
You are referring to a "specification" that describes itself as a "working
draft" and adds:

"This is a draft document and may be updated, replaced or obsoleted by other
documents at any time. It is inappropriate to cite this document as other
than work in progress."

Thus, the word "valid" (with our without an attribute like "perfectly") is
particularly loose, if not meaningless, here.
The problem is that only a few browsers do support this special value.
Well, that's a good practical point. The simple way to suggest that line
breaks be prevented inside an element is white-space: nowrap. If the element
contains, say, just two normal words with one space between them, you could
also change the space to no-break space, preventing a line break even when
CSS is off.

It's impossible to see whether this would satisfy the OP's needs, since the
description of the situation was vague and odd. What's the point in the
trailing space in the element content, and why on &Planet; would anyone try
to set the width and height of a text link to one pixel.

The odds are that we cannot help the OP to create the problem he wants to
create before he gives us more details.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Nov 5 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.