CSS for positioning

CSS for positioning

by John Gone -
Number of replies: 12
I've just built a test site, un-related to Moodle unfortunately, that uses CSS for positioning. It's a very simple layout. Maybe a few of you could have a look and see if you can find any issues or failures. This is the first time I've used CSS for positioning so I'm expecting a few problems, don't be shy. I'll build something more complex based on the feedback I receive here and see how far I can take CSS for positioning.

For anybody who may be interested:
File sizes; index page built with
  • MS Frontpage- 10.7 kb
  • HTML with tables- 6.5 kb
  • CSS for positioning, no tables- 5.4


Thanks in advance for your feedback and time,
John

PS: Thanks to bluerobot.com for the CSS that I based this site on.
Average of ratings: -
In reply to John Gone

Re: CSS for positioning

by Timothy Takemoto -

Looks great in IE but like this below in the browser used at Kurume University. The universities that I teach at seem to find it difficult to save the "favourites" folder of IE to the virtual disc space of each user. In Netscape the favourites exist as a file which can be specificed.

Capture_10182003_122421.jpg

In reply to Timothy Takemoto

Re: CSS for positioning

by S. Fieler -
The problem with this layout are three things:

First: There is no doctype declaration. IE won't bother that much, as it is very tolerant to W3C standard mistakes, but the other browsers demand it.
And furthermore you can be shure, that the site is displayed in all MODERN browsern in the same way, when the site validates. And in this site there are some mistakes concerning standards, even if you validate it as html 4.01 Transitional:
http://validator.w3.org/check?uri=http%3A%2F%2Fwindowcapping.com%2F&charset=%28detect+automatically%29&doctype=HTML+4.01+Transitional
Ok, they are not all really big mistakes, but especially the two things with the end tags won't be tolerated by browsers others than IE.
I hope you don't mind, John, that I put your site through W3C validation. But I know, that there are still a lot of people who do not believe in tableless CSS-Design. And if you do not show them the reasons, why a site might not work in all browsers, they feel that they are right by saying that this way of doing websites is not good yet. Btw. your CSS validates perfectly.

Second: If you ask a webdesigner, he would say, that working with Frontpage is one of the biggest mistakes you can do. To me, I think this is a really hard opinion, but I can understand it. You can make frontpage to put out a rather good code, but the efforts will be so big, that you can write the site by hand or with a real html-Editor.

Third: The reason, why you, Timothy, see things like that, is, that your university is using an old browser. I imagine it is Netscape 4.7+. This is not only old, but antique. I know that many administrators especially at universities hang on NS 4.7+ like they where stuck on it.
When the German law about websites of official institutions was made, universities cried loud, that they need more time than there was in the law. So another study was made, whether this crying of universities was right. And the conclusion was, that there is no need for NS 4.7+ anymore. It was told that under the aspect of security and some other reasons, IE is not appropriate. But you can have a later version of NS or better Mozilla or Firebird or even Opera. All these browsers offer all things that were demanded by the universities.
One comparison:
If you drive a real oldtimer car, you do not expect that you get everything for it at every garage. You do not expect to have the same comfort you have in nowadays cars. But in Webdesign unfortunately all people expect this.
So I think the step originally done by alistapart was absolutely correct. They say: Do not exclude anyone from the content of a website, but do not bother for old brothers when it comes to design.
So old browsers see the sites similar as if you look at the site with a plain text browser. Your screenshot is the result.
There is only one thing that should be changed in the CSS-Layout: The div with the menu must be defined first in the (X)Html-file, so that the menu ist displayed on top of the side in older browsers, so that navigation is more comfortable.

