When they were writing the specifications for CSS, why didn’t they allow things to be floated center?
I was looking through an old site at work this week, that was developed long before me, and I saw someone tried to do this: float: center. So that got me thinking, why would they include the specification to float left and right, but not center?
Imagine the posibilities…the following are just a couple of simple examples of what could be possible, they are not meant to be used in a production environment.
- Float an Image Between Two Columns
In this example, I just floated the image to the right, and gave it a -100px right margin (half the width of the image). Then I just added an empty div to the right hand column, floated it left, and gave it a height and width.
- Float an Image in the Middle of One Column
This one is really hacky. I absolutely positioned the image, chose a monospaced font, and then added non-breaking spaces so that the image was no longer covering the text.
I think being able to float something in the center could really make pages more interesting. I would be curious to know if there was any specific explanation for why you cannot float to the center.
Categories
Recent Articles
May 2012
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | ||
| 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| 13 | 14 | 15 | 16 | 17 | 18 | 19 |
| 20 | 21 | 22 | 23 | 24 | 25 | 26 |
| 27 | 28 | 29 | 30 | 31 |
97 Comments
Pat
08.06.2008I honestly was just thinking about this today.
Shanna
08.06.2008I have often wondered the same thing. It would be rather useful.
Nice site BTW. :)
Stephen Cronin
08.06.2008I wasn’t wondering this at all, but I am now! It would certainly make sense (at least at first thought).
Mike Schinkel
08.07.2008Yet another example of the many many aspects of how braindead the CSS’ specification is.
Oh, did I mention how I find CSS absolutely infuriating?
dirk
08.07.2008a friend of me was using this my surprise:
I didnt even know that it was possible
dirk
08.07.2008the HTML tag was filtered out my comment
I wrote attribute align=center in a table tag..
Barney
08.07.2008Because ‘center’ isn’t a direction. Put more than two objects at the same level just inside your body tag and give them float:center. What do you suggest happena?
While we’re at it, we could make the float parametre 3-dimensional — to cover vertical and z-index positioning — and then enable it to take points that are at neither extreme (which you’ve gone only some of the way to fully specify)... Why settle for centre/50%? Why not have the shorthand…
float:33em 9px 25.6%;
...for what we would write in longhand as:
float-x:33em;
float-y:9px;
float-z:25.6%;
???
Maybe, just maybe, because it’s redundant and makes no sense in any kind of practical use-case. As you’ve demonstrated yourself in your examples, there are better ways to deal with complex positioning that not only make sense but also work (!!) and can be implemented in just about every browsers post-2000AD.
Joe
08.07.2008Yeah! If they’re going to take away my tag, the least they can do is offer up a float: center. Good point!
Barney
08.07.2008Joe,
Don’t you use margin:0 auto; on your own site?
Joe
08.07.2008That I do, but I wouldn’t mind a float: center at all.
Trevor
08.07.2008@Shanna-
Thanks! You’re site is really nice too, very creative.
@Mike-
Really, CSS infuriates you? Why?
@Dirk-
True, but that is not semantic to use a table for layout.
@Barney-
You make an interesting point about the 3 dimensional float, but I’m not sure if it makes sense. Since a floated element is not taken out of the flow of the document, like an absolutely positioned element, you really should not be able to specify the y axis. You should just add the floated element in the y position that you want it.
True, you can pretend to have something floated center like in my examples, but they should really not be used in production. They were more of a proof of concept than anything.
Also, if you float something, you cannot use margin: 0 auto to center it.
Mike Schinkel
08.07.2008Trevor:
Why does CSS infuriate me? I don’t think I could have answered nearly as clearly as was illustrated by Barney: The CSS spec is highly pedantic and complete values form over substance and usability as Barney unwittingly displayed on the spec authors behalf by proxy.
I mean margin: 0 auto instead of float:center? WTF?!? Do you know how long it took me to figure out that I needed to use margin: 0 auto? And that’s one of probably 10 reasons why CSS is totally brain-dead. There is a blog post I’ve planned for a really long time “Top 10 Reasons why CSS Suxâ€; maybe I’ll finally get to it soon.
Don’t get me wrong, the idea of separating content and presentation is masterful and clearly the right thing to do. But CSS is just wrong on three fundamental levels:
1.) The CSS cascading architecture is just a horrible choice for the use-case. As a site grows so grows the CSS and there is no way using CSS to divide and conquer as programmers can do by hiding information with objects and functions.
2.) The CSS specification was (obviously) filled with pedants who, like Barney above, worried far more about redundancy and esoteric arguments than ensuring the spec was as easy and as obvious to implement and use as possible. Their pendency hoisted tremendous inefficiency of implementation on an unsuspecting public.
3.) There are just too many use-cases that are either impossible to do with CSS or that require complex and fragile hacks that required untold numbers of expert hours to discover and document. And then a new browser version comes out and the hack is broken.
Case in point: Why is the 3 column layout such a holy grail when one can implement a fully working 3 column layout using tables in under 30 seconds? Answer: Because CSS is brain-dead. The CSS spec could have implemented explicit relationships between elements but obviously didn’t
And yes this is definitely a contrarian view when compared to the chorus of standardistas but I contend that the standardistas have never stopped to consider whether the CSS standard was a standard worth supporting. I think instead they’ve just acted like mushrooms and appreciated those who’ve shoveled shit onto them (that’s more of a commentary on human nature than on standardistas, btw.)
And we all know that standardistas complain that browsers don’t implement the standard correctly. I think the blame should be on the CSS spec authors and not on the browsers. Had they not made the spec so convoluted and counter-intuitive and omitted direction on so many aspects maybe the browsers would have had no problem at all implementing the standard. Don’t blame the mirror for the ugly face staring back at you!
BTW, I spent some time on the HTML5 working group and found it was filled with exactly the same type of pedants I’m complaining about here, and that is why I also don’t hold high hopes for HTML5. And I do also realize that given the install base of browsers nothing can erase CSS at this point but that still doesn’t want to keep me from venting on the issue.
I you haven’t noticed I do feel pretty passionately about this issue.
Barney
08.07.2008Oooh…
To be honest Trevor, the CSS spec is too loose at the moment in my opinion. Argue if you will, but the fact that the mathematical use-case definitions for rules are not precise enough in a completely anal way means that the rules can be interpreted differently by different browsers. As such, I spend hours and hours of time I could use doing more work on jostling with the libretto of CSS to make all major browsers use their various processes to come to something that looks the same.
If it were up to me, it would be a lot more complicated! I appreciate it gives headaches, particularly to people who just want to design and get it over and done with, but the truth is somebody has to worry about how these things are defined. If it’s not you or W3C, you leave it up to the browser. The end-user might not appreciate that :)
Trevor
08.07.2008@Mike-
Wow, I didn’t realize that you had such strong feelings about the CSS specs! It’s good to be passionate about it, that means that you want it to improve.
I agree, there are some pieces of CSS that you just wonder: what the hell? Obviously, I just had one of those moments, which prompted me to write the post. I would be interested in seeing your “Top 10 List” though.
The idea behind CSS is definitely a great idea, but you are right in saying it could have been much better. But, what can we do now? Think about what has to happen in order for something to be changed:
<ol>
<li>The spec for the features must be written, and hopefully clearly</li>
<li>Browser creators have to implement the features and do tons of testing</li>
<li>They release their update/new version</li>
<li>Somehow you must get everyone to download the updated version</li>
</ol>
While I agree, some people complain too much about browsers (can we stop saying browsers and just say IE6?) not implementing the standards correctly, that is a part of the problem. While the problem may have been created by unclear specifications, the slowness of browser creators to react is unreal. I mean the fact that IE6 is still the most popular browser 7 years later is crazy! The combination of ignorance of users, crappy coding, politics, and unclear specifications are what have gotten us to where we are now.
But really, what can we do? Besides continuing to support the effort? I appreciate you taking the time to add your valuable insight, and I think just having conversations like this openly help to increase the knowledge of others.
@Barney-
You make a good point. Rarely are specifications ever clear enough for things to be implemented perfectly, hence the inconsistent implementation across different browsers.
But like I said to Mike, what can we do? Besides continue to use CSS the way it is now and supporting new versions and standards. Just think, if there were standard clear specifications when developing CSS, and they did not leave it up to the browser to interpret; we would be in a better place.
Barney
08.07.2008Sorry I’m not being clear: I reckon float:center doesn’t make enough sense to be a specified value in any way. In reality, things float up. In the CSS spec, they float left or right. These are specific extremes on axes, but floating towards the center? From where? It misses the point.
What’s wrong with the current methods? I wouldn’t call them hacks. Just because they’re clever and need a bit of explanation for human readability doesn’t invalidate them in any way. I think asking for the ability to get away with (element{put this in the middle please computer}) is not as simple as the request sounds. There are all sorts of factors in there I think haven’t been considered.
Honestly though Trevor, you should put this to the www-style list. It’s great the amount of serious dicussion you can get their for proposed aditions to CSS spec.
Mike Schinkel
08.07.2008@Barney:
First, let me start with an apology. I vented my frustration regarding the combination of the problems I see in CSS and the process involving people who are more interested in minutiae than making it usable and effective. Anyway, sorry.
Regarding your point about float:center not making sense I get your point but my point is that you are thinking in the strict sense and the human mind doesn’t work that way hence strictness reduces usability. My point is: So what if float:center has some logical inconsistencies; it’s what is “obvious” to most people so just map it’s effect to “margin:0 auto;” and be done with it.
As for the “what’s wrong with current methods”, maybe you misunderstood what I meant by “hacks.†I’m referring to the fact that so many people have to spend so much time coming up with way to do what I like to describe as “Tricking CSS into getting a layout it’s trying it’s damndest to keep you from getting.” Compare that to what I’ve proposed below. Here are just a few of the types of “hacks” I was talking about (the first one being especially good):
http://www.killersites.com/blog/2006/css-3-column-layout/
http://www.alistapart.com/articles/holygrail
http://www.glish.com/css/7.asp
The problem is that getting CSS takes far too much effort to learn and make work when CSS could have made it brain dead easy, and I call those techniques to workaround that of good design hacks. You may not like that usage, but we can then just agree to disagree because they are hack to me. And the last one illustrates how you can’t get equal length columns using CSS, but it’s a no-brainer with HTML tables; why is that?!?
And as for “the www-style list”, therein lies madness. That’s exactly what I found so infuriating; trying to reason with the pedants on the w3c lists who strike for logical purity and strict ideology vs. trying to make standards simple, workable, and easily usable.
@Trevor:
Honestly I don’t know what we can realistically do, but I know I would like to start with something else besides CSS using a clean-sheet approach. Maybe ESS for “encapsulate-able style sheets” (I suck at naming) and only allow pragmatists on the working group (okay, *that* won’t happen!) Then we could run them side-by-side and browsers could use ESS if they support it otherwise CSS. Eventually ESS would take over and we’d be looking at CSS like we look at IE5 today.
In my perfect world ESS would be specced so that there was as little ambiguity as possible and that everything deffered to what made it easier for the HTML coder/designer to use it. It should do things in ways that are most “obvious” to the least skilled person even if those ways don’t make as much strict sense when one really considers it much like how Barney is claiming float:center makes no sense. Maybe it doesn’t make sense when strictly analyzed but it was the thing you though was obvious and by god it was what I thought was obvious. That failed assumption on my part was what required me to spent literally a day trying to figure out why it wouldn’t work. It was so “obvious” to be I didn’t even think to verify it’s correctness and instead looked elsewhere for the problem.
ESS would also define relationship between elements, i.e. for this markup:
...
...
...
...
...
...
And then be able to do something like:
!define table {
row { @header }
row {
col { @nav }
col { @content }
col { @sidebar }
}
row { @footer }
}
Seems to me with the HTML table spec so well implemented it would be impossible to screw this up.
ESS should also allow HTML segments to be styled regardless of their parent’s styling (i.e. ability to disable cascading from above.) Maybe we want to style the content area w/o any of the styling from the things outside the content affecting. Maybe:
#content { !reset; ... }
ESS should also have ways to explicitly differentiate between those things that affect and element itself (color, height, width), those things that affect how it deals with it’s parents (i.e. margin, padding, etc.) and those things that affect it’s children (i.e. text-align)
#foo {
color:red;
align[parents]:center;
align[children]:center;
}
Or
#foo {
color:red;
^align:center;
~align:center;
}
And ESS should ensure everything is atomic, i.e. that no commands do two things like “position†currently does.
There’s still more but if I write about CSS but if I did it all here I’d have no need to ever write my Top 10 post!
Mike Schinkel
08.07.2008Oops, it ate my example. Let me try that fragment again:
…
…
…
ESS would also define relationship between elements, i.e. for this markup:
<html>
<head><title>...</title></head>
<body>
<div id=“content”>...</div>
<div id=“sidebar”>...</div>
<div id=“header”>...</div>
<div id=“nav”>...</div>
<div id=“footer”>...</div>
</body>
</html>
And then be able to do something like:
…
…
…
Janko
08.08.2008Wow, how such a small CSS issue caused a big discussion here. Maybe it is not that small at all? I will probably always wondering why one omitted float:center from css spec.
cenocre
08.09.2008@Barney
Float:center seems completely logical when dealing with a single object such as making an image float in the midst of a single column of text. I see your reasoning regarding Trevor’s first solution, but not when dealing with floating in a single object.
I’d like to see vertical float and the ability to set the amount of float such as float-horizontal : 20% left ; float-vertical : 20% top.
@Mike
Overall agree. Having worked with numerous graphic design programs, html, and various programming and scripting languages, CSS has to have some the worst implementation and most arcane ways of doing absurdly simple things such as 3 even columns. After working years in purely CSS I am considering using tables again. I cringe to think of the many months of my life that I have wasted trying to get CSS to do things that I could have done in minutes with tables.
Why the hell is it so hard to dynamically center an object so it floats vertically in the center of a browser window? Why can you choose centering for text but not images or other objects?
Locking a footer to the bottom of a window can be a pain particularly if you want to avoid overlap with other objects when the browser window is made too small to display all the content. I just had a design with a nicely placed footer and made a slight change in a div above it and suddenly the footer totally vanished from all browser except IE. It makes no obvious sense and I have spent many hours trying to figure it out. With tables there would not have been a problem to begin with. It would have been easy to place, would not have been affected by the other div and would have been consistent with most browsers.
And, why can’t you use math with dimensions to create dynamic dimensions? For example, I would like to size a dynamic center column or position an image by setting a percentage for that object and subtracting the dimensions of the columns on either side.
Barney
08.09.2008I really don’t understand how even this many people can think that ‘floating’ towards a point on the convas makes sense from a theory point of view. I think float’s left and right make sense, and I think automatic verical margin make sense as a mental image.
Floating is a result of a gravity-like force. No matter where something is or what it is next to, it will get ‘pulled’ by floating behaviour. Something being in the vertical middle of the page is not the result of some force being applied to it — it’s taking into context the sixe of the object that contains it and making it equidistant to the edges.
For the record, is anybody saying that float:center is behaviour that can’t already be applied using margin:auto? I’m not sure whether this is new behaviour or just a clarification of terms people are after here.
cenocre
08.09.2008If floating doesn’t make sense then why would margin:auto, width:50% or vertical align? Don’t they take into account the size of the object containing them and adjust accordingy? How is float:center any different?
As for margin:auto, afaik text would not wrap around such an object and it still would not give something the ability to float vertically. We need a centering attribute for vertically aligning objects, not just text.
This reminds me of the argument regarding innerHTML where purist would argue that one should use the DOM method that requires numerous lines of code each time one want to replace a small snippet of text. Turns out most are now using the much more straightforward and sensible innerHTML where all you need to do is document.getElementById(‘element’)[removed]=(‘NEW TEXT</’). Other than the B.S. of escaping certain characters and removing returns, it works much more simply and intuitively.
Barney
08.09.2008So cenocre, you’re talking about behaviour that can’t be replicated with existing methods?
Mike Schinkel
08.09.2008@Barney: Your response would be funny for it’s irony if it were not so painful. You are taking exactly the type of position I complained about. You are arguing the point that something which, when analyzed and fully understood, doesn’t make any sense. Yet you are completely ignoring the human factors regarding the fact that, until analyzed, float:center seems obvious to more people especially for it’s consistency with other aspects of CSS where there is a “left”, “right”, *AND* “center.”
I can’t speak for others but I’m not saying “margin:0 auto” doesn’t do the same thing we are asking for in float:center. What I’m saying is that “margin:0 auto” is about as non-obvious to a layperson (i.e. not a computer scientist) as you can get. I am much closer to the computer scientist end of the spectrum and I didn’t even get it for the longest time.
HTML authoring is becoming an integral part of our world; not just for web developers but for everyone. Bloggers need HTML skills, and anyone who publishes anyone on the web also can benefit from knowing HTML which is fast becoming every business professional on the planet. And CSS is part of that. Standardista’s scream when people don’t use CSS as it someone had molested their children, yet they ignore usability and instead pedantically focus on some bizarre notion of logical purity.
AGAIN I can’t speak for others but FOR ME this is about making CSS (and HTML, and any other related specs) to require as little training and as little understanding as possible to correctly follow the spec and make things work. Having to become steeped in the lore of CSS to the extent of a medieval blacksmith’s apprentice only serves to benefit the few CSS gurus who master it, retards CSS’ proper use within our society, and negatively affects the productivity of anyone who has to use it.
You can argue all day that these things are not logically correct but that is totally not the point. What is “obvious at first” and what is “logically correct” are often two different things and focusing on the latter to the exclusion of the former results in significantly retarded usability.
For the record: “YOU ARE RIGHT.” But equally for the record: “What you are right about DOESN’T MATTER and IS NOT THE POINT.”
Why does CSS *infuriate* me so much? Because the pedants on the standards committee ignored usability in favor of purity using the same type of arguments are you using today. By analogy, you are arguing with me issues of national sovereignty and I’m telling you that an asteroid is going to hit the planet and wipe out all life. Why do we argue about national borders when what we need to be concerned about is the planet being destroyed?
Bringing back to home, why do with argue about logical nuances when CSS is too hard for the average person to learn without a high level of motivation and an intense period of study? The route taken, focusing on logical nuances, was just stupid and needs to be corrected.
Mike Schinkel
08.09.2008@cenocre:
“This reminds me of the argument regarding innerHTML where purist would argue that one should use the DOM method that requires numerous lines of code each time one want to replace a small snippet of text. Turns out most are now using the much more straightforward and sensible innerHTML where all you need to do is document.getElementById(‘element’)[removed]=(‘NEW TEXT</’). Other than the B.S. of escaping certain characters and removing returns, it works much more simply and intuitively.”
Exactly!
cenocre
08.09.2008What about my questions?
Yes, Trevor’s second example of centered floating with text wrap is but one case where existing methods don’t work. Then there is the equal height columns, footer placement, vertical float, etc, etc. SOME can be done with, but they often require complex hacks such as display: table and display: table-cell rather than the straightforward and quick use of tables. I don’t want to use tables, but am tired of wasting time with CSS when the addition of something such as float:center would be so easy and make so much sense.
Mike Schinkel
08.09.2008@cenocre:
“I don’t want to use tables, but am tired of wasting time with CSS when the addition of something such as float:center would be so easy and make so much sense.”
Ditto.
cenocre
08.09.2008@Mike
Generally I agree with your view except for the point of view that the Standardista’s view is “right” or logical. I find there to be a significant lack of logic in much of the implimentation and structure CSS of especially in regards to inheritance and positioning. The syntax is generally okay, but whole positioning thing often makes no obvious sense.
Many of the “logical” people that I know are the UNIX geeks who work with Apache and Ruby on Rails and would seem to prefer that we steer cars with arcane keyboard commands (like -cv 45 to turn left) rather than that awful GUI steering wheel. Where’s the logic of “c” meaning change in one UNIX command while “ch” means change in another.
After running web servers for years and rarely having to consult a manual, it took me months of heavy searching to ALMOST figure out how do things in Apache that merely took 30 seconds with another server. I have now abandoned Apache for Abyss and miss nothing. Abyss is faster, too.
Go to the Ruby on Rails site and check out their introductory videos that are trying to sell the product to newbies. Within 15 seconds presentation are so full of assumptions that anyone who is not already knowledgeable is lost. It is utterly pathetic. Same thing with the intros to Python and most other langauges.
I see that much of the problem is that the standards and languages, etc. are too often created by people who lack understanding of people in general and how minds work, especially those of different perspectives. And, it seems that things such as CSS are created (or heavily influenced) by a lot of people who have little understanding (and sometimes disdain) of graphics and design. I have yet to meet one of these people who I would consider to be socially functional to a reasonable degree. I’ve met and worked closely with many, but of course, not all. In all my endeavors, we try to keep them away from having to deal with other humans, especially the public.
Basic view is the computer is here to work FOR us and make our lives easier. The computer should be doing most of the adaptation and there should be choices in methodology depending on particular style of the user. Lately, even on Macintosh it has been just the opposite. There is much less choice and tasks that used to be simple often take dramatically more time than just a few years ago. Even choosing line thickness in Photoshop is harder. I have wasted so much time trying to get my computers to do what was easy a decade ago that I spend most time nowdays in the loathe computer mode rather than the like mode. Farming and music are more appealing daily.
I suggest that we adhere to HI guidelines again and start applying them to the underlying languages as well as the GUI. After all, where it the intuitive logic to “RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
“?
Mike Schinkel
08.10.2008@cenocre: No need to take exception to my characterization of Standardista’s view is “right†or logical. I was merely trying to be somewhat gracious (if that was still possible) after being otherwise so critical. :-)
Reading your posts, I would not even say we are of like minds on this issue, I would say we are of one mind! I completely agree with *everything* you’ve said, even the part about PhotoShop which I have recently been screaming at for how counter-intuitive it is in everything it does. Grrrr.
And don’t even get me started on regex in mod_rewrite….!
Barney
08.10.2008@Cenocre: Ruby on Rails is not human-readable enough for you? That goes to show how much of a geek I am — as far as I’m concerned, Ruby is the closest functional OOP I’ve seen to the Queen’s English!
At the end of the day I don’t think I disagree with the essence of your point — computers are very complicated and it’d be great if they spoke to us a bit more on our terms — but to that extent I don’t think anybody disagrees with your driving sentiment: UNIX geeks don’t value the language they do because they don’t like the way humans think, it’s that at the end of the day the most important aspect of a computer language is not whether or not your dear self can intuitively deduce its meaning, but whether or not the computer can be given an unambiguous and precise order through it.
As we’ve seen with float:center, whereas it uses two descriptive plain english words to describe behaviour even my pedantic mind can guess the intention of, it describes different behaviour according to the different examples listed on this page — all of which fall under the human understanding but require a different set of methods for the computer.
How about writing yourself a portable Javascript toolkit file that went through your CSS, found all the objects with float:center (and any other terms you’d prefer to use) applied, and then deduced the intended behaviour from their respective positions in the DOM and wrote the specific style out for it? It would mean defining the behaviour once, and then being able to forget about the nasty details in favour of your personalised shorthand references.
Barney
08.10.2008Hey Cenocre, when I google your alias I get “Did you mean: centre ” — This was clearly always meant to be your quest!
...And if we’re going to redefine the way CSS’s terminology is used, we should definitely make it centre. Hehehe.
cenocre
08.10.2008@Barney
The Ruby on Rails syntax is relatively readable, but I was referring to the people pushing it. Someone unfamiliar with Ruby would reguire hours of examination to begin to find out that Ruby is RELATIVELY easy. There is nothing on at rubyonrails.org that is a real intro for the unfamiliar. Check out http://rubyonrails.org/screencasts and watch the first video. This is the FIRST view to most people of Ruby on Rails. The menus are cropped out. What window/tool/app is open? What is the overview of what he is doing? Why did he do the first commands? It is just assumption to the 10th power.
It would be like me talking to the layman and saying “In a eutrophic taiga lake the thermocline is several meters deep and due to anoxia in the hypolimnion it is difficult for most Osteichthyes to survive.” It’s simple to me and biologists, but it is certainly not the way I would talk to 99% of the people, especially as an INTRO to lake ecology. Empathy is required to communicate and bring your audience to your perspective. The geeks appear to lack that.
As for language and “whether or not the computer can be given an unambiguous and precise order through it”. I love math and the precision of it and, from the present perspective, view it as the language of the universe. I deeply lament our callous and careless “communication” and see that the lack thereof the a root cause of most problems. The problem with our common language is that we think we have one. I do see that we can have a very logic computer language that is reasonable and easy from the human perspective. We probably need a right AND left brained being to create it.
Again, the float:center is little different than existing css properties and the computer could handle it similarly. I would not like to write a javascript toolkit for numerous reasons such as CSS cannot do some of what is desired anyway, it is even more overhead intensive, and it would be a lot of work compared to simply doing it with tables. Also, all too often when I get CSS to do one thing, it breaks other parts of my pages. I’m looking for simplicity and compactness and a CSS that works in the manner that it advocates said it would. I agree with the basic purpose of CSS, but hate its manifestion.
My moniker is simply a shortening of my main, unfinished, and completely neglected single page (at the moment) web site - CENter Of CREtion. Matter of fact, working on it brought me here and I should be working on it and several client sites rather than writing this.
Barney
08.10.2008All in all cenocre, I think you have to resign yourself to the fact that even the DOM and HT page layout are very complicated things.
You constantly refer to ‘the layman’ but as you’ve just said — and much as I suspected — you’re a professional web designer. Surely you must accept to some extent that the reason you’re making a living is because you’re undertaking skilled work that requires knowledge and expertise that other people don’t have?
I’m not saying it’s a contradiction to do something for a living and then say that in an ideal world your trade would be redundant — I believe in the abolishment of currency but I’m still happy to charge $400 a day! — but still, have some respect for your skills. At least once a week I’ll have a kind of loss-of-context experience where I’ll go “This is ridiculous… I’m using this abstract language that makes no sense to any of my friends to tell a machine how to make a document appear on screen…”, but that’s the nature of the beast. Coding has always been weird and difficult. Computers aren’t intuitive, and achieving professional results requires professional dedication to the craft.
Mike Schinkel
08.10.2008@Barney:
I always cringe when a geek offers an “alternate solution” to address my suggestion/recommendation/plea-for-help by saying “Oh, you could implement that yourself using yada, yada, yada…” :-) That response indicates that they completely and totally do not grok in the slightest sense the whole point of the matter.
YES, we can implement practically everything ourselves but doing so doesn’t help anyone besides ourselves and it doesn’t add it into the standard that everyone understands and that everyone is supporting. If I implement my own “float:center” using Javascript that doesn’t get WYSIWYG HTML/CSS editor authors to add support for “float:center” now does it? That doesn’t get websites that document HTML/CSS to document “float:center” does it? That doesn’t get HTML/CSS trainers to teach people how to use “float:center”, does it? That doesn’t allow me to use “float:center” on websites where I can’t add in Javascript, does it? And most importantly, it doesn’t help the millions of others who are stumped over the fact that float:center doesn’t seems to be doing anything when they expect that it should.
As for Ruby-on-Rails, what Ruby really lets you do is create a meta-language in Ruby. When I was younger and less experienced I really, really liked the concept of using a meta language surface. I’ve since come to believe that it ends up being counter productive as it allows a combinatorial explosion in “the language” with most of the extensions being in “the long tail” and hence makes it very difficult for someone to learn those extensions. It’s like learning an infinitely large programming language. It also allows people who don’t understand or even realize they are doing language design to start design language add ins. It’s much better to evolve the core language and add more primitives than it is to allow a meta data layer over that language. BTW, I wrote a book on a language that allowed just such a layer (http://mikeschinkel.com/books/) so I do have some real credentials in this matter.
As for Ruby, it is such an obtuse language that I find it not good for the mainstream in any reasonable way. Yes, Rubistas call that obtuseness “elegance” which I agree with when I’m wearing my “ubergeek hat” (yes, I do have one) but in most cases that elegance causes more problems than it solves (i.e in maintainability.) In many ways Ruby is just Perl++ where Perl is the leading “write-only” language! Perl guys end up liking Ruby when they won’t like anything else besides Perl. Still I will say it is much more okay for Ruby to be obtuse than it is for CSS to be obtuse because far more people are going to use CSS comparing to people every even trying to use Ruby.
@cenocre
“Empathy is required to communicate and bring your audience to your perspective. The geeks appear to lack that.”
LOL! You can clearly drop the “appear to” from the last sentence! :-)
“Also, all too often when I get CSS to do one thing, it breaks other parts of my pages. I’m looking for simplicity and compactness and a CSS that works in the manner that it advocates said it would. I agree with the basic purpose of CSS, but hate its manifestion.”
Amen!
Mike Schinkel
08.10.2008@Barney:
“I’m not saying it’s a contradiction to do something for a living and then say that in an ideal world your trade would be redundant — I believe in the abolishment of currency but I’m still happy to charge $400 a day! — but still, have some respect for your skills.”
Wow, hats off to you for recognizing that. Most people who are so adamant about free and opensource get very testy when you suggest that maybe they should work for less money yet never see the irony! :-0
“Coding has always been weird and difficult. Computers aren’t intuitive, and achieving professional results requires professional dedication to the craft.”
While I agree, my position is that dedication to the craft means we should always be striving towards making computers adapt better to humans instead of forcing or accepting that humans would adapt to computers.
Barney
08.11.2008What would be a good solution to this, knowing as we do that the minority who run the w3 don’t understand or see the value of float:center?
Are we, effectively, doomed?
What, if anything, would make you happy Mike?
Mike Schinkel
08.11.2008@Barney: I’d be happy if half of the people on the standards committees were actually representing usability concerns of the users of HTML & CSS and not the technical concerns of browser and tools implementors. But the reality is that is unlikely to happen so all I can do is vent when my frustration builds up too much.
My hope was that people on the w3c would actually be willing to listen to other points of view but that was a false hope! So I left the HTML5 working group because I do understand the definition of insanity (doing the same thing and expecting a different result) and I wasn’t (and am still not) insane.
Probably the best thing to do is advocate for a strong movement of people to return to using tables and other “bad” habits to force the issue. If the Standardistas can’t be pragmatic and focus on usability and efficiency of authoring then we should just do that which they would find truly repugnant (use tables for layout, oh the horrors!) until they realize that it would be better to actually be pragmatic and work with others to address their needs than to passive-aggressively act like spoiled children and take control of things to ensure they are exactly as they want in them to be in their own perfect vision of the world.
If you sensed a bit of seething resentment there, that’s mean you are insightful.
Barney
08.11.2008If you want words of comfort from a technical-detail maniac (like this one), I say there’s no problem whatsoever using tables — they read left-to-right, just like they’re sequenced in the markup, in screen-readers, and there’s no way usability problems are going to come in. Nobody’s going to go “Hang on what’s this, when I look at the source I see a table, but this navigation isn’t technical tabular data! I no longer understand this webs!!”. I find that on the intra-cell level strong layout control breaks down — and I can achieve whatever aligment or box-stretching using other simple CSS methods — so I don’t use tables as a matter of practical preference.
But then again, doesn’t this go against your whole ethos — you’re complaining on the one hand that we need more obvious descriptive terms that the man on the street can easily understand, and you’re saying that the man on the street desperately needs a description based on cells and ‘floating’ boxes?
Sorry to come out with it but I can’t believe that for a second. Grab someone you know who doesn’t know CSS. Tell them that to centre something, they want to (obviously!) use ‘float’ or ‘table cells’. Is that really going to make sense? On the other hand, people remember margins as layout descriptors from the real world, I think they could understand that.
Just my two cents, mind.
Mike Schinkel
08.12.2008@Barney:
“I say there’s no problem whatsoever using tables”
There’s a segment of Standardistas that focus on semantics and they hate, I mean HATE the use of tables for anything that is not tabular data. And in concept I agree with them but CSS has made layout so difficult I think that semantics should take a back seat until implementation becomes easier.
It’s kinda like gasoline, at $1/gallon nobody looked for sustainable energy to replace it, but at $5 and $10/gallon things are and will change completely. Similarly if the Standardistas get their semantic markup in large by hoisting the pain of implementation on everyone else, and everyone else puts up with it because they are told by the standardistas that is it the “right” way to do things, the standardistas won’t feel the push to fix CSS. But if people revolt and stop using CSS for layout then the standardistas may actually feel compelled to fix things.
“But then again, doesn’t this go against your whole ethos — you’re complaining on the one hand that we need more obvious descriptive terms that the man on the street can easily understand, and you’re saying that the man on the street desperately needs a description based on cells and ‘floating’ boxes?”
You are completely discounting the way people learn, probably because maybe you’ve not studied it? I was a trainer for seven years and studied cognition and how people learn things so I know a little about this. Or maybe you attribute such strong value to things being consistent with your logical view of the world that you’re unable to cede that usability is important?
People rarely actually think logically about how things work; they only do that when all else fails them. They instead look for things that are similar and try to apply what they already know, and it’s not just the “dumb ones” that do this; everyone does it.
Trevor is clearly not a dumb one, from his blog he’s obviously very sharp and he did what I’m describing. It’s the way human cognition works. To go against that just adds an unneccesary cognitive burden, but it’s a burden that people who are extremely smart and knowledgable in a subject so often want to hoist onto those who are not as smart, not as knowledgeable, or more generally just don’t really care to understand at the same level, i.e. most people just want things to work and don’t really care to learn why things work or don’t work, especially with HTML & CSS.
As I’ve already said, most people don’t use logic to figure things out, they compare to what they already know that is similar and try to match patterns.
In this case consider CSS; very few people learn CSS before learning HTML otherwise how would they apply the former to the latter? And in HTML they learn that when an attribute has an option for “left” and “right”, it also has an option for “center” (i.e. align.) When they see “float” they assume “obviously” that it works the same way. But that fails them because some very pendatic people were more interested in logical purity than making CSS work the way that was most initutive.
What’s worse with CSS is that when you do things wrote, the browser doesn’t tell you it is wrong, it just doesn’t work and one is left to scratch their head to figure out why, or worse not even notice that it didn’t work!!!
Here’s something that would make me feel a lot better about only having “margin:0 auto” instead of “float:center.” If the CSS specification had a “debug” property or an “errors” property or an “report” property so that the spec explicitly stated that the user agent should somehow report not only errors but also suggestions. For example, one of the following:
body { debug:on; }
body { errors:show; }
body { report:errors; }
Then anytime someone used “float:center” the user agent (browser) would somehow tell the user “ERROR: float:center is not valid. You probably want the behavior that margin:0 auto provides.” But when I brought up such things in the various w3c standards circles they were all like “We can’t require error messages, that’s not the job of the spec.” Sheesh.
“Sorry to come out with it but I can’t believe that for a second. Grab someone you know who doesn’t know CSS. Tell them that to centre something, they want to (obviously!) use ‘float’ or ‘table cells’. Is that really going to make sense?”
You really don’t get human learning and cognition or it’s importance, do you? YES, if you ask people to center something they are going to look for an “center” attribute, not a “margin:0 auto.” Have you ever taught people HTML & CSS? You should try it before you go assuming that people will actually go through a logic process. NOTHING they have every done is like “margin:0 auto” but they have used “center” as an attribute.
“On the other hand, people remember margins as layout descriptors from the real world, I think they could understand that.”
From the real world? In what context or use-case do people ever have to worry about specifying margins as “auto” “in the real world?” This example I’m about to give is not in “the real world” (it’s still within a computer) but let’s take something that almost everyone who starts using CSS will have experience with; a word processor. Yes, there are margins on the page but what word processors do you know that have an “auto center” option for left and right margins? MSWord sure as hell doesn’t. People are used to setting margins left and right, but they have no analog for “automatic margins.”
Next, let’s say someone inserts an image into a document; how do they center it? They highlight it and then click the center button. What they don’t do is click a “margin” button and set left and right margins to auto!!! EVERYTHING people are use to trains them to look for “center” and does not train them to look for “margin:0 auto.” So “margin:0 auto” while logically correct is just a stupid way to do things in CSS given that humans are often the ones to write CSS.
But let me clarify; this “float:center” vs. “margin:0 auto”, while difficult for people to learn at first is not the issue I am most bothered by. The issue is instead the systemic disregard of certain working groups in the w3c, and especially within the CSS and HTML communities for how humans learn and for what makes implementation hard. The fact CSS is do difficult to deal with has cause billions of dollars of inefficiencies the world over from all the time spent trying to get a layout to work. Had the people involved in specifying CSS not been so concerned with logical purity and instead cared about actual usability and clarity of purpose we would not be having this debate nor would the world has wasted so much time and money on trying to make something work with was just ill-suited for purpose.
FWIW. I’m probably just pissing into the wind because nothing is likely to change just because I rant about it.
Vordreller
08.12.2008“CSS has made layout so difficult”
You mean: so EASY
I don’t know about other people, but CSS is incredibly easy to me. Maybe because it was an integral part of my webdesign education. Anyway, I keep a strict boundary between what is markup and what is content
Mike Schinkel
08.12.2008@Vordreller
“CSS is EASY”
Let me guess, you’ve never had to change the layout of a large complex website?
Or you’ve never actually had to implement a complex layout complete with columns with background colors?
Just curious, how long have you actually been developing web sites, and how many large sites have you built from scratch?
If CSS were so easy, YUI-CSS wouldn’t have been needed nor would YUI-CSS be so incredibly complex *internally* (but YUI-CSS have made CSS much easier to use so my hat’s off to them.)
“Anyway, I keep a strict boundary between what is markup and what is content”
Yes, that’s a great goal and I agree in concept, but CSS has made that far too difficult. That’s why I posited that we’d be much better off with something that replaced CSS to achieve that same goal but that would actually be well-designed.
Truth be told, if something did come along to replace CSS it would be based on all that we’ve learned regarding the problems with CSS and the people who designed CSS didn’t have the benefit of that hindsight.
Barney
08.12.2008Mike,
I’m sorry if I got a bit out of order with my last post, I didn’t mean to anger you (well, not that much in any case:) ).
I’m afraid to say I think you’re in a tiny minority regarding your frankly bizarre opinions on the difficulty of things and don’t really understand how CSS or programming in general work — and CSS is an incredibly basic form of programming. I develop for a living, I learnt this stuff from scratch and I’ve helped many a person learn it.
You’d be amazed at the volume of previously non-technical people who have been empowered (to professional levels) by CSS. It is an incredibly intuitive language and its popularity and accessibility are testament to that.
To be honest your notions on ‘debugging’ CSS instances that don’t achieve what the user meant them to… Is a kind of nail in the credibility coffin. You speak as if the computer is going to be the designer and the developer for you, and anticipate your complaints when it takes your vague instructions as given. Being so demanding of AI levels of intuition from what you might be trying to suggest from a machine… Is frankly just banal petulence. I mean, would you ever try to help yourself with any of these concepts — even to the level of thinking them through on a practicality level or suggesting specifications — or are you honestly just outraged that someone isn’t serving them to you ready-made on a plate simply because you screamed loud enough? I think you have to acknowledge the fact that you’re simply not half as patient, insightful or willing to learn as the millions out there who do understand this incredibly simple language.
By the way, were you really a trainer?
PPS: Are you having us on in a bout of ‘contrarianism’?
Mike Schinkel
08.12.2008@Barney
“I’m sorry if I got a bit out of order with my last post, I didn’t mean to anger you (well, not that much in any case:) ).”
You didn’t anger me. The situation angers me and has long before you came out of the woodwork on this post. You’ve actually given me a foil against which to vent.
“I’m afraid to say I think you’re in a tiny minority regarding your frankly bizarre opinions…”
Now THAT angers me. By calling my opinions “in the minority” and “bizarre” you are attempting to marginalize them which is a classic dishonest debate technique like calling a political opponent an “extremist.” If you can’t debate the merits of the argument then you are not worthy of debate so let’s stick to the discussion points and don’t try to win by painting my arguments as not being worthy of consideration.
“on the difficulty of things and don’t really understand how CSS or programming in general work — and CSS is an incredibly basic form of programming.”
Are you trying to say that I don’t understand programming? This is your further attacking me with language rather than debating me on the merits.
The problem is I understand programming far too well, and I understand that CSS is a really poor design. Further, CSS isn’t even really programming, it’s a declarative language. CSS’ problems include inability to control scoping hence no way to reduce combinatorial complexity, many edge case it doesn’t handle, and an ideology that had it be too simple for its own good (i.e. CSS doesn’t allow you to define relationships between element types such as I illustrated with “ESS tables” above.)
“I develop for a living, I learnt this stuff from scratch and I’ve helped many a person learn it.”
From scratch? Maybe that’s the problem. You’ve not actually studied computer science from a university, right? Maybe that’s why you don’t know what you don’t know.
Would you tell a doctor who has had 10 years of medical school that you know better why you are sick? Why do you assume that self-taught programming gives you enough background to fully understand programming?
I’ve got 20+ years of programming experience in all different languages and I know that in my twenties I was far surer of what was right and what was wrong then than I am now. Now in my 40’s I’ve had enough experience to learn how many of those things I thought were so smart actually turned out to have been not such a good idea after all.
Forgive me if I’m wrong, but my guess is you’ve got at most 1-3 year programming experience, and you are fully self-taught?
“You’d be amazed at the volume of previously non-technical people who have been empowered (to professional levels) by CSS.”
How do you know what would amaze me? You make a lot of presumptive assumptions. Yes many people have been empowered, but not nearly as many as could have been had it been better designed and thus better implemented.
“It is an incredibly intuitive language…”
Well, that’s the opposite of my experience with literally hundreds of people I’ve interacted with. See the group I organize that has almost 800 members who are interested in web but are mostly not full time developers: http://web.meetup.com/32/
OTOH w/o benefit of usability testing to prove one way or another we’ll not be able to prove that it is or is not intuitive, it will just be our opinions.
“and its popularity and accessibility are testament to that.”
Hardly. Its popularity is due to the fact that the w3c designed and standardized it and because of that the major browsers implemented it. It has NOTHING to do with the quality of its design. Had there been 2 other competing specs that users could choose to implement AND it had emerged on top then I’d agree but that hasn’t been the case. It’s “popular” because it is the only option.
“To be honest your notions on ‘debugging’ CSS instances that don’t achieve what the user meant them to… Is a kind of nail in the credibility coffin. You speak as if the computer is going to be the designer and the developer for you, and anticipate your complaints when it takes your vague instructions as given. Being so demanding of AI levels of intuition from what you might be trying to suggest from a machine… Is frankly just banal petulence.”
HUH?!? What, are you thinking by attacking my credibility that you can avoid the discussion points and instead wound me so I run away? You clearly don’t get it, do you? You’ve (my guess is) empowered yourself to make a living using HTML & CSS and now you take any criticism of it as a personal affront. Typical immature self-taught.
What I described where the computer recognizes obvious errors and generates an error message is a best practice for building a robust system not “banal petulance”, whatever that is. Generating error messages is exactly what compilers have been doing for decades. The fact that you would characterize is as “anticipating my complaints from vague instructions” and “being so demanding of AI levels of intuition” means you’ve clearly never read “The Dragon Book” cover-to-cover. (Don’t know what “The Dragon Book” is? Google it.) You’ve ignorance is just so blatantly obvious. Maybe you don’t know the old saying? “Better to be thought a fool than to open your mouth and remove all doubt.” Looks like you have been doing the latter.
Have you ever used a compiler, or even an interpreter like PHP, or has your limit only been HTML+CSS?
Ever heard of “lint?” What I’m talking about is lint for CSS built into the browser. Don’t know what “lint” is? Google it. And Google “lint for css.” What I’m proposing is a lint for css built into the browser. Clearly this is a new concept for you, but not a new concept among programmers. (Maybe all those programmers who use lint are just being banally petulant?)
“I think you have to acknowledge the fact that you’re simply not half as patient, insightful or willing to learn as the millions out there who do understand this incredibly simple language.”
I think you have no clue what my skills or ability to learn are. It you were face to face I’d just you see what others locally think of me, but since you are obviously in Europe somewhere and not here in the USA locally with me I’ll say that I’m known among the various groups I attend (including the Drupal user group) as one of the fastest learners around. I’m also the one that always seemed to be tagged to give training presentations when others are not available. But I have no patience for stupid implementations, and CSS is a stupid implementation. I would say it’s like the fact that I don’t suffer fools, but then my engagement with you on this issue would obviously discredit me if I were to say that.
I can make CSS do anything it can do. My gripe is that it is far too hard to use, especially for newbies (I care about them but evidently you don’t.) I know what is possible in good programming languages like C#, Java, Python, Perl, Ruby and even PHP, I know about encapsulation and information hiding and polymorphism and modularity, and it frustrates me that CSS is so backward as to not incorporate any of those features that could otherwise make using CSS more pleasant.
I also notice you never answered my questions:
—How many large web applications with complex CSS code developed by someone else have you had to come in and make major changes to? What are the URLs?
—How many large web applications with complex CSS code have you developed from scratch? What are the URLs?
Or could it be you’ve only even used CSS for small personal websites? Yes, for small personal websites CSS is really easy and seems like a dream. But for large complex websites that dream becomes a nightmare, especially if you were not the one who originally developed the large complex website.
“I mean, would you ever try to help yourself with any of these concepts — even to the level of thinking them through on a practicality level or suggesting specifications — or are you honestly just outraged that someone isn’t serving them to you ready-made on a plate simply because you screamed loud enough?”
I really don’t even know what you are trying to say here but it seems insulting without basis.
>> By the way, were you really a trainer?
For seven years before the turn of the century, and occasionally the past several years:
http://mikeschinkel.com/blog/alittlebackgroundisinorder/
Why, are you acting surprised?
“PPS: Are you having us on in a bout of ‘contrarianism’?”
Yes, but not as a troll. I fully believe CSS is stupid.
CSS has huge problem, but all you are giving is Pollyanna answers and defending what appears to be your beloved. If you are so capable rather than hurl veiled insults and employ dishonest debate techniques why don’t you present some examples that might explain that you have any credibility?
For example, show me the book you wrote on programming (mine is here: http://www.amazon.com/dp/0201570181; read the third comment). Or show me large websites you’ve implemented (mine includes http://www.xtras.net (though it’s had small updates since I left) and http://atvillustrated.com). Or show me a large group of people where you present your web knowledge frequently that has a rating >=4 stars (mine is at http://web.meetup.com/32/) Or some me a place where you have presented an advanced computer topic and >=4 stars rating (one of mine is at http://drupal.meetup.com/4/calendar/6779397/) Show me something, anything that indicates you have even a smidgen of credibility.
IOW, talk is cheap. Stop talking and start showing me that you have credibility instead of questioning mine. Take your “credibilty” accusations and look in the mirror.
P.S. BTW, is it always your way to apologize to someone for your behavior then start hurling even more insults at them?
Mike Schinkel
08.12.2008@Barney:
I should have looked at your website before writing my last comments. But now I know that I was correct. You are 23 and have 2 (max 3) years experience programming. You’ve only ever programmed in Javascript and PHP and never Python, Perl, Ruby, C#, C++, C, Visual Basic, VBScript, Java, SQL, AWK, Tcl, dBase, Clipper, FoxPro, XSLT, or 8086 assembler right? (I’ve programmed in all those.) And as expected, you have absolutely no computer science background from university, only Typography, Art, and French. Sheesh.
You’ve been drinking the koolaid, and if one of the luminary standardistas says it is true you blindly believe it to be so. Your CV statement sounds like it was pulled from an Eric Meyer book!
“I hand-code XHTML, HTML, CSS, Javascript and PHP with an absolute priority on crossplatform
compatibility, graceful degradability, accessibility and maintainable code with
separate content, style, and interactive elements.”
(BTW, Eric Meyer is good and I respect him, but blindly believing anyone is crazy. Our industry is filled with lemmings who don’t actually consider if recommendations make sense, which is why I have to be a contrarian.)
I’m sure you are a great designer, as great as a 23 can be, but please stop telling me that you have more of the knowledge and experience required to evaluate programming language design and the problems associated with it. Come back in at least ten years and after you’ve led some major projects when you’ve gained some experience, then we can talk.
(Note: I rarely ever call someone out like this online but your last post was just too over the top for me to let it go. Again, look in a mirror and you’ll see the one lacking credibility.)
Mike Schinkel
08.12.2008Hmm, I had a really long post that somehow looks like it got eaten. Well, that’s okay, I probably shouldn’t have posted it anyway.
cenocre
08.15.2008@Barney - How come you rarely answer questions that are directed toward you?
“All in all cenocre, I think you have to resign yourself to the fact that even the DOM and HT page layout are very complicated things.”
No. They are actually quite simple and the problems are both in the explanation and implementation where they do not work as intended due to browser quirks. I regularly teach novices and they are surprised at the simplicity IF PRESENTED to them in a logical manner that shows the BIG PICTURE. They are then appalled when show how Internet Exploder breaks things.
“You constantly refer to ‘the layman’ but as you’ve just said — and much as I suspected — you’re a professional web designer.”
Two points in response as you missed the point. First, with Ruby, Python, etc, I AM a layman and have tried to make a decision on whether they are of use to me. The intros to all of them were so bad that I didn’t bother. The intros to javascript and PHP also sucked, but I had to persevere as I need them. Turns out both were okay and I now write hyper-simple and elegant code that I can explain to novices who catch on immediately.
Second, if someone like me (and my VERY experienced friends) with over two decades experience as a programmer of commercial software, consultant, teacher, web designer, sysop, web master, etc cannot get a decent perspective of a new programming environment in a half hour how can the less experienced do so?
“Surely you must accept to some extent that the reason you’re making a living is because you’re undertaking skilled work that requires knowledge and expertise that other people don’t have?”
Partly agree, but what the skill that I get paid for is the ability to make a simple and functional product that users can understand and use immediately. It is my understanding of the user the most important - WAY more important than the programming. Usability from understanding and essence are what I get paid a premium for, not the ability to make a form accept info.
Basically creation on a computer can be done so that it is open to anyone. It can be like music and photography where anyone can create nice sounds and images. I like it that anyone can sing and take pictures and it is no threat to my career. What I get paid for there is to create something with essence that moves people.
So, while anyone can use a word processor, they are rarely a great writer. It can be the same with web design. Placing boxes, text and colors on a web page, SHOULD BE BRAIN-DEAD SIMPLE and should not even be a skill. The basic pay should be for your labor there. The premium pay should be for the artistry and ability to create functional simplicity. Most unfortunately, understanding humans and how they function is the rare skill. Typical computer design aptly shows how that skill is so lacking.
“I’m still happy to charge $400 a day! — but still, have some respect for your skills. ...
I charge WAY, WAY more.
“...using this abstract language that makes no sense to any of my friends to tell a machine how to make a document appear on screen…â€, but that’s the nature of the beast. Coding has always been weird and difficult.”
And that is where the BS comes in. Coding need not be “weird and difficult” at all at most levels, ESPECIALLY at the level of making a web page. Producing a web page should be no harder than using a word processor. It could and should be so easy that when you tell a 100 x 200 pixel box to sit at the bottom of all other elements on a page that it will simply do it. It is easy in a DTP program, a word processor, the database I work in, and with tables. There is no reason whatsoever that it should be difficult in CSS.
Look at SketchUp and Cheetah 3D and see how easy working in 3D can be (although they still have a ways to go. Then check out Blender which has been created by open source geeks. I can think of nothing less intuitive. Compare administering WebSTAR from a decade ago to Apache today. The very same action in Apache is often a hundred times harder. There is zero reason for this.
CSS could also be very simple work as advertised.
“Computers aren’t intuitive, and achieving professional results requires professional dedication to the craft.”
Bull. Their manifestation is often not so, but that need not be the case. Computers are not non-intuitive, the creators are. The problem is that a large portion of the people creating them and ESPECIALLY the languages lack intuition. They tend to not understand how people work and the fantastic HI studies done by Apple have been forgotten about even by Apple.
The original Macintosh was very easy to use from the first moment you sat down with it in most ways even including some programming. I work in an internal language in a database that, while far from perfect, is easy to understand and is still robust. Even the non-WYSIWYG WordStar on CP/M had very powerful keyboard commands that were very simple to learn in a few minutes if someone showed the user how intuitive the diamond pattern was.
Barney
08.15.2008Cenocre, that last paragraph intrigued me massively, however I don’t know any of the products or methods you referenced! Could you elaborate?
I had this problem with Mike, he was annoyed at my not answering questions too — but I can’t find them! Which questions are these (sorry there’s so much copy on this comment thread!)?
“Two points in response as you missed the point. First, with Ruby, Python, etc, I AM a layman and have tried to make a decision on whether they are of use to me. The intros to all of them were so bad that I didn’t bother. The intros to javascript and PHP also sucked, but I had to persevere as I need them. Turns out both were okay and I now write hyper-simple and elegant code that I can explain to novices who catch on immediately.
Second, if someone like me (and my VERY experienced friends) with over two decades experience as a programmer of commercial software, consultant, teacher, web designer, sysop, web master, etc cannot get a decent perspective of a new programming environment in a half hour how can the less experienced do so?”
This intrigues me. Let me chuck in my disclaimer right now: I don’t have 20 years of experience in programming. I’ve barely got that many years’ experience of life. So you might want to start treating my whole stance with a pinch of salt because I don’t have the necessary overview to take the new environment of web-popularised tech within the larger context of history.
The languages I know are exclusively those you mentioned as being a layman in (except Ruby, I’ve only just had a look at it). As far as OOP is concerned, I’m no great shakes — I’ve learnt what I’ve learnt as a means towards self-sufficient web design and to be perfectly honest the times I tried to start learning C# and VB left me bored and aching. I think you’re in a similar position to Mike, he speeks of the same experience and has a similar disdain for web-based language success.
So I guess my message is thus: You pity those without 2 decades in programming, but we’re legion and we’re OK!
—
To be honest, despite the unplummable iamgination and energy reserves of the independent open-source community, I’ve not seen a CSS alternative that works better yet. I’m not talking about something W3-approved, that has been corporately-endorsed, or any such thing… But surely if things were so bad someone somehwere would’ve built, just as proof of concept, their own markup styling engine?
—
Don’t get me wrong, it’s not that I don’t believe simpler things exist, but the whole argument as far as I see it is one about socio-economics: Javascript and CSS have fared based on competing implementations by organisations with critical financial intent in the most public environment application ever (teh interwebs). Add to this the mix of ratification bodies struggling for impartiality as effective judges in the domain of rival interpretations by products with commercial legacies and colossal user-bases, idealism for an exponentially expanding future of the environment, and the need for backward-compatibility for the incredibly valuable internet that exists.
For those of us who grew up with this in mind, we make do with learning and hacking because we have to. You can’t fight the cybercom — our youth and relative poverty might not be such crippling disadvantages!
Mike Schinkel
08.15.2008@Barney: “I think you’re in a similar position to Mike, he speeks of the same experience and has a similar disdain for web-based language success.”
You mischaracterize. I do not at all have any “disdain for web-based language success.” I in fact applaud the success of technologies on the web and have huge respect for the architecture of technologies such as URIs, HTTP, and HTML (which, btw, are the three core technologies of the web.)
Where my disdain lies is in poorly designed and very poorly considered specifications that were adopted en masse simply because they were sponsored by the w3c, such as CSS. Sure there are many “great” things you can do with it, but it causes as many problems as it solves, if not more so.
What I’d prefer to see is success of *well-designed* web-based languages.
“So I guess my message is thus: You pity those without 2 decades in programming, but we’re legion and we’re OK!”
Clarification for me: I pity those who are twice your age *and* don’t have 2 decades in programming. Further, I pity that the world has to waste so much time because the designers of CSS didn’t ensure that the many things people want to do with CSS wouldn’t be so difficult (positioning, equal length columns, etc. etc.)
As for “Javascript and CSS have fared based…” note that I don’t argue against JavaScript, other than a personal distaste for semicolons and braces I think JavaScript is brilliant. OTOH simply because something (CSS) has been adopted doesn’t mean it can’t massively improve. CSS has been adopted because the browser vendors agreed to follow w3C standards and CSS is a w3c standard. So it really didn’t thrive in a “open market”; it had a monopoly. Easy to thrive in a monopoly. (That’s not to say I’m arguing against standards—no I strongly advocate for standards—I’m just arguing against bad standards.)
As for that last part, you got way esoteric and hence over my head.
cenocre
08.16.2008Wow Barney, don’t know where you got much of what your interpretations and assumptions from what I wrote, especially the pity part. Please don’t assume things about what I am saying. As you can see I can be very direct. I do have pity - pity for all of us who have wasted massive amounts of our life on BS such a the broken IE and trying to do things on the Web that are so easy to do in the rest of our computer lives.
I don’t understand what you mean by” disdain for web-based language success”. In the web world what I disdain is unnecessary complexity in most forms, arcane, inconsistent and non-intuitive languages, bad communication (especially that which is full of assumptions) about those languages, and implementation that does not work as advertised. And I utterly detest that HTML and javascript are so tied to each other yet don’t work the same. It is abjectly stupid that you can put perfectly formatted HTML into a js variable and it will break a function. There is no rational reason for having to escape characters and remove all returns. Javascript should be able to ignore everything from the beginning to the end of a string just as HTML does with the command which I just used here to show pre.
That disdain is especially strong when considering that it doesn’t need to be this way and simplicity, versatility, ease, and power can go hand in hand. Overall, I would say that many of the basic and common tasks (that are not dependent on processing power or storage), especially relating to the everyday interface have become more difficult and take longer than they did a decade ago.
As for my last paragraph that intrigued you: “The original Macintosh was very easy to use from the first moment you sat down with it in most ways even including some programming. I work in an internal language in a database that, while far from perfect, is easy to understand and is still robust. Even the non-WYSIWYG WordStar on CP/M had very powerful keyboard commands that were very simple to learn in a few minutes if someone showed the user how intuitive the diamond pattern was.”
The original Mac brought most of the standards that have lasted and most of it was obvious. To go to something you use the “Go” menu, etc. I highly recommend studying Apple’s old HI (human interface - see I didn’t assume that everyone reading this knows what HI means) guidelines from the 80s. They spent massive amounts of time intimately studying how humans ACTUALLY work and the ADAPTED THE COMPUTER TO FIT THE PEOPLE not the other way around as we tend to do nowadays. Apple had a pretty good macro recorder from the very beginning and later on had one of the best ergonomic keyboards. Unfortunately, they have abandoned many of their great features and now have crappy keyboards.
The database I work in is Panorama. The Mac version is way ahead of the Windows version and there isn’t a Linux version, so you really have to see it on Mac to appreciate it. ( http:provue.com ) They make a generally great product some weak points in the display area such as not being able to display RTF or XML. And, their marketing is non-existent.
With WordStar you could do almost any selection from the home keys with the left hand. And, as you moved further from the center of the key pattern the commands got bigger. I don’t recall accurately but it was something like, control-d selected character-left, control-s was word left and control-A was line left. It worked similarly for moving right, up, and down. If someone SIMPLY presented it you to create a PICTURE and UNDERSTANDING of the OVERALL CONCEPT, you never needed to consult the manual as it made such obvious sense due to the ANALOGOUS ASPECT of the commands and results.
BTW - What started all of this was the whole float:center issue and you arguing about certain technical issues. How come it worked so easily and consistently with tables and the command in straight HTML if it has technical shortcomings?
cenocre
08.16.2008“Javascript should be able to ignore everything from the beginning to the end of a string just as HTML does with the command which I just used here to show pre.”
Tried to use the
tag but it didn’t work.“How come it worked so easily and consistently with tables and the command in straight HTML if it has technical shortcomings?”
And tried to put a [center] tag in using
, but it didn’t work either.Barney
08.16.2008Good stuff.
ByronT
08.26.2008I’ve long thought that CSS was something web programmers came up with to keep themselves in business.
I mean, once upon a time, all was written in notepad or something similar and people were amazed at the coders skill level.
Then, here comes Dreamweaver and other WYSIWYG programs and all of a sudden, high school students are putting out web pages that look better than those hand written pages.
Oh no, said the programmers, what will we do now that everyone can do what we do very simply? I know, let’s develop a system no one will understand, except for us advanced coders…that way we can stay ahead of the regular people and keep our jobs. So what if the new system is not perfected and wastes a lot of time trying to get it to work in all browsers..the regular folks will ‘never’ get it to work, and besides, we can convince everyone this is the wave of the future and ‘the’ only way to make good websites. Our jobs will be secure!!!
Trevor
08.27.2008@ByronT-
Haha that’s a really funny statement.
But, I think that CSS is great in theory, but has some limitations in its implementation. Think about how much better the web is because of it. Not to mention the increased usability.
And hey, I used to be one of those high school kids!
Barney
08.27.2008The comments here have been great because there’s obviously a lot of disempowered people who have strong beliefs about what code could do.
It’s interesting in that, whereas CSS-excellency is a pre-requisite in front-end development job (again, I don’t understand the masters of Pearl and C++ railing against the exclusivity of CSS — don’t they get paid through the nose for their exclusive know-how?), more and more I see ‘knowledge of JS frameworks ie jQuery+Scriptaculous || mootools etc’ being a prime consideration for the ability to fulfil a current front-end web dev role.
JavaScript is widely hailed as a brilliant language (if incredibly loosely typed & hugely ambiguous regarding its principal application — the DOM), yet it is something that is so difficult to use in what the common man sees as a practical use-case that expertise is gauged on the basis of being able to understand a particular re-writing of it.
Is this bad or good for the industry? Is this bad or good as an indicator of how intrinsically worthy or succesful the language is? ...And does it bear any indication as to how people might want to deal with CSS?
Mike Schinkel
08.28.2008@ByronT
LOL, I love it! Though I can say with certainty that they didn’t mean to make it so difficult technologist often over architect things for good intentions and it turns out to be a nightmare.
@Barney
Regarding Javascript being difficult, yes it is, but it is a very different kind of difficult compared to CSS. Javascript takes mastery but as you master it you can divide and conquer; CSS does not allow that. I could right another epic to explain but I won’t, I’ll just leave you with the term “closures” (Google it); Javascript has them and CSS has nothing like them. Closures are just a great example of why Javascript can scale in complexity but CSS cannot.
Mike Schinkel
08.28.2008@Barney:
Also, after drinking the strongly-typed koolaid for many, many years I’ve come to really appreciate that strongly-typed is not the panacea it has been made out to be. Loosely-typed languages can empower some amazing architectures that can’t even be conceived in languages that are only strongly-typed.
The reality is both have their places and having both is much better than having only one.
Mike Schinkel
08.30.2008I just came across yet another CSS annoyance; the lack of allowing a width on inline elements. Where does this really cause me pain at the moment? Label elements for Form inputs. Widths for labels is such an appropriate use-case yet because of the pendantness of the spec authors, we don’t get widths where they would actually be helpful. Bleack!
Barney
08.30.2008Mike, if you want something to have dimensions of its own accord you’re probably better off with display:block and float:left to arrange the ‘line’ anyway. Forms are tricky by nature, but more often it’s a design question more than one of how to make it happen — there are thousands of examples of beautifully laid-out forms out on the interwebs, and a while back Smashing Magazine compiled a great list of technique-focussed case studies: http://www.smashingmagazine.com/2006/11/11/css-based-forms-modern-solutions/
A great resource for everyday generic complaints like this is Eric Meyer’s CSS discussion list [http://www.css-discuss.org/] — it’s full of experts who are generally more than helpful for little tips like this.
Mind you if your project is full of such things and is really doing your head in on a regular basis, you might have to consider hiring a front-end guy to come in and take care of the whole lot?
Barney
08.30.2008As a side-note, I thought I might interject that I think using tables to arrange forms is completely valid. You are effectively looking for a constant column width, but a horizontal arrangement to the baseline, which tables will perform naturally.
If somebody starts giving you crap about semantics or whatever, a smug way of shutting them up is to have the markup as such:
<thead>
<tr>
<th>Field description
<th>Field input
<tbody>
<tr>
<td><label/>
<td><input/>
Mike Schinkel
08.31.2008@Barney, point taken about tables with forms, and normally that’s what I’d do.
But the context in which I was trying to get it to work was in the context of theming a WordPress plugin I was coding and it didn’t lend itself to using a table without making the plugin code more fragile to requirements changes. Also, the requirement to use tables adds a lot markup that ideally would not be required for something that is such a common use-case. The whole “inline elements shouldn’t have widths” is a really shortsighted limitation and results in lots of frustration for people whose tasks don’t include doing CSS all day every day and hence don’t remember which attributes don’t apply to what elements.
Actually, I figured out how to line up with I needed and it was to give labels both “float:left;”, “width:100px;” and “display:-moz-inline-block;display:inline-block.” Unfortunately that solution is both obscure (i.e. very hard to find as a solution simply by googling) and the float has side effects that can be unwanted.
Once again: Sheesh.
Neal G
11.13.2008There is a float center for a three column layout, float left, float left, and float right. you could optionally float the last column left as well. I’m sure somebody has already said this but oh well.
Florin
11.15.2008@Mike Schinkel
I support your position.
In general, you guys are too nice and forget something essential.
Time is the matter of life. And all the time wasted on css layout trash could be well spent in the gym or somewhere else better.
This self-important w3c body has little consideration regarding what matters most. Time, money and everything in between: friends, precious children, spouses and many other activities that make life worth living. The amount of life wasted to get css layout work is mind boggling. The money wasted by countless designers could save Africa’s starving children or reduce the carbon footprint to Gore’s delight. Give the css spec to a single talented, hands-on guy and the results will be visible within days. Not so with a body full of luminaries tickled by self importance that they are called to save the world.
As a server side guy, to be expected to hire a designer in order to align some elements in a page is absolutely shameful.
I could care less if float:center violates some precious notion of correctness. To me a thing floats even if stationary - it’s just everywhere to see. Don’t like the word ‘float’? Call it ‘kitchen-sink’ but make my element stay put on center. Huh!
Start with css and end with friendly TABLES if needs be. Enjoy life. Defy committees and ignore purists. Life is short.
Jeffrey A. Savoye
12.23.2008After maintaining my website in good old-fashioned HTML for over a decade, I have finally been persuaded to make the move to XHTML and CSS. In doing this (and attempting a few actual examples), I am finding pluses and minuses with CSS. Among the pluses are some useful formatting features, such as paragraphs with hanging indentation. The biggest minus I am finding at the moment is, yes, the lack of float: center. Here is my problem. On my website, I have many pages that contain a poem. The lines of the poem are left aligned, but the heading is centered over the lines, with the longest line defining the width. I want to position the poem in the center of the page, but I do not want to specify widths. The only thing I have found to work is to define display: table; but this does not work in IE (although it appears that it may be supported in IE8). My sample poem page is at URL: http://www.eapoe.org/works/poems/cityseaa.htm I am .not finding that this margin: 0 auto; has any beneficial effect. Ideally, I want elastic pages, which self-adjust with the width of the window. My compromise has been to use two float: left; divisions, with the first acting as a kind of left margin, but this is by no means what I desire. Any thoughts or suggestions?
Trevor
12.28.2008@Jeffrey A. Savoye-
Why are you so against setting a width?
margin: 0 autois worthless unless you set a width. Also, floating will nullifymargin: 0 autoas well.Jeffrey A. Savoye
12.28.2008Why am I so against setting width? Two reasons:
1) I like an “elastic” page, one which adjusts as the screen narrows rather than suddenly requiring scrolling to go from side to side.
2) For the poem, a line should generally fill one line, as long as the page size is wide enough. But setting a width presumes a specific font size, which may or may not be what the user chooses. Thus, unless I am missing something, specifying a width means that I am imposing a font size choice.
Trevor
12.29.2008@Jeffrey A. Savoye-
<ol>
<li>That’s fine, you can set a width in % or ems.</li>
<li>As long as you stick to % or ems for a font size, that will give all users the ability to increase or decrease their font size.</li>
</ol>
Jeffrey A. Savoye
12.29.20081) % or ems of what?
2) If a user increases a font size, the amount of horizontal space for that line will, I presume, increase. If I have specified a size based on the smaller font, it will presumably not be large enough to hold the larger font still on a single line (and will begin to wrap some lines). I would prefer that an individual line of a poem NOT wrap.
What I have now is perfect . . . except that I cann0t specify that I want it in the middle of the page. The lack of float center seems to me a gross omission of a function with obvious utility.
Trevor
12.29.2008@Jeffrey A. Savoye-
<ol>
<li>% and ems are relative units of measurement</li>
<li>You should take a look at examples of elastic designs. As the user increases the font size, the horizontal and vertical size will scale as well. Basically, it is what you see in Firefox 3 when you do a page zoom.</li>
</ol>
Jeffrey A. Savoye
12.30.2008I understand that % and ems are relative units of measurement, but relative to what? A percentage of screen size does not address my issue of changing font sizes, but I will look at the examples for which you provided a link. Still, much of this fuss could be easily avoided with float center. Attempts to explain why this is undesirable, or impossible to define, are absurd. (It might be difficult to render, but that is a different issue, an since when has the difficulty of programming trumped other concerns?)
Jeffrey A. Savoye
12.30.2008The use of ems for size is interesting, but—not unexpectedly—it doesn’t actually work as advertised. One would think that an em is a consistent size relative to the font, but as I set the font size up and down, I get differing amounts of line wrapping when there should be none. (And, of course, this line wrapping is different in Firefox and IE.) Very frustrating.
Jeffrey A. Savoye
12.30.2008It looks as if I am going to settle for using “display: table;” in Firefox, which appears to allow the panel for the poem to be centered on the page quite nicely, and adding a special stylesheet for IE to use my fall-back solution of floating it left, with a slight left-hand margin. At least the fallback will be used in the browser that suffers from the most bugs.
Trevor
12.31.2008@Jeffrey A. Savoye-
Oh, I agree that it doesn’t make sense, which is why I wrote the post in the first place.
I don’t think there is anything wrong with optimizing your sites for standards compliant browsers, and just making sure that it still looks ok in the poorer browsers. I think that is always the right way to go. The hard part is convincing clients.
Phil
02.04.2009@Mike Schinkel:
What a legend! What a rant!
Been working with CSS for years, though never fully appreciated how stupid or “brain dead” it is on some issues.
Totally agree that it shouldnt be such a pain in the arse to achieve some of the most basic layouts like the “holy grail” 3 col layout, float center, and the one that pisses me off the most - vertical align.
I love CSS and wouldnt ever go back to inline formatting, but I agree with Mike that whoever agreed on its spec, left their brain at home that day.
Aaron
03.22.2009@Mike Schinkel:
I’m 100% behind your comments, it perfectly articulates my own spite towards CSS and the pedantic authors behind it. If there was a truly innovative and progressive body behind these standards, I’m convinced we’d be lightyears beyond where we are now. Just look at what you can do with various proprietary browser plugins (Flash Player, Silverlight, Java) using declarative markup and style definitions!
Hopefully something like the ESS you propose will be brought forth in a serious way, embraced by the major browsers, and we can thank the W3C for what their time (and wasting mine) and bid them goodbye.
Christopher Shennan
05.26.2009A float center would save me so much trouble.
I’m not the more proficient person when it comes to CSS but I can get by fairly well although when I’m having to center elements I tend to find that it takes me ages to get the CSS right for these elements.
Adil Seo
08.23.2009It is so frustrating not to have the float:center option. I hope the authors behind CSS improvise the syntax. Overall I love CSS.
Pritush
10.08.2009There is no float:center in css but it have solution. If you need to edit float: left/right to center then you can use this code :
float:33em 9px 25.6%;margin-left: auto;
margin-right: auto;
Trevor
10.08.2009@Pritush-
That code does not work for me. That is an invalid value for the float property; it can only be left, right, or none.
Evil Dave
10.13.2009It defies belief that people are honestly asking why float:center isn’t working for them when the whole title of the post describes it’s lack of existence.
The human race really is in trouble…
singh
11.14.2009nested tables like this work for me:
[table style=“width:100%”]
[tr align=“center”]
[table]
[tr]
[td] you img or text [/td]
[/tr]
[/table]
[/tr]
[/table]
Trevor
11.14.2009@singh-
That may work, but that is not an appropriate use for tables. They should only be used for tabular data.
Ronald
12.05.2009@Trevor-
That is bullshit.
Trevor
12.05.2009@Ronald-
Thanks for the contributing to the discussion, your comments are truly valuable.
Andy K
12.22.2009@Mike
Excellent comments. I must agree that CSS seems very poorly thought out. It becomes extremely irritating on large websites.
@Trevor
Ideals are nice. However, I would have a very hard time advocating anyone spend a day getting a CSS hack to work correctly rather than and spend half an hour on a table layout. And this is the real problem with CSS - in many cases, the cost of doing the ‘correct’ implementation far outweigh the benefits, not to mention actually proving *more* complex and *less* intuitive or maintainable. It starts to feel futile.
Trevor
12.22.2009@Andy K-
I guess I would say to avoid CSS hacks then. There is rarely a need to use one. Honestly, I completely disagree with your statement:
“CSS – in many cases, the cost of doing the ‘correct’ implementation far outweigh the benefits”
Mike Schinkel
12.22.2009Hey Trevor, have to support @Andy K on the “in many cases, the cost of doing the ‘correct’ implementation far outweigh the benefits.” He said “many” not “all” or even “most” but “many.”
Yes, there are many places where the cost of hacking together a fragile CSS solution is just not worth the effort vs “giving up and using tables” (Hat tip to: www.giveupandusetables.com)
Trevor
12.22.2009@Mike Schinkel-
Do you have any examples, because I honestly can’t think of any.
Mike Schinkel
12.22.2009I worked on a contest project the other day when the results was merely for display. I wasted two hours chasing my tail trying to get the CSS to work. Switched to tables and fixed the problem in *2* minutes: http://atlanta-web.org/flavorpill/
There was zero benefit to tableless design for this.
Also, many intranet projects have no real benefit for tableless design.
I’m sure I could come up with more examples, but you implied wanting to know just one. :)
Battery
12.29.2009You guys are very strange people, and still here after a year. Nice one.
Very bad english I have, and can’t fully understand, but it really doesn’t matter. I am here to state a question.
I need to show a list of products and price. I put a thumb image and the price of a product into a ‘div’. Each page show 6 products by now. To make the ‘div’ ‘wrap’ by itself, I don’t know what to do without float:left. Thats why, it really make sense to me if we can have float:center.
Please don’t say I can define a table and put 3 products a row. I just hate static.
I don’t like CSS too, but, we have no choice. If you like, please go to yahoo.com and view their source.
Any alternative way to achieve the goal is nice. Although, making table to make things center is very horrible, I still do.
Maybe I am a young programmer, I love javascript more than XLS, flash or something. Just dislike browsers are able to limit it’s power.
Mike Schinkel
12.29.2009@Battery Strange people? Have you heard of email notifications of new comments? Still here after a year? Didn’t know that the web had an expiration date!
Morales2k
03.22.2010Awesome… however i think that either we agree with each other or don’t agree with each other is not going to change anything. It would be interesting to see how many have complained to the W3C about issues like “float:center” and such things as usability, purity, semantic, simplicity, ease of use, flexibility, etc. etc. etc.
I am sure that posts on this comment thread are not alone in the universe of designers, programmers and developers out there that are bald thanks to CSS divs, tables, and pulling their hair so hard making these things work on all popular browsers… and then mobile phone compatibility… UGH!
I think we should start writing to our senators, presidents, congressmen or mayors (whatever applies in any country) about this so they pass a LAW to bend the arms of these standards creators, and make ALL browsers use one simple standard, and MAKE them all render the SAME… for crying out loud, every freaking browser has something different, and its almost as if they decided in a secret meeting what are going to be each ones peculiarities!
I am not nearly as experienced as most posters here, but I sincerely relate to how hard learning CSS has been for me… and it doesn’t stop there, because JavaScript is another issue I think needs to be addressed as well… something simple as getting the window height, has to be run through some sort of browser detection script because each browser has its way of getting that value… WTF?
You can see in here:
http://www.softcomplex.com/docs/get_window_size_and_scrollbar_position.html
That there are a lot of differences in JS interpretation, and a lot of those, are at such a basic level that it would infuriate anyone no matter their skill level… its just stupid wrong.
The heart of the matter is that the standart writers have continued to write upon these old mistakes and they keep developing them into something more… Which turns out as something uglier than what we had before… as a poster noted earlier, HTML5 is somewhere nearly as wicked as CSS… lets see when all browsers start adopting the standard and start their own wicked interpretations, firefox will look at it one way, crappernet explorer will see it differently, opera some other way, safari uniquely and elegantly different… oh man… we will have to make like five websites, one for each browser… and have the users click a link depending on what browser they are on… ?!? I mean… isn’t that were we are going today? How many lines of browser detection scripts do any of you have to implement to make your sites cross-browser compatible?
I went as far as dynamically generating my stylesheet with PHP to make use of a php detection script and serve the right css for each browser depending on the case… it also works for javascript as i detect the browser on php and have a php switch/case for each browser to serve it the code it understands… and we have to use such devices because the creators of the standards are all smoking crack somewhere while comming up with the next great standarization idea… they need to cut the crap someday… I am also infuriated.
>:
Hamish
05.05.2010I found this from Googling for float: up rather than float: center, but I can see the value in center as well.
There is no way anyone can argue the value of float: up.
Imagine you have several elements (eg images) of the same width but different heights.
There is no way other than manual positioning to get them to float ‘up’.
At the following 2 urls you will see images of the same width but different height. There are vertical gaps between ‘rows’.
http://www.css-lab.com/demos/image-display/float-hang.html
http://www.css-lab.com/demos/image-display/inline-block-caption.html
IceKat
05.20.2010OMG I wish they’d include that. With all the darn fancy stuff they include how hard would this be????
Burak Ueda
05.24.2010Here is the new float property of CSS4:
float: {left | right | center} {top | bottom} | none | inherit
2 values can be used, similar to background-position property.
Examples (imagine each number as floated boxes):#myDiv {
float: left;
}
Will display:
1 2 3 4
5 6 7 8
#myDiv {
float: top left;
}
Will display:
1 5
2 6
3 7
4 8
#myDiv {
float: bottom left;
}
Will display:
4 8
3 7
2 6
1 5
etc…
improving the float property will bring the CSS desing huge flexibility imho…
——-
Kurpas Ban
08.13.2010Huh, I have bumped on this mega long thread looking for solution to center image within floated div. Please have a look at my example:
http://sn.im/10l2ul
I agree with most of !@$#$!#@$ comments on css specification.
I would be very grateful if someone enlighten me how to center bloody thing.
Using table it took me 5 sec to achieve expected result.
Doing it properly with CSS is nightmare.
P.S. Environment where i wont to use do not allow negative values for float.
TIA
Trevor
08.13.2010@Kurpas Ban-
Just assign a width to .imgteaser, and then margin: 0 auto.
Kurpas Ban
08.13.2010@Trevor
I must be dumb! :(
Your suggestion to add width and margin to .imgteaser class doesn’t work :(
ORG:
.imgteaser {
overflow: hidden;
float: left;
position: relative;
}
SUGGESTED:
.imgteaser {
overflow: hidden;
float: left;
position: relative;
width:auto; /* because images may have vary width */
margin: 0 auto;
}
Please for code example
Thanks for reply
Trevor
08.13.2010@Kurpas Ban-
You can’t use float and margin: 0 auto together.
Too late, comments are closed!
Don’t worry, you can email me or contact me on Twitter.