View Full Version : Strict XHTML and CSS


PIF_Tails
31-01-2005, 19:11
I originally wrote a very basic website uses frames and quickly realised the limitations.

Last year I rewrote the site using tables & HTML (via Dreamweaver).

I have recently been reading about Strict XHTML & CSS and how this is meant to be good on all brosers and good coding practice.

Is this the best way to improve my website ? Or should I be reading up on something else ?

(Take it as read that I am sticking with the very purple colour scheme and the cat theme ;) )

If yes, how do I centre an image using Strict XHTML ?

Here is my one and only validated page http://www.piftails.com/introducingnewcat.html

JoeP
31-01-2005, 19:28
Hiya,

I don't know about 'strict' but I've recently started using CSS rather than tables for producing layouts. I still use tables on occasion, but I have tried to reduce their usage whilst staying sane.

It's still a learning curve for me, but here are a couple of sites I've done where I've tried to use CSS more.

www.marketingmixers.com - still using tables for some data but mainly CSS. PHP / mySQL back end. I worked with a designer on this one - I'm really a 'back end' person.

www.bendthebullet.co.uk

www.shefalt.curious-hosting.co.uk


If anything there looks useful then PM me and I'll sort out the bit of the CSS.

BTW - IE sometiems has kittens with legitimate CSS and so you still occasionally have to do a few 'tweaks'....:)

Joe

PIF_Tails
31-01-2005, 20:24
Wow, you are very good at building websites:)

I *think* I have cracked the picture centering, I just surrounded the image code with heading tags for a center font, it works !!!

So is using 'strict' a problem / not recommended ?

fnkysknky
31-01-2005, 20:32
It's a good idea and the W3C woulds recommend it but doesn't seem that many people are bothering. As it's in XHTML it should mean that even low power devices (and possibly non visual) that can't run a sophisticated browser can still process it as it's essentially XML. In practice though it won't make that much difference currently give or take a few problems with older browsers etc.

alchresearch
31-01-2005, 20:38
CSS tabling is very popular at the minute. Many web designers are now steering away from frames and iframes, mostly because some browsers (such as IE for the Mac) don't display them properly.

Whatever you decide, make sure that you have Mozilla, Netscape and Opera installed so you can preview your results.

There's also a web page you can go to which allows you to see your page viewed on a Mac, but the website escapes me at the minute.

JoeP
31-01-2005, 20:47
The other thing with frames is that search engines hate them and they usually screw up when you print them!

Although just occasionally they have their uses on days when quick and dirty is needed!

:)

march
31-01-2005, 21:02
My view on it all (not that anyone asked for it!!) is that I will use whatever makes my life easier. If it is going to be a pain (as it can be) to get the classic 3 column layout, for example, that is easily achieved with tables using CSS, then why bother, 99.9% of people viewing the site will see it just fine anyway.

So most the time I define a basic stucture with a few tables then use CSS to make it look "pretty" for want of a better word. You can see an example at http://www.rentoliva.co.uk which AFAIK displays how I want (apart from a slight delay on the rollovers which I will sort when I get time) in all, sorry most, browsers. Almost everything apart from the basic stucture (and some of the text I got bored of converting from font tags) is done in CSS , including the rollovers which I only just realised you could do.

PIF_Tails
31-01-2005, 22:48
I have definately not using frames again but I did find a three column template which I will be amending for my front pages.

Thanks for the advice to date, it is very useful.

I have the basic templates sorted so I'm just need the time to rewrite all my other pages ;)

hade
01-02-2005, 08:59
I didn't think anyone used frames anymore (at least not the pro's) and I-frames are essentially the same. I used frames quite a few years ago on one of the University's dept sites and really screwed up when it came to search engines!(never again!!)

I tried hand coding a bit of a css layout before and couldn't be bothered with it, I prefer the wysiwyg way of bieng able to see what you're doing.

Tables do my head in, but are essential as I do a lot of stuff in fireworks, and the sliced up graphics are assembled in tables.

I have a query tho, With Dreamweaver, I've been using layers to put my content in, a mix of layers and tables. How similar is this to just using css, is it browser friendly? The only problem I can see so far with
http://www.papamofoman.com
is with Firefox the scrollbars' colours remain grey when they should be red and yellow. Oh and also the tables need to be aligned left in a fixed position.

Another is http://www.roughdisko.com but it's a lot simpler.

Chars
H

Phanerothyme
01-02-2005, 09:23
Just set your dreamweaver (MX?) to create XHTML compliant pages by default. Each page will then include the correct dtd information.

If you are using fireworks, you can assemble the slices just as easily using CSS rather than tables. and this allows you to do some interesting things that go beyond rollovers etc, with a well sliced multi layer image (particularly the ability to put one slice over another and animate slices using Javascript (not possible with tables)..
On the whole I try only to use tables where I have tabular data. Although in terms of spitting out a website from a sliced ImageReady file - tables speedy - it's just that when you come to edit them, it all goes tits up.
Originally posted by hade
I didn't think anyone used frames anymore (at least not the pro's) and I-frames are essentially the same. I used frames quite a few years ago on one of the University's dept sites and really screwed up when it came to search engines!(never again!!)

As frames are part of the HTML 4.01 standard, there should be no problem, and if you are worried about search engines, then a simple <noframes> tag ought to do it.

I agree frames aren't the best and their implementation is patchy, but the <iframe> tag is still very handy indeed, especially when trying to provide your users with a persistent interface, and continuously updating information. Or in the case of server side script, requesting a page (or script) without losing the oncscreen information. Iframes can be almost invisible too (minimum dimensions are 1x1) - and there's fun to be had there!

As in everything on the web, and in multimedia - decide what you want to do, and then see if you can make the technology deliver. The other way round, see what is possible with the technology and then try and use it - is backwards. You end up with a limited view of what is possible.

The only problem I can see so far with
http://www.papamofoman.com
is with Firefox the scrollbars' colours remain grey when they should be red and yellow.
That (custom scrollbars) is an IE only feature and not part of the XHTML standard. -- edit - may need to eat my words on that one.


Chars
H