My personal opinion is: I'm happy that people from Alistapart did this step and that you can say it grows as movement. Because this was one initial thing, that Webdesigners changed their mind and were no longer slaves of old browsers by having all the nice things in mind, they could do if they only would not have to support the oldtimer browsers. Perhaps some of you made experiences temselves when they did websites. Nearly for every browser you needed special hacks. This changed. If you write a standard conform code, you only need to develope for one browser. OK, there are some minor hacks in Box-model for IE, but this is nothing compared to the old times.
Webdesign did not go forward for a rather long time compared to the developments made at W3C.org. This changed by the very nice @import code shown by alistapart. That reveals modern CSS from old browsers that cannot interpret it but on the other hand opens the door, that the content of the site is displayed nevertheless.

Greetings from Bavaria
Susanne


In reply to S. Fieler

Re: CSS for positioning

by John Gone -
Thanks Susanne, for the excellent feedback, ideas and motivation to look at new ways of doing things. I don't mind at all that you put the site through W3C validation, thanks. I used to use this myself, occasionally, but haven't for quite a while. I guess I kind of gave up trying to conform to standards that are mostly ignored anyway. I like anything that moves things forward including table-less design. On the other hand after a few attempts at table-less design using CSS for positioning I'll probably not convert any other sites until there is wider compliance to the standards. Right now I think mostly we are being shown the possibilities for the future. BTW Susanne most of what I've been trying with CSS has been learned from the links you provided here. It has been enlightening and motivational and sometimes a little frustrating knowing what's possible but still out of reach of the huge majority.

Second: If you're not a webdesigner MS Frontpage is a great learning tool. Many people are exposed to web design/development by this awful little program but the motivated begin to quickly learn that there MUST be a better way. It's amazing how many designers started with Frontpage and then started cleaning up the code and quickly left Frontpage behind. But at least this provided them with the tools to start learning the trade. On the other hand many who try to build their own sites with Frontpage give up on it and contact a pro and get the site built properly. When they do contact a deigner they have a better idea of what's involved so then they don't mind when the build takes time and costs a few dollars. I put the size stats up there to show the Frontpage users the benefits of learning HTML or at least cleaning up the Frontpage code. I agree completely that Frontpage produces awful code but it does have it's place, tentative as it is.

Third: Thanks for the effort and the feedback Tim. Unfortunately I'm unable to see the screenshot and I'm unable to comprehend what it is that you're trying to say in your post.

In summary, I've learned something and re-built a site that has been badly neglected. Upwards and onwards.

Thanks everyone,
John
In reply to Timothy Takemoto

Re: CSS for positioning

by John Gone -
Hi Tim,
I've adjusted my settings and can see this image now. That's not very good. Thanks for having a look and for the feedback.
John
In reply to John Gone

Re: CSS for positioning

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Looks pretty good. On my wide screen the text sometimes isn't long enough down the page, and so the footer becomes obscured by the navbox on the left.
In reply to Martin Dougiamas

Re: CSS for positioning

by John Gone -
Thanks. It's a bit prettier than the original, for sure.

"On my wide screen the text sometimes isn't long enough down the page, and so the footer becomes obscured by the navbox on the left"
OUCH! Of course it does. That's a pretty critical ommission. I forgot to build for wide screen.blush I need more content in this layout and that is a healthy by-product of this exercise. I've been meaning to work on this site for a long time and now I've got a motivation to use some of the material I've been working on.

Thanks for the feedback,
John

In reply to John Gone

Re: CSS for positioning

by S. Fieler -
Puh, if I had only time to show you, that it can be easily made without more content.

Please do not think, that CSS-Laout might not work now. Just think over, how long you needed before you knew all tricks about tables for layout.
When you worked a little with tableless layouts, you will see that the layout you used is rather easy to do.

Unfortunately I do not have time at the moment to show this with your layout example. Perhaps in three weeks, I will have a little more spare time.

In the meantime, perhaps you can work with free layouts. Just look here:
http://css.fractatulum.net/sample/layout_zum_mitnehmen.htm
A German site, but if you click on demonstration, you can see the layout and under the link to the zipfile you can get the layout. Special about this layouts is, that each contains an extra old.css, that in NS 4.7+ you do not only see pure text. Every layout validates Xhtml 1.0 strict.

