| Comments: |
“This kind of crap, among other reasons, is why web sites should never, ever specify the font family or size of their default text. Just use the default, always. Web browsers let users pick their default font families and sizes for a reason. Are you listening, brad?” Amen. Especially since Internet Explorer 6's "text size" menu options don't work if you specify absolute font sizes with CSS. This also is "correct" behaviour. It is also cock. Tiny shrivelled lazy-stupid-programmer cock. This is what happens when you design by committee. There's always a posse of sharpnosed little nerds at the back who treat software design-to-spec like they were running a D&D game. I do everything in CSS now, but it has some major drawbacks, especially with positioning. My life hasn't become magically easier now that I don't have to wrestle with tables. There's no way in CSS, for example to have two columns be the same height, unless that height is the height of the browser window. And vertical align doesn't work. The H1 problem you had is also insanely boneheaded. You might be able to get around it by setting "auto" as the left and right margin width, but then IE5 doesn't do auto margins, and it looks like cock again. (Then again, to be fair, making all headers the same width is probably better, design-wise, but that's not the point is it? The point is that CSS won't let you do what you want.) The huge sense of self importance you detect in most CSS/XHTML evangelists stems from their utter elation at finally pummelling their design expectations and wrestling with buggy CSS implementations until they finally compromise in some Israel/Palestine sense of the word. They become one of the few, and enjoy rubbing our noses in it. "Well I did it, so you must be able to! Unless you're stupid, that is.. you're not stupid</i>, are you?"</i> What they forget is that either as designers, they're awful and unambitious, or as people, they suffer from short term memory loss and have forgotten both the hours of fucking around with a style-sheet that they just suffered through, and that the end result is nothing like their original aim. To them, tinkering with a style-sheet is like fucking around in /etc/ for days at a time... for fun.
![[User Picture]](http://p-userpic.livejournal.com/5887295/515656) | From: jwz Wed, 30-Apr-2003 2:02 PM (UTC)
| (Link)
|
I thought you might be amused by what your use of the “ entity turned into once Mozilla 1.3 got its hands on it: Are we living in the future yet?
This comment probably confirms your self-important fuckhead theory, but what you are attempting is actually possible (well, it worked in Opera7 and IE6 when I tested it) <style type="text/css">
h1 {
text-align: center;
font-size: 1em;
}
h1 span {
color: #0F0;
font-size: large;
background: #040;
padding: 6px;
border: solid 1px #0E0;
}
</style>
<h1><span>Contacting Us</span></h1>Contacting Usand for this... Really what I'd like to do is just leave my pages as-is, but insert something that says, "oh, if you're printing, change all the colors like so, and leave the menu out." But I'm not sure that's possible without going whole-hog into the CSS madness, or at least starting to tumble down that slippery slope.I'm not sure if this constitutes as madness or not: <style type="text/css">
@media print {
* {
background: transparent !important;
color: #000 !important;
}
#menu {
display: none !important;
}
}
</style>
Assuming it works, that is. I think some of CSS can't be learned on demand; you actually have to a read an overview and internalize the model, which includes basic but almost invisible features such as !important and the display attribute.
I stumble through CSS, and you have done several things that I did not know were possible.
I did not know that you could do
h1 span{ blah }
I thought you had to use each tag seperately. I also did not know you could use the @ symbol anywhere in CSS.
That works, but the <span> tag is really ugly (also, totally content-free). There is a better way:
h1 {
display: table;
margin-left: auto;
margin-right: auto;
color: #0F0;
font-size: large;
background: #040;
padding: 6px;
border: solid 1px #0E0;
}
The display: table causes the block to wrap itself to the text (shockingly, like a table). The auto margins cause the table to be centered.
How about if you just changed the "display" of h1, to "inline"?
h1 {
text-align: center;
color: #0F0;
font-size: large;
background: #040;
padding: 6px;
border: solid 1px #0E0;
display: inline;
}
Contacting Us
![[User Picture]](http://p-userpic.livejournal.com/5887295/515656) | From: jwz Wed, 30-Apr-2003 1:44 PM (UTC)
| (Link)
|
Really what I'd like to do is just leave my pages as-is, but insert something that says, "oh, if you're printing, change all the colors like so, and leave the menu out." But I'm not sure that's possible without going whole-hog into the CSS madness, or at least starting to tumble down that slippery slope. I'm not sure if this constitutes as madness or not: <style type="text/css"> @media print {
See, that's the slippery slope I was talking about. I can't just add that to my pages, because <BODY BGCOLOR="..."> has precedence over style-sheet backgrounds, even with !important. So I'd at least have to replace all my body tags with CSS fu. And, though I'm not sure, I fully expect that once I've gone that far, I'll have to go farther, and farther, and farther... I'll discover new things about TABLE and FONT that start malfunctioning once you've got CSS in your life, and I'll have to convert more and more just to catch up with yesterday. Which would be fine, if CSS actually worked as well as what I used in 1995, but I don't really see evidence that it does. (And dammit, brad, why is your HTML cleaner stripping out my <NOBR> tags?)
I have found that you can reach a happy medium between exclusively using CSS and not using it at all. Of course, I am not "a web designer," but a programmer who occassionally has to (or wants to) make a web site. Nothing I have done has, or needs, pixel-perfect positioning. Why do all these so-called web developers need to position a floating table 30 pixels to the left and z-ordered under their crazy JavaScript animated menu bars that never work outside of IE? Nice looking pages can still be designed without that stuff, often have less HTML bloat, and are easier to come back to and edit/maintain (without Frontpage/Dreamweaver/MS-Word, or any other so-called HTML editor).
Generally, I stick strictly to colors in my style definitions: font colors and table background colors. A good alternative to the FONT tag with +/- sizes is to use a percentage. The SPAN tag with a "font-size" style of 80% or 125% tends to work pretty well. Of course, that takes a few more bytes than the FONT tag (even if you define it up in a stylesheet), but the proportionality means it works even if the user has their browser's default font jacked up to 48pt.
...just my $0.02. Again, I am no web designer, I just play one on the internet.
![[User Picture]](http://p-userpic.livejournal.com/5887295/515656) | From: jwz Wed, 30-Apr-2003 1:20 PM (UTC)
Re: CSS in Moderation | (Link)
|
Why do all these so-called web developers need to position a floating table 30 pixels to the left and z-ordered under their crazy JavaScript animated menu bars that never work outside of IE? Yeah, and I knew I was in shark-infested waters when, after 20+ minutes of googling for "css examples" and the like, more than half of the pages I came across had their left-side menu-boxes positioned such that no matter how you resized the window, they always occluded some of the body text! Wow, what a great feature that you can make the first six characters of every line always be hidden.
It's always a great big warning sign when such a large percentage of the people who are trying to explain how to do things so clearly don't have a clue themselves. This says "something is fundamentally wrong with the system." Possibly only that it's too complex; but in this case I suspect the breakage is more fundamental than that.
![[User Picture]](http://p-userpic.livejournal.com/5887295/515656) | From: jwz Wed, 30-Apr-2003 1:49 PM (UTC)
| (Link)
|
So, your examples seem to say that to do what I want to do, you believe I need to use both H1 and SPAN, one inside the other.
It seems to me that if I have to do that, then what's the point? If I have to have magical tag-ordering in the body to make it display the way I want, then I'm still encoding presentation into the body text! If I can't say, simply, H1 with nothing else around it (doing all the magic in the style sheet itself) then I'm not doing semantic markup, I'm still doing presentational markup.
And if I'm gonna do that, then why not just keep doing it with tables, which work in way, way, way more web browsers?
This is why I don't trust anyone who's job was created after 1990.
![[User Picture]](http://p-userpic.livejournal.com/5887295/515656) | From: jwz Wed, 30-Apr-2003 1:32 PM (UTC)
| (Link)
|
A fucking men.
I haven't heard that stated quite so concisely before.
![[User Picture]](http://p-userpic.livejournal.com/5887295/515656) | From: jwz Thu, 1-May-2003 1:40 AM (UTC)
Update... | (Link)
|
I ended up doing the minimal thing, and added this to the HEAD of every page: <STYLE TYPE="text/css"> <!-- @media print { * { color: black !important; border-color: black !important; background: white !important; } .noprint { display: none !important; } } --> </STYLE> And in addition, for the various TD elements that I don't want to bother printing out, I added CLASS="noprint". This was easy, since (almost) all of my pages are generated by script (statically.) I did it this way instead of adding an external style-sheet URL because I figured it was more efficient to add another couple hundred bytes to each file than to add another connect() for each page. Everything else stayed the same: colors specified in the BODY tag, etc. Seems to work ok in the browsers various people have tried. NS4 doesn't understand display: none, but gets the colors right. Apparently Safari crashes in Print Preview, but hey, bummer.
![[User Picture]](http://p-userpic.livejournal.com/35785435/854793) | From: forthdude Thu, 1-May-2003 1:24 PM (UTC)
Re: Update... | (Link)
|
Worked fine in Safari for me.
safari 1.0 Beta 2 (v73) os x 10.2.5
The included style sheet can be retrieved once and then cached. Also, in the wonderful world of HTTP/1.1, we are supposed to have connection reuse and pipelining.
You're right about em being a unit from traditional typesetting, but wrong about what it means. An em is the size of an em quad -- a square of type material the size of the type to which it belongs, and generally used for indenting paragraphs. An em quad in a case of 12-point type was 12 points high and wide. Its name does derive from the fact that in many early type designs a capital M was approximately square, but if you look at actual fonts the em generally has nothing to do with the size of the capital M.
From: aad Sat, 3-May-2003 8:56 PM (UTC)
| (Link)
|
I spent about a week trying to coerce CSS layout into replicating the trusty:
<table> <tr><td colspan=2>site header</td></tr> <tr><td width=66%>content</td><td width=*>menu</td></tr> <tr><td>site footer</td></tr> </table>
Even at the end it only worked "mostly" right in most browsers, and any given display glitch report was answered by browser authors/vendors/support with "we're standards compliant, everyone else has a bug".
I gave up.
The impression I came away with is that whoever created CSS layout knew that a lot of ass hole designers had done some pretty heinous things with HTML to get around its limitations, and the CSS creators decided to aavoid this problem by not consulting designers. This is obviously the wrong approach, but it's the only one I can fathom, because CSS layout makes it difficult to do all but about half of the really simple things people want to do. You read that right. The standards are so nebulous that every browser interprets them differently, and while things are converging, it's a dramatically worse "standards" situation than even tables were in six years ago. (And the "that's easy, just try [non obvious, not particularly well documented feature]" comments above and elsewhere on the web prove my point, not the opposite.)
Meanwhile, a lot of designers have hopped on the CSS layout bandwagon, seeing that it solves a lot of problems they ran into before. What they don't see is that they've changed the sorts of design they produce. But it's obvious: most CSS layout based sites look different from most table based layout sites because CSS layout makes it too difficult to do the sorts of things most people do with table based layout. Meanwhile, the most zealous of converts rant about "standards" in a way which has nothing to do with anything. Tables are in the standard, but they're also interpreted pretty much the same by all browsers. CSS has a standard so big that on Thursdays the entire W3C staff simultaneously stands up and yells "hey, standardize this!", but that doesn't mean that any two browsers interpret this "standard" in a standard fashion.
Zeldman has 5 pages on how to do a two column layout (without a footer), and another site refers to a three column layout as "the holy grail". Last I checked, the holy grail was a legendary and powerful artifact, a label not rightfully applied to a layout any idiot could learn to make with tables in 3 minutes of reading the docs. The three column layout isn't considered impressive because it should be, it's considered impressive because CSS layout makes it hard and the people who use it have the lowest of ambitions.
CSS is a nice idea, but it needs to be extended to support simple layout, and the layout issues within in it need to be standardized before anyone will be able to use it for much.
Personally I use CSS and tables together... CSS to centralize appearance markup, and good old-fashioned tables for layout more complicated than simple flow with the occasional block-level element. I have found some simple-yet-useful layout effects only possible with CSS, but the results are often not sufficiently portable, even assuming NS4 is not a target. CSS isn't a complete system for mapping text to images. Whether I want my web browser to contain such a system is an interesting question... between Javascript and SVG I'm not sure I will have a choice soon. Certainly there have been moments where I was trying to do something in HTML and wishing for Display Postscript, but often that is a hint to the designer that they should let the content speak for itself and get out of the reader's way. About the pixel-based layout thing... surely you know that pixels are not pixels in CSS?
![[User Picture]](http://p-userpic.livejournal.com/5887295/515656) | From: jwz Sun, 4-May-2003 2:29 PM (UTC)
Re: | (Link)
|
surely you know that pixels are not pixels in CSS? OH. MY. GOD. So they've now guarenteed that "px" will have all the problems that "point" has historically had! Do they also have a requirement that images be auto-resized to the same scale?
look what you started :)
- brandy AKA firelegend (mediadiva.net)
From: (Anonymous) Mon, 5-May-2003 9:49 PM (UTC)
Possible Solution
| (Link)
|
A possible solution is demonstrated in the following code: <!DOCTYPE html PUBLIC "-//W3C//DTD 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Test</title>
<style type="text/css">
<!--
h1 {
text-align: center;
}
h1 span.txt {
background: #040;
border: solid 1px #0E0;
color: #0F0;
margin: 0px;
padding: 6px;
}
-->
</style>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph.</p>
<h1>This is a heading</h1>
<p>This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph.</p>
<script type="text/javascript" language="javascript">
<!--
var h1 = document.getElementsByTagName('h1');
for (var i = h1.length-1; i >= 0; i--) {
with (h1[i]) {
innerHTML = '<span class="txt">' + innerHTML + '</span>';
}
}
-->
</script>
</body>
</html>I used a style sheet to format to format both the headings and the marked-up text. A bit of JavaScript at the end is also used to transform the non-marked-up text children of the headings into markup-up text. In the future, I plan on adding a text mark-up rule to the XSLT that I use to write web pages (so this quirk of CSS doesn't bother me again). -Jimmy Cerra (mailto:jimbobbs@hotmail.com)
hey, I knwo this is an old post, but I followed a link here as was moved to comment. I think the problem with CSS isn't that it can't do what people want, its that people are reluctant to change their methods of coding to suit CSS. Also the annoying people that evangalise CSS are just as annoying as the people that claim its all BS. The truth is somewhre inbetween atm. CSS for the most part is implemented badly by designers. Using a correct doctype in your code eliminates 95% of all problems in browsers, yet some sites are still crap. CSS won't make a bad designer any better, but it will allow him to make a more flexable bad design that downloads quicker. Designers aren't coders, and coders aren't designers (generally speaking that is) so deigners rarely want to learn a new language - which is what CSS is. The examples you gave are really easy to achive across browsers. IT just requires more knowledge of CSS than you have. That isn't a slight to you, just fact. Another problem is that many people are idiots when it comes to upgradein their browser. They wouldn't complain if a 286 didn't run win98, but they will complain if a 6 year old browser doesn't work on all websites. CSS helps here by seperating the presentation from the content so - as long as the deisgner is a good one - even people that can't see styles will be able to read the content without a problem. Its about flexability and accessability in design and code. Two things that have been neglected, and now don't have to be. In fact legally might have to be concidered now. I hope you have more luck with CSS, try checking out this comprehesive and well organised resource if you'd like a good reference on what can and can't be done, as well as how.
"and that specify font sizes in pixels (not even points!) This is better than auto-flowing auto-sizing table layout... why? "
It's because the Mac OS displays points differently, which makes the page render differently then what you'd expect. With specific pixel specification, you can have the same page completely cross platform. Yeah, it's pretty anal. | |