473,685 Members | 2,581 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Yet another problem with inline-block

16 New Member
hello all,

i have very irritating problem with spans and firefox. I'm developing simple form designer, where user can drag and drop "components " (like labels, textboxes etc) on the form and save it for later use. it looks something like that:
http://www.dxlxb.com/vz/formdesigner.jp g

now, I need to display a span OR a div in a table cell when user drops a "control". the problem is that div takes all available space in a cell, so I've decided to go ahead with spans. everything works fine if span content is not wrapped in a cell. here are some examples:
http://www.dxlxb.com/vz/test.html
as you can see, option 2 is what I'm trying to achieve. could someone give me any idea how to create span or div which looks like option 2 in IE6+ and FF?

p.s. I've tried using divs instead of spans - as I understand I need to add float: left to force div not to take all available space, but then vertical alignment is very wrong.

thanks in advance.
Oct 9 '07 #1
14 1998
drhowarddrfine
7,435 Recognized Expert Expert
'inline-block' doesn't work in Firefox so you must use the -moz version. inline-block' only works in IE when the contents are actually 'inline' such as text in a <p>. I don't think text in a <td> qualifies as such.

<span> works fine in all browsers so that won't be the issue.

Make sure you are testing with a strict doctype otherwise IEs broken box model may get in your way.
Oct 9 '07 #2
vytas
16 New Member
as I said - span doesn't work as I want in FF when text in it is wrapped. please review my testing page to see what I'm talking about.
Oct 9 '07 #3
drhowarddrfine
7,435 Recognized Expert Expert
I think I understand now. You are trying to get the red outlines to wrap around the whole text? If so, you can still use a <div> but, since this is text, why don't you use a <p>? In both cases, you can just set margins, position absolute and to keep that to one spot inside the <td> while leaving room for the other things.
Oct 9 '07 #4
vytas
16 New Member
yes, exactly, I want outlines to wrap around the whole text. and actually I have no idea why I didn't try p tag - if p can be converted to inline block, that it's suitable for me. I'll try that and post another reply in case that won't work.
Oct 10 '07 #5
vytas
16 New Member
ok, I'm starting to rip my hair of - I'm trying to achieve something so simple, but can't make this work on FF.
I'll reformulate my question:
I need to display an inline-block object (span, p, div, whatever). since FF doesn't support inline-block, I'm using -moz-inline-stack. the problem is - if content in span or p is wrapped, FF shows only first line.
examples:
http://www.dxlxb.com/vz/test.html
in IE, tests #2, 3 and 4 are fine, thats exactly what I need. in FF though non of them works. how can I force FF show spanned content?

p.s. the reason I'm not using div is that divs take all available space, which is not what I need.
Oct 10 '07 #6
drhowarddrfine
7,435 Recognized Expert Expert
But doesn't -moz-inline-block do what you want?
Oct 10 '07 #7
vytas
16 New Member
uuffff... finally I've managed to display what I need. I have one more question though:
two css definitions:
Expand|Select|Wrap|Line Numbers
  1.     display: -moz-inline-block;
  2.     display: inline-block;
and
Expand|Select|Wrap|Line Numbers
  1.     display: inline-block;
  2.     display: -moz-inline-block;
are not the same (IE behaves differently). could someone explain me why?
Oct 10 '07 #8
vytas
16 New Member
But doesn't -moz-inline-block do what you want?
DAMN IT!!!!!!!! -moz-inline-block DOESN'T work if I add text align on table cell. for example:
[HTML]<table>
<tr>
<td style="text-align: center">
<span style="display: -moz-display-block">test</span>
</td>
</tr>
</table>[/HTML]
in this case span will be block, and not inline block (i.e. will take all space available). if I remove text-align - everything works fine. any suggestions?
Oct 10 '07 #9
drhowarddrfine
7,435 Recognized Expert Expert
Are you using a doctype?
Oct 10 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

3
4679
by: Nicolas Payre | last post by:
Hi, I have the following SQL that I want to use to update a table. It doesn't work ! Does someone knows why? ** I Know it could be done easy with a CURSOR FOR LOOP, but still... Thanks for your help. update XSORA1A.XS0011T_STATISTIQUES_UNIX a
2
2021
by: Sonny | last post by:
Hi experts, I am writing a small code to read input from a file, for example my input file is: X Y Z 26.0 28.0 0.0 32.0 8.0 0.0 My code is: #include<iostream>
9
1672
by: tonysuper | last post by:
Probably i have problem with co/des : if i call functions wich returns farray, programs go seg fault. if i comment destructor.. programs work but do not free memory. Any suggestion? farray and fmatrix are fast 1-index based array and matrix. f means fortran.
8
1495
by: Joseph | last post by:
I am attempting to create a function that will hide all SPANS within an ided DIV ="idMain", then only display one span, but this function gives an error when it gets to elChildElement as being undefined. The show_hide_Div function is meant to be called when a Radio button is selected. See below. Can anyone help function show_hide_Div(theDiv,DivsToHide,TheDivToShow) { elDiv = document.all.theDiv;
1
2152
by: mouli | last post by:
Hi all, i have an xml structure something like the given below one and i am facing problem in handling the contents inbetween CDATA, i mean the subtag '<inline-fig>' is printed as it is like this" <inline-fig> <link locator="fx1"/> </inline-fig> " which should not be (it should be treated like a tag not a text) <bib:SUBTITLE> <!]> </bib:SUBTITLE>thanks in advance
3
1691
by: shuisheng | last post by:
Dear All, If I define a virtual function to be inline, is it really inline? Or it is inline in some cases, and not in other cases. Would you please help me to look at the following case. struct A { int i; A() {i = 0;}
2
3161
by: shivendravikramsingh | last post by:
hi friends, i m using a ajax function for retrieving some values from a database table,and display the values in required field,my prob is that the ajax function i m using is working f9 once,but if i change something in php file using in ajax function.it not refreshed,means its shows the previous result it not get updated.i can't understand whats the prob.this is the code i m using: <? include("config.inc.php"); //error_reporting(0); ...
8
2076
by: Martin the Third | last post by:
Hi, I need some help! I'm writing an infinite-precision floating point library called ipfloat (I know infinite is a misnomer - but arbitrary was taken). A quick overview: I'm storing numbers as a char* mantissa, an int exponent and a sign. For example, the number "123.45" would have a mantissa of 12345, an exponent of 2, and a sign of +. I'm essentially storing it as "1.2345x10^2". The mantissa is allocated dynamically at runtime to...
2
237
by: bingo | last post by:
Hi, All: I was really new to C++, so please forgive me if I asked stupid questions. I was trying to use this following Vector class(not written by me) to do some calculations : ============================================= class Vector { public:
1
1233
by: Richard Tobin | last post by:
In article <eb4e5dda-302b-44cd-ba4e-ef09239d6a02@e2g2000hsh.googlegroups.com>, Rainer <wolf.rainer@gmail.comwrote: This will return the text descendants of the <lielements: /foo/ul/li//text() -- Richard
0
8577
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
8512
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
9048
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
8928
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8763
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
7591
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...
1
6436
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
4303
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
2941
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

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.