And here are two sites in English:
http://www.imaginaryworld.net/alt.html
http://www.ssi-developer.net/main/templates/

Here is a layoutomat:
http://www.inknoise.com/experimental/layoutomatic.php
here you have got a listomatic, that does you wonderful menus and lists:
http://www.accessify.com/tools-and-wizards/list-o-matic/list-o-matic.asp


The arguments you postet to my other posting concerning Frontpage are right. I have to admit that I started with Frontpage 97 years ago *brrr*.
Actually by noticing that Frontpage was writing a really bad code, I started to improve my Frontpage sites. I compared the code with the things shown in selfhtml http://selfaktuell.teamone.de/, a really wonderful source for learning html/CSS and some other things concerning webdesign (it is originally in German, there is a French, Spanish and Japanese translation, unfortunately no English one). I learned a lot and after a while I recognized that writing my sites by a good pure html-editor is better. So I did the way you described.

I think another problem with tableless layout is, that tables are deep in webmasters brains. You have to think different. The learning process is finished when you do not think of absolut positioning, of pixel exact design, but of scalable designs that float, where you can put nearly every object where you like.

When I think back to tables, I remember all that slicing in graphics to get a layout you like, I think of the impossible thing to put an object partly over another. Instead of that you had to use graphics, you had to slice again, and then you could be sure that one browser did not show the whole layout correct. So you had to insert transparent space-gifs to make a table steady.

To me divs and CSS were like freedom for the ideas I had of webdesign.

Greetings, Susanne
In reply to S. Fieler

Re: CSS for positioning

by John Gone -
Hi Susanne,
Once again you make an excellent post! I bet you are a very good teacher.
I agree with all you say above. I just have a lot to learn about CSS. I still have a lot to learn about tables and much else. I still spend way too much time fighting with table layout. CSS is definitely the way to go for me. Browsers will eventually catch up and we'll all be better off for it. The sites you mention above are full of more excellent information. I'll be spending as much time there as I can find. I particularly like this page, I wish I could read it. I encourage everyone to mouse around in there and see what's happening and view the code to see how this all works.

Susanne, you're an inspiration with your knowledge and enthusiasm.

Thanks for all your help and effort. All the best,
John
In reply to John Gone

Re: CSS for positioning

by John Gone -
Just an update on the subjects of CSS, XHTML and PHP for building even basic sites. Pretty much re-built the site I mentioned earlier in this thread. This one seems to be much better at positioning page elements and definitely works better at different screen resolutions. As a bonus I've complied with W3C standards although a little loosely. Even went crazy and built a better 404 Error page.

I'm convinced, after much reading, that standards are the way to go whenever possible. This was a lot of work to convert and it's a very small site. The payoff comes when I don't have to mess around with it too much in the future to ensure it works in future browser versions.

If anyone's interested there's only one small table in the whole site.

Now, if some of you Mac folks, Opera users and others would mind taking a test drive of the site to see if it works I'd really appreciate the feedback. And I promise not to ask again.

Thanks a million,
John
In reply to John Gone

Re: CSS for positioning

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Looks pretty sweet to me!

I can see some work coming up for you in the new Moodle Themestongueout
In reply to Martin Dougiamas

Re: CSS for positioning

by John Gone -
Thanks, and thanks for having a look for me. I kinda like that layout. I'm dying to see if it works in several other browsers and how far back it'll go, version wise, before it breaks... As an aside, this method may make it easier to optimize for search engines. I hope so because I had #1 in all relevant categories for the old site.
I've lost them all but I'll get 'em back... wink.gif

Yeah, anytime.
In reply to John Gone

Re: CSS for almost everything

by John Gone -
Want to know something about CSS and why you should? Check this out CSS
Thanks Martin, this is an A+ resource!