I’ve had a rather buggy site the last year and really have only had the time to play around with it now,
I’m half-way though converting to XHTML 1.0 Strict and I’m having a few issues, What I’ve got problems with is removing backgrounds and using CSS to insert the backgrounds for me.
I’ve added a static menu down the bottom for those (evil people) that don’t have the flash plugin installed. SEO inclusive.
eg. Instead of using the HTML background code, using a CSS equivent…
background="images/top03.gif" To something like this in CSS
```
Current CSS, Make any changes you need.
File : style.css
```php
body {font-size: 67.5%; margin: 0em auto; padding: 0px; font-family: arial, tahoma, verdana, sans-serif;}
I’ve had a quick look at the coding and it makes a dramatic difference to load times, it’s almost as if, with flash it’s instantaneuos which I can assure you clients would love for thier own site.
The structure makes it all a breeze but I’m taking it difficult to drop tags I’ve used for so long lol.
One thing that has bugged me about all this xhtml stuff - won’t you just end up with a huge css file thats being loaded on each page even though some styles aren’t required?
[quote name=‘recedo’]One thing that has bugged me about all this xhtml stuff - won’t you just end up with a huge css file thats being loaded on each page even though some styles aren’t required?[/quote]
Not at all so I’ve learned.
Presuming you have a large block of text that you want to be made red you’ld normally enter
Text goes here<*end prefix*>
This might seems like a pita but in the long haul you can change an entire site’s colour scheme’s by changing ‘red’ to ‘blue’
I used to have 20kb html pages (without flash) and I’ve now made that into a 6kb file, with a 1kb CSS file.
Hence 5 html pages = 100kb
OR
6kb x5pages = 30kb + 1kb(css)= 31kb overall
I’m getting a 70% faster load time… Inital flash download is almost within the 3 second range so my site is up and running quicker and seemingly lighter
I guess this goes to show why CS cart and others are moving to XHTML/CSS now and leaving smarty for the dust?
1 line to change in CSS, 12 lines to change in html along with the excessive size the file could become !
Re-Useable code is the key here....
[B]BUT CS is not LEAVING SMARTY FOR DUST !!!! Smarty is a template engine, and will incorporate their CSS and xhtml,
as long as they dont have a different class for each individual item it will be ok...[/B]
[quote name=‘recedo’]One thing that has bugged me about all this xhtml stuff - won’t you just end up with a huge css file thats being loaded on each page even though some styles aren’t required?[/QUOTE]
It’s better to have a big CSS file than a big HTML file. And the CSS gets cached too.
Thanks for above… I understand how using it for styling reduces size, easier changes etc - I’ve been designing websites for years…
It’s the replacing tables with etc. Where you use a lot of tables in the html, now you’re going to have a lot of styles in the css instead and these will be loaded with every page as oppose to only the pages they are displayed on, if you see what I mean. If the css is cached I guess this isn’t so bad though.
Something I have thought of while writing this which I guess would help reduce the css size;
I have several javascripts on my site, some are only required on certain pages, so instead of just loading them up in the index template I add an {if} statement so they only load if it is the appropriate page… I assume you could do this with css files too, for example if you had a css file for the checkout tables (or in this case modified to divs) you could set it to only load on the checkout pages hence saving X bytes on the pages that don’t need this.
Sorry, I’m just trying to work out the major pros of spending a huge amount of time converting my shop to this method! Free time is something I don’t have much of!
[quote name=‘recedo’]Thanks for above… I understand how using it for styling reduces size, easier changes etc - I’ve been designing websites for years…
It’s the replacing tables with etc. Where you use a lot of tables in the html, now you’re going to have a lot of styles in the css instead and these will be loaded with every page as oppose to only the pages they are displayed on, if you see what I mean. If the css is cached I guess this isn’t so bad though.[/quote]
Not necesserally, if dont right anyway…
as you know im not finished, but so far im managing to cut down my nested divs too… and as for additional css, I have only really had to add an additional 4 or 5 classes to my code
But theres still many reasons why even 30 nested divs lol… is better than 30 nested tables.