View Full Version : Proper CSS site design, divs, etc, what is the point???
evamermaid 07-03-2007, 07:32 I've got Dreamweaver but the powers that be tell me that DW's layers, etc shouldn't really be used (even though I find them brilliant for flexible, quick web design and can position things accurately with pixels and CSS rules) but no, apparently you should do it the proper way with measured out divs that require masses of mathematical calculations and forget about DW layers altogether.
Anyway, I've been doing this indepth and it's driving me crazy. It works, yes, but what I want to know is WHAT IS THE POINT? Table-style web design is soooooooooo much easier!!! And I really don't see why I can't use DW layers (even though the strict web compliance people don't like them). But if layers work, why not use them? What is the point of doing all this ultra-techie maths and coding when, in my mind, you don't have to.
Can anyone explain to me what the point of all this coding way of doing things is?
Reuse, compatibility and maintainability.
Re-use and compatibility comes from abstracting the presentation from the data. It allows you to present the pages in many different ways depending, for example, on the user-agent purely by switching a style sheet. The style sheet allows you to completely alter the look and feel of your site without touching the data. Style-sheet based sites are more easily maintainable as well, also largely down to this.
Tables may well work fine for you if you are creating a one-off static site and viewing your pages in IEwhatever on a desktop. They may not be so great for someone browsing your site with a mobile device, or for someone using web accessibility features, or for teams of developers wanting to present data across different formats.
Perosonally I never found CSS and DIVs to be full of maths and, in a lot of cases, I think they are far easier to manage than tables, once you understand how they work.
And to be honest it's easier to develop in the first place.
Soemof this comes from the reuse mentioned by mrmist, but also there is very little maths in DIVs and such, compared to the serious fannying around you do with tables.
Pages with tables used for structure (as oppose to displaying tabular dta) often end up being bigger than pages built with CSS for structure.
plus using tables, you end up with tables in tables within table cells within tables, and the source looks messy, and if theres a problem its harder to track it, and slower loading for browsers...
sallonoroff 07-03-2007, 09:48 I've just started dabbling with HTML and CSS again, i must say i have been impressed with how (relatively) simple it is to get things looking how you want.
I had expected it to be quite painful.
.
liam1412 07-03-2007, 09:49 I've just started dabbling with HTML and CSS again, i must say i have been impressed with how (relatively) simple it is to get things looking how you want.
I had expected it to be quite painful.
It is when you want to get it to work in all browsers. My site is finished but I can't launch it because I can't get it to work in firefox.
Grrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
CSS and DIV's are not really that difficult, I am also heavily into html and css and I am not the sharpest tool in the drawer, but, I can wrap my head around the fundamentals of css and div website design.
Keep persisiting, it's a lot better to create a website the proper way for the reasons my forum colleagues stated.
SpeedwayDan 07-03-2007, 10:22 I've just started learning how to use CSS too, to be honest im finding it much easier than using tables, i can already see how much more beneficial CSS based design is over tables
It is when you want to get it to work in all browsers. My site is finished but I can't launch it because I can't get it to work in firefox.
Grrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
the best piece of advice I can offer, to anyone, Build the site for Firefox, then more compliant browsers (such as Safari and opera) will just 'work' - then you can fix the site for the less compliant browsers, such as IE
SimpyTimpy 07-03-2007, 11:48 I've got Dreamweaver but the powers that be tell me that DW's layers, etc shouldn't really be used (even though I find them brilliant for flexible, quick web design and can position things accurately with pixels and CSS rules) but no, apparently you should do it the proper way with measured out divs that require masses of mathematical calculations and forget about DW layers altogether.
Anyway, I've been doing this indepth and it's driving me crazy. It works, yes, but what I want to know is WHAT IS THE POINT? Table-style web design is soooooooooo much easier!!! And I really don't see why I can't use DW layers (even though the strict web compliance people don't like them). But if layers work, why not use them? What is the point of doing all this ultra-techie maths and coding when, in my mind, you don't have to.
Can anyone explain to me what the point of all this coding way of doing things is?
Div layes are compliant with the new coding structures and have quite a few benefits over table based designing.
- Easy to move Div layers as apposed to table structured designs.
- When using CSS style sheets, you speed up the website to your visitors as they only need to load up the style sheet once and it applies to all pages.
- It saves alot of bandwith for people who are getting alot of visitors.
I like Div and CSS.
the best piece of advice I can offer, to anyone, Build the site for Firefox, then more compliant browsers (such as Safari and opera) will just 'work' - then you can fix the site for the less compliant browsers, such as IE
This man offers good advice :)
The object of CSS etc is splitting the presentation from the actual code. Doing it this way I can build a site without going near any presentation. Then by applying CSS I can make it look however I want...use different stylesheets for printouts, mobile devices etc etc. I'm actually off to this next month....should be interesting :)
http://thehighlandfling.com/2007/
evamermaid 07-03-2007, 12:22 I've just started dabbling with HTML and CSS again, i must say i have been impressed with how (relatively) simple it is to get things looking how you want.
I had expected it to be quite painful.
.
Well here I am, calculator in hand, adding up all my borders, margins, box widths and padding to make sure it all fits OK, then removing a pixel from here, having to add it onto there to keep the total correct....
Then I'm trying to work out where one wrapper ends with </div> after </div> trying to work out which belongs to which bit of code... AND having to do the whole thing in code view really.
But it's a challenge and I am determined to beat it...
I am still not convinced that it makes things easier because it definitely hasn't for me ;)
I'm actually off to this next month....should be interesting :)
http://thehighlandfling.com/2007/
Damn, Wish I knew about that sooner, im in scotland atm, and go once per month, (usually at the end of the month, this is 'febs' trip)
theres no way I can get up for the 5th April now :(
oh well. bookmarked any ways ;)
Well here I am, calculator in hand, adding up all my borders, margins, box widths and padding to make sure it all fits OK, then removing a pixel from here, having to add it onto there to keep the total correct....
Then I'm trying to work out where one wrapper ends with </div> after </div> trying to work out which belongs to which bit of code... AND having to do the whole thing in code view really.
That's what comments are for. Also remember with CSS / DIVs you do not have to code your content in the order in which it will appear on the page. You can move stuff around in your code.
Switching from table based design to div based design can be hard, because you think of building the page in the wrong way. The different approach requires a different methodology.
For examples of css and divs working well look at the Css zen garden (http://www.csszengarden.com/)
Note that the html source code is not some kind of div spaghetti, as it only goes about 4 levels deep. The html is the same for every design on the site, the point being to show the power of a css design.
Also, back on the "why is css preferred" question, there is the issue of accessibility. UK law is that the functions of websites must be accessible to the disabled. CSS the best way of doing this. Tables should generally only be used for tabulated data so that blind or partially blind users aren't confused.
In reality you can get a way with a couple of tables for design as I've done exactly that with one site and it passed the accessibility testing of a couple of blind people with flying colours.
mr chris 07-03-2007, 20:09 If you have the Firefox Web Developer extension and can disable CSS, it's worth doing so as it shows you the bare bones of your website.
www.clt-conference.co.uk is one I've built recently and it uses CSS and XHTML, but completely separately. No styles are defined on the pages at all, it's all kept in a separate CSS document. If you disable CSS you'll see that the page is still legible, and that's important for people who use screen readers - tables will confuse the reader and frames, well... forget it!
All pages validate except the booking page (and the mailing list - damn you phplist), but that's just because the form is generated from a plugin for the CMS and it's using IDs that begin with numbers... however it's only truly a problem if you start using javascript all over the place, so I'm sure it'll live.
The web is full of people who can't be bothered to do things properly, and it truly suffers for it!
*Edit* and it even uses a table - for tabular data!
Damn, Wish I knew about that sooner, im in scotland atm, and go once per month, (usually at the end of the month, this is 'febs' trip)
theres no way I can get up for the 5th April now :(
oh well. bookmarked any ways ;)
Ahh well :) I managed to get going to one of these in my objectives for the year. It's a friend of a friend who's organising it so quite handy.
|
|