473,396 Members | 1,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

"display: inline-block;" question

Hi,

current browsers don't support "display: inline-block;" and "display:
inline-table;", resp. Thus I'm using "float: left;" to achieve a similar
effect.

Problem is that if a row of elements uses this kind of block floating, they
don't wrap to build a whole new line but instead get "hooked" at the
left-most element being larger than the element right beside this
"overflowing" element.

On my website I'm making heavy use of this property. To see the effect, see

http://www.sportbootcharter.com/Spor...?cont=Search.a
spx%3Fps%3d1

and resize page. (Works only for IE at the moment as ASP.NET renders pages
differently for IE, I'll fix this later...)

It looks quite jagged this way. Can someone please enlighten on how to force
kind of a line-feed?

Also, will "display: inline-block;" and "display: inline-table;" enforce
this kind of a thorough line-feed? (I think so, just want to reinsure...)
Sketch of the current situation (all elements style="float: left;"):

|---| |---| |---|
| | | 2 | | 3 |
| 1 | |---| |---|
| |
|---| |---| |---|
| 4 | | 5 |
|---| |---|
Sketch of the desired situation(all elements style="display:
inline-table;"):

|---| |---| |---|
| | | 2 | | 3 |
| 1 | |---| |---|
| |
|---|

|---| |---|
| 4 | | 5 |
|---| |---|
TIA,
Axel Dahmen
Jul 21 '05 #1
4 7720
"Axel Dahmen" <NO*****@NoOneKnows.invalid> wrote:
current browsers don't support "display: inline-block;" and "display:
inline-table;", resp.
Some do, some don't:

IE: supports inline-block, but only on elements that default to inline,
it doesn't support inline-table.
Gecko based browsers: they support neither.
Opera 4+ support inline-table, Opera 7+ supports inline-block.
Safari: supports inline-table, I don't know if it supports inline-block.
Thus I'm using "float: left;" to achieve a similar effect.
Floating is something else entirely.
Problem is that if a row of elements uses this kind of block floating, they
don't wrap to build a whole new line but instead get "hooked" at the
left-most element being larger than the element right beside this
"overflowing" element.

Also, will "display: inline-block;" and "display: inline-table;" enforce
this kind of a thorough line-feed? (I think so, just want to reinsure...)


It should, see
http://www.spartanicus.utvinternet.i..._captions2.htm

--
Spartanicus
Jul 21 '05 #2
Thanks for helping me on this, Spartanicus.

Your sample looks really good!! I didn't know that IE partially supports
this new property.
I've tried it locally and it yields great results. Well, however, Gecko
browsers don't support it so I still can't make use of it.. *sigh*

Floating is something else entirely.
Of course, I am aware of that, but AFAIK it's currently the only available
option to achieve something similar to the desired effect; I have to stick
with the most popular browsers and even be backward compatible a bit. Still
a hack, though...
Do you perhaps see another option, supported both by Gecko/IE6?

Regards,
Axel
------------
"Spartanicus" <me@privacy.net> schrieb im Newsbeitrag
news:9n********************************@news.spart anicus.utvinternet.ie... "Axel Dahmen" <NO*****@NoOneKnows.invalid> wrote:
current browsers don't support "display: inline-block;" and "display:
inline-table;", resp.
Some do, some don't:

IE: supports inline-block, but only on elements that default to inline,
it doesn't support inline-table.
Gecko based browsers: they support neither.
Opera 4+ support inline-table, Opera 7+ supports inline-block.
Safari: supports inline-table, I don't know if it supports inline-block.
Thus I'm using "float: left;" to achieve a similar effect.


Floating is something else entirely.
Problem is that if a row of elements uses this kind of block floating, theydon't wrap to build a whole new line but instead get "hooked" at the
left-most element being larger than the element right beside this
"overflowing" element.

Also, will "display: inline-block;" and "display: inline-table;" enforce
this kind of a thorough line-feed? (I think so, just want to reinsure...)


It should, see

http://www.spartanicus.utvinternet.i...with_captions2.
htm
--
Spartanicus

Jul 21 '05 #3
"Axel Dahmen" <NO*****@NoOneKnows.invalid> wrote:
Do you perhaps see another option, supported both by Gecko/IE6?


Adding top and/or bottom margin so that the row of floated elements are
all the same "size" will prevent the "jagged" rendering. Lot's of manual
work though if the natural element sizes are unpredictable.

--
Spartanicus
Jul 21 '05 #4
In article
<9n********************************@news.spartanic us.utvinternet.ie>,
Spartanicus <me@privacy.net> wrote:
"Axel Dahmen" <NO*****@NoOneKnows.invalid> wrote:
current browsers don't support "display: inline-block;" and "display:
inline-table;", resp.


Some do, some don't:

IE: supports inline-block, but only on elements that default to inline,
it doesn't support inline-table.
Gecko based browsers: they support neither.
Opera 4+ support inline-table, Opera 7+ supports inline-block.
Safari: supports inline-table, I don't know if it supports inline-block.


Both Safari and iCab 3.0 suport display:inline-block.

--
Sander Tekelenburg, <http://www.euronet.nl/%7Etekelenb/>
Jul 21 '05 #5

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

Similar topics

14
by: Chris Mantoulidis | last post by:
I am not clear with the use of the keyword inline... I believe you add it do a function when you implement the function inside the header file where the class is stored... But is that all? What...
9
by: John Rambo | last post by:
Hi, I made the following test program: //////////////////////// classes_1.cpp #include <iostream> #include "classes_1.h" using namespace std; A::A():i(0){cout <<"const A: i =" << i <<endl;}...
5
by: Sue | last post by:
Help! I have an asp table with an embedded table. The asp tablerow that contains this table has a static ID assigned of "FilterRow2" (see snippets of code below). When I click on the button to set...
14
by: Frederick Gotham | last post by:
The original purpose of "inline" was that code could be "expanded in place". Of course, it has other uses... For one thing, the following two translation units will compile together succesfully...
4
by: Aaron Gray | last post by:
Hi, I want an "isZZZ" variable that I can use to generate "display: -moz-inline-box;" rather than "display: inline-block;" but in DOM. For this I need to know what version of Mozilla this...
12
by: Dave H. | last post by:
Please redirect me if this message is posted to the wrong group. Given the intention of delivering content to an HTTP user agent (such as Internet Explorer) which is to be immediately opened by...
2
by: mandarchalke29 | last post by:
Can you please tell me that document.getElementById("").style.display="Inline" what does this statement will do.
2
by: musicmaster890 | last post by:
Okay, I cannot figure this out. I have an external javascript file to declare variables and functions in my <head> element of my HTML. I've done this before and have made it work. And, likewise,...
17
by: Juha Nieminen | last post by:
As we know, the keyword "inline" is a bit misleading because its meaning has changed in practice. In most modern compilers it has completely lost its meaning of "a hint for the compiler to inline...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...
0
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...
0
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...
0
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,...

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.