Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-10-18 09:14:54

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,196
Website

oddity in hive/textpattern.css

This (in the nightly builds, but with other selectors also in TXP 4.5.x):

.txp-label,
.txp-value {
  display: inline-block;
  float: left;
/* more */
}

I wonder what this combo does (aka is this a hack ?).

In my book it is completely non-sensical, as per CSS2.1:9.7, the display value of the element will be ‘block’ anyway. IOW, the display: inline-block part is just clutter (or the float: left part, omitting it would give equally good results in the supported browsers).

(I encountered the same weirdo combo in a stylesheet I recently inherited and asked on a CSS mailing list; nobody could find a good reason for it so far)


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#2 2012-10-18 10:35:24

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: oddity in hive/textpattern.css

It goes on <span> tags, which are by default inline not block elements, though now you mentioned it I seem to remember that I read somewhere that by floating something you change it’s status from inline to block anyway.

However, since the float is removed at media-query I would need to state the inline-block either as it current is or in the media-query rule – it makes little difference (I guess I could move it to the media-query just for cleanliness).

Offline

#3 2012-10-18 11:57:42

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,196
Website

Re: oddity in hive/textpattern.css

philwareham wrote:

It goes on <span> tags, which are by default inline not block elements, though now you mentioned it I seem to remember that I read somewhere that by floating something you change it’s status from inline to block anyway.

Right, that’s CSS 2.1:9.7 linked above.

However, since the float is removed at media-query I would need to state the inline-block either as it current is or in the media-query rule – it makes little difference (I guess I could move it to the media-query just for cleanliness).

Oh, right, missed that one. Moving it would would be clearer cleaner yes.
Or, as I noted, drop the float declaration completely; you’ll get the same results.

(Which doesn’t solve my conundrum with that other stylesheet… :-( )


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

Board footer

Powered by FluxBB