Home News Forum Articles
  Welcome back Join CF
You are here You are here: Home | Forum | Web Design, CSS compatibilty and suchlike


You are currently viewing our boards as a guest which gives you limited access to view most of the discussions, articles and other free features. By joining our Virgin Media community you will have full access to all discussions, be able to view and post threads, communicate privately with other members (PM), respond to polls, upload your own images/photos, and access many other special features. Registration is fast, simple and absolutely free so please join our community today.


Welcome to Cable Forum
Go Back   Cable Forum > Computers & IT > Internet Discussion
Register FAQ Members List Calendar Mark Forums Read

Web Design, CSS compatibilty and suchlike
Reply
 
Thread Tools
Old 28-04-2008, 15:31   #1
Rob
Cable Forum Team
 
Rob's Avatar
 
Join Date: Jun 2003
Age: 43
Posts: 10,921
Rob is a twin star memberRob is a twin star member
Rob is a twin star memberRob is a twin star memberRob is a twin star member
Web Design, CSS compatibilty and suchlike

I'm trying (very trying) to build a new website for work. I want to make sure this is compliant with all proper standards. Thus being good I'm wanting to use css stylesheets to control the formating. That should be simple enough. Trouble is I think I have something cracked, in that it displays OK using Internet Explorer, I then look at it in Firefox and it's completely different and often hideous.

Does anybody have recommendations for a good textbook that actually deals with CSS stylesheets and indicates what is and is not compatible?

Am I being unrealistic to try and control the entire page layout with CSS? The fewer codes I embed in the actual page, the more consistent the site will be, and the less errors I'll make as I build up, and subsequently edit the pages.

I've read that I shouldn't be trying to use tables to control page layouts. The use of tables can confuse those needing page reader software as those can't differentiate between layout and tabulated content needs. Am I just making a rod for my own back by avoiding tables?

What about frames? Are they out of favour too?

I really want to Keep It Simple, if I can, but equally it does need to look reasonably professional. Our current site can only be described as pathetic, but then I did do that in Frontpage back in 2000. It's now time to do it properly using text editors and the like.
__________________
The [NTHW] PC & XBox Clan! ~ Call of Duty Gameservers

Help Cable Forum's MiniCity grow:
Population|Industry|Transport|Security|Environment
Rob is offline   Reply With Quote
Old 28-04-2008, 15:41   #2
dev
cf.geek
 
Join Date: Jan 2004
Posts: 720
dev is a glorious beacon of lightdev is a glorious beacon of lightdev is a glorious beacon of lightdev is a glorious beacon of lightdev is a glorious beacon of light
Re: Web Design, CSS compatibilty and suchlike

Coding to the CSS spec is only one part of making a proper web site now. You shouldn't be using tables/frames/iframes for the layout, tables are fine for tabulated data (ie what they are meant for). The site should be usable without the CSS stylesheet applied too, obviously it won't look the same but it should have a recognisable flow to it. Things to help with that include putting the menu in a list (using <ul> & <li>).

As for compatibility across sites, you should be testing in (imo anyway) IE6 & 7, Opera, Firefox and Safari. If you add some CSS styling and it looks wrong in one of the browsers, think about how you expect the code to work and make sure the code you've added does what you want it to. When you're sure the code should do what you want, get googling to find a fix for the browsers getting it wrong.

Few things to think about:

IE6 + transparent PNGs don't mix well and will require IE6 specific CSS fixes to get them to work
IE6 + float + margins on elements result in the margins being doubled and again require specific CSS fixes
If you float elements inside another, the parent element will need to have 'overflow:auto' set otherwise it won't stretch to its containing elements.
dev is offline   Reply With Quote
Old 28-04-2008, 15:44   #3
Cable Forum Team
 
Gavin's Avatar
 
Join Date: Jun 2003
Location: Cockney geeza land
Age: 27
Services: c:\> net start Gavin
Posts: 11,569
Gavin has a fine set of QuadsGavin has a fine set of QuadsGavin has a fine set of QuadsGavin has a fine set of Quads
Gavin has a fine set of QuadsGavin has a fine set of QuadsGavin has a fine set of Quads
Re: Web Design, CSS compatibilty and suchlike

I can't recommend a specific book, normally just experience and google.

IE is the worst for standard compliance so what I do is code for Firefox/Opera, and then perform whatever workaround is needed (and there are a few) to get the site looking OK in IE. If you come across something not displaying fine in IE, then google for a workaround.

