473,594 Members | 2,713 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

nobr

I have a series of radio buttons with a "label" to the right. I don't
want the label to break from the radio button when the line wraps and I
want each label/button pair to take the same space.

Something like this comes to mind:

nobr{width: 8em}

<nobr><input type="radio" ...> $5.00</nobr>
Seems to me that nobr never made it into and html specs, or am I wrong?

Also, is it OK to specify widths, horizontal margins and padding for
inline elements?

Better way?

this also comes to mind:
<span><input type="radio" ...>&nbsp;$5.00 </span>

Jeff
Apr 9 '06 #1
4 2913
Jeff <do*********@al l.uk> wrote:
I have a series of radio buttons with a "label" to the right. I don't
want the label to break from the radio button when the line wraps and I
want each label/button pair to take the same space.

Something like this comes to mind:

nobr{width: 8em}

<nobr><input type="radio" ...> $5.00</nobr>
Seems to me that nobr never made it into and html specs, or am I wrong?

Also, is it OK to specify widths, horizontal margins and padding for
inline elements?

Better way?

this also comes to mind:
<span><input type="radio" ...>&nbsp;$5.00 </span>


How about <label> ? It was designed for the purpose of markin up form
control labels. Seems to be exactly what you're doing.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net > <http://steve.pugh.net/>
Apr 9 '06 #2
Steve Pugh wrote:
How about <label> ? It was designed for the purpose of markin up form
control labels. Seems to be exactly what you're doing.


It's useful for other purposes, but it doesn't prevent line breaks.

For a set of radio buttons, the structured way is something like

<fieldset>
<legend>Selec t the amount of donation</legend>
<div><input id="a1" type="radio" ...> <label for="a1">$5.00</label></div>
<div><input id="a2" type="radio" ...> <label for="a2">$6.00</label></div>
<div><input id="a3" type="radio" ...> <label for="a3">$7.00</label></div>
</fieldset>

Then you can set
fieldset { white-space: nowrap; }

It would suffice to use &nbsp; instead of a space, but in a general
case, the label text could contain several spaces, making this
impractical, or hyphens, making this insufficient.

As regards to making the fields fit into, say, 8em, the best approach is
to avoid creating such problems. Put a form on a page of its own where
it can occupy the entire available width.
Apr 9 '06 #3
Jeff wrote:
I have a series of radio buttons with a "label" to the right. I don't
want the label to break from the radio button when the line wraps and I
want each label/button pair to take the same space.

Something like this comes to mind:

nobr{width: 8em}

This makes no sense. <nobr> is a directive to prevent line wrapping. It
has no dimensions, just as <br> or <em> has no dimensions.
As others have mentioned, a <fieldset> and <label>s look like what you
should be using.

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Apr 9 '06 #4
nobr will not validate. use CSS white-space:nowrap;

Apr 10 '06 #5

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

Similar topics

1
8399
by: fadfdsj | last post by:
Hi, I would like to extract data from the table attached. Could someone help me to create the regular expression to grab that informations? TABLE: <table border=1 cellpadding=4 cellspacing=0 width=100%><tr bgcolor='#dcdcdc'><td align=center><b>Data</b></td><td align=center><b>Apertura</b></td><td
0
3480
by: Michael Fork | last post by:
Note: I pasted the code the attachments as plain text after the message (I wasn't able to post it with an attachment...) Attached are the XSL and XML files that I am having problems with. I am trying to extract the stock information after having downloaded the HTML and converted to XML (well-formed HTML) using XSL and XPATH and am unable. I am basing what I have done so far off of...
2
9923
by: BeEnola | last post by:
Hi! I have a result of a Java-Library that looks similar to <td class="xyz"><nobr>TEXT</nobr></td> I am not able to change this coding. But has anybody an idea to define another tag - outside the table or by overwriting the class-definition - that prevent the <nobr>? The result should be that the text is allowed wrap. Is there any solution for my problem?
27
31397
by: The Bicycling Guitarist | last post by:
Hi. I found the following when trying to learn if there is such a thing as a non-breaking hyphen. Apparently Unicode has a ‑ but that is not well-supported, especially in older browsers. Somebody somewhere said: Alternately, you can use CSS to declare a class having: ..nowrap { white-space:nowrap } .... and then wrap the compound word in a <span class=nowrap></span> tag (or any other suitable inline tag). You can also try {...
2
6504
by: MattB | last post by:
Hi I have a form with a CheckBoxList that gets bound at runtime. I split it into columns if there are a lot of items, but the formatting of those columns isn't what I was looking for. Specifically, I don't like how the labels wrap and would like to prevent them from wrapping, but I don't see a property that applies to this. How can I keep the labels on one line? Thanks! Matt
1
1656
by: Mike P | last post by:
I am trying to populate a dropdown from a stored procedure, but I am getting the error 'Object doesn't support this property or method: 'Next' : <!--#include file="include_connection.asp"--> <!--#include file="adovbs.inc"--> <% set objConn = server.createobject("adodb.connection")
2
1340
by: clarihorn | last post by:
I have a script which prints extracts from a database to produce an HTML report by month, grouped by calendar year. The relevant part of the script is below. I now want to adapt the script to group by financial year eg 2007/08 March to April inclusive. Can anyone suggest how I could adapt the script, maybe be creating a new variable 'finyear'? sub report_5 () { my ($title) = @_; output_title($title,5); output_heading ('Month', '|...
3
2268
by: Csaba Gabor | last post by:
I have a table with 3 rows, and two pieces of data to display in each row. However, the first element of the last two rows and the 2nd element of the 1st row are very short. This would seem to imply three columns where the first and last columns are narrow and the (implied) middle one getting the bulk of the width. <table border id=tbl> <tr><td colspan=2><nobr>This is supposed to be long</nobr></ td><td>Fred</td></tr>
11
2842
by: Andreas Prilop | last post by:
On Fri, 4 Jul 2008, fidokomik wrote: Which? I think <news:comp.infosystems.www.authoring.htmlis better suited. This is discussed in detail at
0
7946
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
7876
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
8251
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...
0
8234
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
6654
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5408
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
3897
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2385
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
0
1210
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.