473,698 Members | 2,403 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

inline-block: Are things really this bad?

Any suggestions? I want a sequence of composite "blocks" (e.g. image
and caption representing a product category) to wrap like text as a
browser is made wider/narrower. Tables are not working well for this
application. Any fixed choice of column numbers is always the wrong
choice!

I looked up about CSS block flow , found "display:in line-block;" and
thought problem solved - till I tested in IE & FF. Nightmare!!! After
*much* fiddling I have managed some code that seems to "work" robustly
in FF & IE. (example at http://mtoto.org/bits/flow-test.html). - But it
doesnt validate 'cos I had to put a <div> inside a <span>! Tomorrow I
might try using <li> in place of the outer <span> to see if that at
least avoids the div-inside-span hack.

There must be an easier way to "in-line" arbitrary blocks! If you know
it please tell me.

Nov 4 '05 #1
15 2341
"otto" <ic*****@veryco ol.co.uk> wrote:
Any suggestions? I want a sequence of composite "blocks" (e.g. image
and caption representing a product category) to wrap like text as a
browser is made wider/narrower.


http://www.spartanicus.utvinternet.i...h_captions.htm

--
Spartanicus
Nov 4 '05 #2
In article
<u2************ *************** *****@news.spar tanicus.utvinte rnet.ie>,
Spartanicus <in*****@invali d.invalid> wrote:

[...]
http://www.spartanicus.utvinternet.i...h_captions.htm


2 comments:

- Yes, iCab 3 supports inline-block

- What makes you think iCab has anything to do with KHTML? iCab has its
very own rendering engine.

This is weird. Your site is the second I see today that says iCab is
KHTML based. <http://www.publish.com/article2/0,1895,1881400, 00.asp> is
the other one. I wonder where that comes from. Some confusion due to
both of them passing Acid2 at more or less the same moment perhaps?

--
Sander Tekelenburg, <http://www.euronet.nl/%7Etekelenb/>
Nov 4 '05 #3
Sander Tekelenburg <us**@domain.in valid> wrote:
- What makes you think iCab has anything to do with KHTML? iCab has its
very own rendering engine.


Odd mistake, I knew that.

--
Spartanicus
Nov 4 '05 #4
Spartanicus wrote:
http://www.spartanicus.utvinternet.i...h_captions.htm


Thanks for that pointer and nicely written up too. Would that work for
arbitrary content though? I would welcome your criticism of my current
solution:-

http://mtoto.org/bits/flowing-galleries.html

'fraid I havent written it up but I have commented the html source it
if you have a moment to look.

Nov 4 '05 #5
"otto" <ic*****@veryco ol.co.uk> wrote:
http://www.spartanicus.utvinternet.i...h_captions.htm
Thanks for that pointer and nicely written up too. Would that work for
arbitrary content though?


To get the caption width to match the images the size of the image needs
to be specified in the CSS. There is no realistic way around that.

Other potential problems are described in the article.
I would welcome your criticism of my current
solution:-

http://mtoto.org/bits/flowing-galleries.html


I don't see the point of bothering with inline-block unless the aim is
to center the image/caption combos (your demo left aligns for me).

--
Spartanicus
Nov 4 '05 #6
Spartanicus wrote:
To get the caption width to match the images the size of the image needs
to be specified in the CSS. There is no realistic way around that.
I was really meaning: Would your CSS work for *any* type of element not
just different width pictures - a set of tables say?
I don't see the point of bothering with inline-block unless the aim is
to center the image/caption combos
How else? I am new to CSS but float: seemed very unpredictable unless
you pre-fix the height of all elements. And it can have unexpected
side-effects on following elements in my experience. In any case...
(your demo left aligns for me).


Only cos I chose the default to left align - thats the point. This CSS
is not just crafted for one gallery with one type of content (e.g.
pictures) in mind but to provide a common framework for *all* our
galleries *whatever the content*.

With the flick of a switch (aka CSS overide) a gallery can be centered
or right aligned. E.g. the little nested gallery is in fact center
aligned - it uses the exact same CSS classes as the main gallery.

Nov 4 '05 #7
p.s. I beleive my solution top aligns properly (even in gecko).

Nov 4 '05 #8
"otto" <ic*****@veryco ol.co.uk> wrote:
To get the caption width to match the images the size of the image needs
to be specified in the CSS. There is no realistic way around that.


I was really meaning: Would your CSS work for *any* type of element not
just different width pictures - a set of tables say?


Using tables instead of the images would produce hopelessly invalid
code.

To get tables to display inline there is the "inline-table" value for
the display property. Support for this value is even worse than for
"inline-block", despite the fact that inline-table is part of the CSS2.0
rec published in 1998.
I don't see the point of bothering with inline-block unless the aim is
to center the image/caption combos


How else? I am new to CSS but float: seemed very unpredictable unless
you pre-fix the height of all elements. And it can have unexpected
side-effects on following elements in my experience.


You're right actually, inline-block coding is the most appropriate way
to code this regardless of alignment.

--
Spartanicus
Nov 4 '05 #9
thanx. The more I look into this CSS stuff the messier it all seems.
Surely the block containement & flow model is absolutely fundamental to
any layout styling framework?

What on earth is the need for a special "inline-table"? Why not just
allow any element to be inline or cause a break?

Nov 4 '05 #10

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

Similar topics

2
4271
by: qazmlp | last post by:
// test.h class test { public : inline void check() ; } ; // test.C inline void test::check() // Is 'inline' optional here?
23
3154
by: Mat | last post by:
<div id="container"> <div id="main"> <div id="header"> <p class="Address">123 Fake Street, </p> <p class="City">Crazy City, </p> <p class="Province">Ontario </p> <p class="PostalCode">H0H 0H0</p> <p class="Telephone">Telephone: 555-1234 </p> <p class="Fax">Fax: 555-4321</p> </div>
47
3865
by: Richard Hayden | last post by:
Hi, I have the following code: /******************************** file1.c #include <iostream> extern void dummy(); inline int testfunc() {
20
3138
by: Grumble | last post by:
Hello everyone, As far as I understand, the 'inline' keyword is a hint for the compiler to consider the function in question as a candidate for inlining, yes? What happens when a function with extern linkage is inlined? Should the compiler still export the function? Or is an inlined function implicitly static?
7
2858
by: Srini | last post by:
Hello, Rules for inline functions say that they have to be defined in the same compilation unit as their declarations. For class member functions this means that the inline member functions must be defined either within the class or within the same header file. But its generally a good programming practice to have the declarations and definitions in seperate files. This would make the future maintenance of the code easier.
5
1943
by: Tony Johansson | last post by:
Hello experts! I reading a book called programming with design pattern revealed by Tomasz Muldner and here I read something that sound strange. Here is the whole section: It says" Because inline functions are expanded at compile time, definitions of these functions, unlike other definitions cannot be separately compiled and must be
6
4000
by: RainBow | last post by:
Greetings!! I introduced the so-called "thin-template" pattern for controlling the code bloat caused due to template usage. However, one of the functions in the template happens to be virtual as well. To support thin-template, I need to make virtual function as inline. Now, I know that compiler would generate an out-of-line copy when it
2
2695
by: evan | last post by:
Hi, I've got an easy one... I need to inline a few functions from one module to another. By looking at the compiled code I can see that the function is inlined if it is called from within the same module but not if it is called from a second module i.e. extern inline. For example (extremely simplified), inline void Bob(void)
15
479
by: niklaus | last post by:
Hi, I have a doubt regarding inline functions. 1) When does the inline of function happen. During the preprocessing stage or just before the object code is produced. Can we see the source code after we have function inline just like cpp abc.C shows me the expanded macros on linux. 2) Is it the source code that is inlined or the assembly code (object code).
9
2125
by: Martin Wells | last post by:
Is there anything like __inline_is_supported to indicate whether a certain C compiler supports inline? I'm writing my code as fully portable C89, but I want to use inline. Martin
0
8609
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,...
1
8899
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
8871
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
7738
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
6528
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
5861
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
4371
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...
2
2335
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
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.