Ideally you should use 100% CSS (called Strict specification), but sometimes this is impractical and its just easier to use as much as you can (called Transitional) and use tables, etc, for the rest. There's nothing too wrong with that, although you should be aware that mobile browsers won't render it (tables) perfectly. However, the amount of non-WAP mobile browsers out there, and especially if its not a mobile-needed site, then its worth it.

Frames should definitely be avoided for all sites.

If you're bored you can read the specifications on the www.w3.org site. More helpful though are the validators to check your code for compliance. Also, as important as CSS, aim to get your code XHTML compliant too.
__________________
Formerly punky. Still an Eric Cartman wannabe. Comments in bold are moderating actions.

"We're not here for a long time, we're here for a good time"
"Reach For the Sky, 'cause tomorrow may never come"
Gavin is offline   Reply With Quote
Old 28-04-2008, 15:45   #4
Juvenile World Dominator
 
Zeph's Avatar
 
Join Date: Jul 2003
Location: Poole, Dorset
Age: 22
Services: Sky Entertainment Pack NTL 4MBit
Posts: 8,688
Zeph is a king among kings
Zeph is a king among kingsZeph is a king among kingsZeph is a king among kingsZeph is a king among kingsZeph is a king among kingsZeph is a king among kingsZeph is a king among kingsZeph is a king among kingsZeph is a king among kingsZeph is a king among kingsZeph is a king among kingsZeph is a king among kingsZeph is a king among kingsZeph is a king among kings
Send a message via ICQ to Zeph
Re: Web Design, CSS compatibilty and suchlike

<table>
<tr>
<td>
Good for anything!
</td>
</tr>
</table>
__________________
Peter: Oh my god, Brian, there's a message in my Alphabits. It says, 'Oooooo.'
Brian: Peter, those are Cheerios.
www.elitehealthdistribution.co.uk - www.loonyasylum.net
Zeph is offline   Reply With Quote
Old 28-04-2008, 15:47   #5
Cable Forum Team
 
Gavin's Avatar
 
Join Date: Jun 2003
Location: Cockney geeza land
Age: 27
Services: c:\> net start Gavin
Posts: 11,569
Gavin has a fine set of QuadsGavin has a fine set of QuadsGavin has a fine set of QuadsGavin has a fine set of Quads
Gavin has a fine set of QuadsGavin has a fine set of QuadsGavin has a fine set of Quads
Re: Web Design, CSS compatibilty and suchlike

To get started, decide on what layout you want (header/left-sidebar, header/left-sidebar/right-sidebar, etc), and then google for the CSS. Then you can just build your content off of there.
__________________
Formerly punky. Still an Eric Cartman wannabe. Comments in bold are moderating actions.

"We're not here for a long time, we're here for a good time"
"Reach For the Sky, 'cause tomorrow may never come"
Gavin is offline   Reply With Quote
Old 28-04-2008, 15:51   #6
Rob
Cable Forum Team
 
Rob's Avatar
 
Join Date: Jun 2003
Age: 43
Posts: 10,921
Rob is a twin star memberRob is a twin star member
Rob is a twin star memberRob is a twin star memberRob is a twin star member
Re: Web Design, CSS compatibilty and suchlike

Am I trying to be too clever, perhaps in my naivety of how search engines work. I'm trying to get each page to have the prime content as the first stuff in the coding order, with the repeating stuff, that doesn't change from page to page, written in after that, say for example:

Code:
header stuff & stylesheet links

<body>
<div class="content"><!-- main page content goes here --></div>

<div class="header"><!-- page header goes here --></div>

<div class="menu"><!-- page menu goes here --></div>
</body>
Obviously the various classes include all the layout positioning background and other stuff, and may well include nested classes for sub divs of the elements as required.
__________________
The [NTHW] PC & XBox Clan! ~ Call of Duty Gameservers

Help Cable Forum's MiniCity grow:
Population|Industry|Transport|Security|Environment
Rob is offline   Reply With Quote
Old 28-04-2008, 15:55   #7
dev
cf.geek
 
Join Date: Jan 2004
Posts: 720
dev is a glorious beacon of lightdev is a glorious beacon of lightdev is a glorious beacon of lightdev is a glorious beacon of lightdev is a glorious beacon of light
Re: Web Design, CSS compatibilty and suchlike

Quote:
Originally Posted by Rob View Post
Am I trying to be too clever, perhaps in my naivety of how search engines work. I'm trying to get each page to have the prime content as the first stuff in the coding order, with the repeating stuff, that doesn't change from page to page, written in after that, say for example:

Code:
header stuff & stylesheet links

<body>
<div class="content"><!-- main page content goes here --></div>

