473,772 Members | 2,510 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

white-space nowrap

I'm trying to layout a couple text input fields and their
corresponding labels without using a table. When I was trying to
debug my understanding of CSS, I was *very* surprised to see that
span's with borders behave counter-intuitively (IMHO) when using
style="white-space: nowrap;".

Below is a fairly small chunk of XHTML that demonstrates what I'm
talking about. What gives?

-Mark

--------------snip----------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>

<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<title>HTML 4.01 &amp; CSS 2.0 Test Page</title>
</head>

<body>

<div>
<h1>&ldquo;nowr ap&rdquo; Test</h1>
Here&rsquo;s a test of a <b>div</b> with style=&quot;whi te-space:
nowrap;&quot;: <hr />
<div style="white-space: nowrap; border: 1px solid black;">
Line 1<br />
Line 2</div>
<hr />So far, so good.<br />
<br />
Here&rsquo;s the same thing using a <b>span</b> with
style=&quot;whi te-space: nowrap;&quot;:
<hr /><span style="white-space: nowrap; border: 1px solid
black;">Line 1<br />
Line 2</span> <hr />Why is the border so foobar&rsquo;d? I would have
expected the
span to be enclosed in a box.<br />
<br />
In FP 2003 it previews with no border at all. In IE6 and Opera 7.23
the border
encloses the top, left, and bottom of line 1 and the top, bottom, and
right
of line 2.<br />
<br />
<br />
What I&rsquo;m trying to do: <hr />
<form action="css-sample.html">
<div style="white-space: nowrap; display: inline;">
<input type="text" size="10" id="First1" /><br />
<label for="First1" style="font-size: xx-small;">First</label></div>
<div style="white-space: nowrap; display: inline;">
<input type="text" size="10" id="Last1" /><br />
<label for="Last1" style="font-size: xx-small;">Last</label></div>
</form>
<hr /><br />
<br />
What I&rsquo;m forced to do: <hr />
<form action="css-sample.html">
<table style="border-collapse: collapse" cellspacing="0"
cellpadding="0" >
<tbody>
<tr>
<td><input type="text" size="10" id="First2" /><br />
<label for="First2" style="font-size:
xx-small;">First</label></td>
<td><input type="text" size="10" id="Last2" /><br />
<label for="Last2" style="font-size: xx-small;">Last</label></td>
</tr>
</tbody>
</table>
</form>
<hr /></div>

</body>

</html>
Jul 20 '05 #1
0 15191

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

Similar topics

5
3327
by: qwweeeit | last post by:
Hi all, I need to limit as much as possible the lenght of a source line, stripping white spaces (except indentation). For example: .. . max_move and AC_RowStack.acceptsCards ( self, from_stack, cards ) must be reduced to: .. . max_move and AC_RowStack.acceptsCards(self,from_stack,cards) My solution has been (wrogly): ''.join(source_line.split())
1
1704
by: Bob Bedford | last post by:
I've about 50`000 jpg images on a dir. Some images have a white frame, other only 2 white lines, sometimes vertically, sometimes horizontally. I've to show those image on a darkgrey background, and the result is ugly. It's there any way to detect those white lines, then change their color for showing on the screen ? I won't change the color of the frame on the image itself, but when showing them. Also take in mind that some parts of...
11
15019
by: gopal srinivasan | last post by:
Hi, I have a text like this - "This is a message containing tabs and white spaces" Now this text contains tabs and white spaces. I want remove the tabs and white spaces(if it more than once between two words). Is there any function we have in C which will find out the tabs and white spaces and returns the text in the follwong way -
2
2457
by: headware | last post by:
I've been getting a strange bug occurring in my ASP.NET pages. If while waiting for a page to load, the user clicks a dropdown listbox that causes postbacks, the whole screen turns white and it apparently cannot be refreshed. I have a framed layout and only the main frame turns white. If you click on menu options on the left frame (which remain intact) you can see that the pages are loading but nothing appears in the main frame. It remains...
11
1624
by: Dennis D. | last post by:
Back a few decades the proper way to learn a language began with a white paper. Do they exist for dot net, or would a person begin by studying the compiler specs? Guess what I'm asking is: Where does it all start? -- http://www.dennisys.com/
7
10849
by: marfi95 | last post by:
I'm trying to implement some code in vb.net to allow the user to adjust the brightness or contrast on an image (through the use of a slider) that is already black & white in the bitmap. I have tried to use the colormatrix and even down to the pixel using GetPixel and SetPixel in system.drawing, but I'm really not up on using gdi+ and haven't really gotten anywhere. I've seen some examples for VB6, but I need vb.net. I know that all...
9
3779
by: martin1 | last post by:
Hi, All, how to flash button with 2 color( eg. red and white)? then when user click button, the button stop flash and stay red color? Thanks
1
2046
by: bmjnine | last post by:
Hi all, I am converting image files of various formats to JPEG using: System.Drawing.Image img = System.Drawing.Image.FromFile(myfilepath); Works great except that transparent GIF's are over a black background instead of white. What would be the simplest way to convert GIF's to an Image object over a white background?
2
1536
by: origenes | last post by:
Hi forum, Below is a sample code that creates a "white" gif image. I want to know... why the background result color is FEFCFE intead of white (FFFFFF)? When I use imagecreate instead of imagecreatetruecolor, the white color is OK. Thanks in advance! <?php $file= "image.gif"; $img = imagecreatetruecolor(100,20);
3
1918
by: ayan4u | last post by:
well i need to deal with white spaces in charecter arrays... with static arrays its fine.. char ss; cin.getline(ss, sizeof ss); .... //deals with white spaces
0
9621
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
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
10264
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
7461
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6716
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
5355
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...
1
4009
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
3610
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2851
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.