<div class="header"><!-- page header goes here --></div>

<div class="menu"><!-- page menu goes here --></div>
</body>
Obviously the various classes include all the layout positioning background and other stuff, and may well include nested classes for sub divs of the elements as required.
Although it is possible, I wouldn't recommend it as sites nowadays should be able to work without the CSS loaded and so in that case, the flow of the site would be all wrong.
dev is offline   Reply With Quote
Old 28-04-2008, 15:59   #8
Cable Forum Team
 
Gavin's Avatar
 
Join Date: Jun 2003
Location: Cockney geeza land
Age: 27
Services: c:\> net start Gavin
Posts: 11,569
Gavin has a fine set of QuadsGavin has a fine set of QuadsGavin has a fine set of QuadsGavin has a fine set of Quads
Gavin has a fine set of QuadsGavin has a fine set of QuadsGavin has a fine set of Quads
Re: Web Design, CSS compatibilty and suchlike

That should be OK. If you're using pure CSS with the absolute positioning (see below) then it doesn't matter what order you code it.


div.header {
position:absolute;
top:0px;
left:0px;
height:150px;
width:100%;
}

div.menu {
position:absolute;
top:150px;
left:0px;
width: 100px;
}

div.content{
position:absolute;
top:150px;
left:100px;

/* etc...*/
}

Then you order the divs however you want, header, menu, content, or content, menu, header. They are all repositioned accordingly when the source is parsed.

Little tip for free: If you have repeating content like a header, menu or footer, look at using PHP or something to import it

<?php include('header.php'); ?>
Rest of HTML here...

and then you can store the header information once in header.php and then alter it once and all pages will then use the new header. You can also do this via Javascript if you don't like or have PHP for whatever reason (it is free and on all OSes)
__________________
Formerly punky. Still an Eric Cartman wannabe. Comments in bold are moderating actions.

"We're not here for a long time, we're here for a good time"
"Reach For the Sky, 'cause tomorrow may never come"
Gavin is offline   Reply With Quote
Old 28-04-2008, 16:03   #9
Rob
Cable Forum Team
 
Rob's Avatar
 
Join Date: Jun 2003
Age: 43
Posts: 10,921
Rob is a twin star memberRob is a twin star member
Rob is a twin star memberRob is a twin star memberRob is a twin star member
Re: Web Design, CSS compatibilty and suchlike

Yep I was going down the PHP include router for the standard stuff As for the rest, I can see a few headaches coming
__________________
The [NTHW] PC & XBox Clan! ~ Call of Duty Gameservers

Help Cable Forum's MiniCity grow:
Population|Industry|Transport|Security|Environment
Rob is offline   Reply With Quote
Old 28-04-2008, 17:33   #10
Do I look like I'm joking
 
handyman's Avatar
 
Join Date: Jun 2003
Location: Nr Carnforth
Age: 32
Services: I want ntl 10mb *stomp*
Posts: 4,980
handyman is a king among kings
handyman is a king among kingshandyman is a king among kingshandyman is a king among kingshandyman is a king among kingshandyman is a king among kingshandyman is a king among kingshandyman is a king among kingshandyman is a king among kingshandyman is a king among kingshandyman is a king among kingshandyman is a king among kingshandyman is a king among kingshandyman is a king among kingshandyman is a king among kings
Send a message via MSN to handyman
Re: Web Design, CSS compatibilty and suchlike

Quote:
Originally Posted by Rob View Post
Yep I was going down the PHP include router for the standard stuff As for the rest, I can see a few headaches coming
I've gone down this route as well as it makes my sites easy to build up with repeatable code.

However you do need to make sure you change your commas to , and your pounds to &pound; etc.

I'm getting pretty good at cross browser css layouts so would be happy to try help, u got my msn if you wanna ask anything.

Basic stuff is

Container div with left and right margins set to auto will centre the site in the browser.
You can float the container left for a left aligned site

header div set to same width as container with a right clear
columns floated left and right (just make sure your margins and padding adds up so that everything stays in the container).
Footer after the columns with width and clear set the same as the header, job done.

I've started adding in a css reset as well which helps with the cross browser compatibility be setting all default margins and styles etc to 0.

---------- Post added at 17:33 ---------- Previous post was at 17:26 ----------

Quote:
Originally Posted by Zeph View Post
<table>
<tr>
<td>
Good for anything!
</td>
</tr>
</table>
= Old fashioned as well.

If you want to change the layout you will have to go into each and every file on the site. When you have sites running to 100's if not 1000's of pages this is impossible.

Last edited by handyman : 28-04-2008 at 17:30.
handyman is offline   Reply With Quote
Old 28-04-2008, 17:58   #11
Juvenile World Dominator
 
Zeph's Avatar
 
Join Date: Jul 2003
Location: Poole, Dorset
Age: 22
Services: Sky Entertainment Pack NTL 4MBit
Posts: 8,688
Zeph is a king among kings
Zeph is a king among kingsZeph is a king among kingsZeph is a king among kingsZeph is a king among kingsZeph is a king among kingsZeph is a king among kingsZeph is a king among kingsZeph is a king among kingsZeph is a king among kingsZeph is a king among kingsZeph is a king among kingsZeph is a king among kingsZeph is a king among kingsZeph is a king among kings
Send a message via ICQ to Zeph
Re: Web Design, CSS compatibilty and suchlike

Quote:
Originally Posted by handyman View Post
If you want to change the layout you will have to go into each and every file on the site. When you have sites running to 100's if not 1000's of pages this is impossible.
Not when you're the master of the PHP Include
__________________
Peter: Oh my god, Brian, there's a message in my Alphabits. It says, 'Oooooo.'
Brian: Peter, those are Cheerios.
www.elitehealthdistribution.co.uk - www.loonyasylum.net
Zeph is offline   Reply With Quote
Old 28-04-2008, 18:01   #12
Cable Forum Team
 
Gavin's Avatar
 
Join Date: Jun 2003
Location: Cockney geeza land
Age: 27
Services: c:\> net start Gavin
Posts: 11,569
Gavin has a fine set of QuadsGavin has a fine set of QuadsGavin has a fine set of QuadsGavin has a fine set of Quads
Gavin has a fine set of QuadsGavin has a fine set of QuadsGavin has a fine set of Quads
Re: Web Design, CSS compatibilty and suchlike

Don't even have to be a master if you use ASP.NET Master Pages.
__________________
Formerly punky. Still an Eric Cartman wannabe. Comments in bold are moderating actions.

"We're not here for a long time, we're here for a good time"
"Reach For the Sky, 'cause tomorrow may never come"
Gavin is offline   Reply With Quote
Old 29-04-2008, 13:43   #13
cf.geek
 
webcrawler2050's Avatar
 
Join Date: Feb 2008
Location: Gloucester
Services: V+ VM 20MB VM Fixed Line VM Mobiles
Posts: 517
webcrawler2050 is just really nicewebcrawler2050 is just really nicewebcrawler2050 is just really nicewebcrawler2050 is just really nice
Send a message via MSN to webcrawler2050 Send a message via Skype™ to webcrawler2050
Re: Web Design, CSS compatibilty and suchlike

I had a hard time trying to get my new site to validate - it takes alot of fussy little things, PHP doesnt help either. I fyou need any help just drop us a PM
__________________
Kind Regards
Richard Copestake
Bionic Internet Ltd - UK Web Hosting - UK Reseller Hosting
Company No: 6545963
webcrawler2050 is offline   Reply With Quote
Old 29-04-2008, 15:29   #14
Virgin Media Employee
 
tweetiepooh's Avatar
 
Join Date: Sep 2005
Location: Winchester
Services: Staff intouch BB: VM XL TV: VM XL Phone : VM
Posts: 240
tweetiepooh is a jewel in the roughtweetiepooh is a jewel in the roughtweetiepooh is a jewel in the rough
Re: Web Design, CSS compatibilty and suchlike

Use HTML validator on Firefox (only available for Windows).

Code with XHTML 1.0 Transitional or Strict. Fix the errors in Firefox.

Using the XHTML DOCTYPE will help IE try to get it right.

I use Perl CGI and then build a module to handle the repeatable stuff like headers, footers and so on.

Then the page code looks more like :
Code:
#!/usr/local/bin/perl -w

use strict;
use CGI;
use CGI::Carp qw(fatalsToBrowser);   # errors to browser

use mymodule;

# call my wrapper code, return the CGI object for local stuff
my $q = mymodule::StartPage("Page title","Subtitle","css file");
...
At some point I'll need to look to templating.
__________________
I work for Virgin Media but reply here in my own right. Any help or advice is made as a best effort basis. No comments construe any obligation on VM or its employees.
tweetiepooh is offline   Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


All times are GMT +1. The time now is 06:01.


Links
Google
 
Web www.cableforum.co.uk


Powered by vBulletin® Version 3.6.9
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0
Copyright © 2003 - 2008, Cable Forum.
(s204569790.onlinehome.info)