Myreader.co.uk  
uk news, chat and community
   home   |   control panel login   |   archive   |  
 
net
net
news.announce
news.config
news.management
news.moderation
providers
providers.aaisp
web.authoring
  
 
date: Wed, 15 Apr 2009 12:21:36 +0100,    group: uk.net.web.authoring        back       
Sick of complicated workarounds   
I want to centre a block of content on a page.

You'd think it was simple, you'd think it was something that people
would want to do all the time.  But for IE, oh no.

Easy peasy way:

Stick everything in a single cell table, CSS it margin: auto and away
you go.

<style>
#mycontent table{
margin:auto;
}
</style>

<div id='mycontent'>
  <table>
    <tr>
      <td>
<!--Content goes here, forms select boxes, lists headings etc-->
      </td>
    <tr>
</div>




Does anyone know of a similarly simple way of doing it  without using a
table?
-- 
Geoff Berrow  0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011
http://slipperyhill.co.uk - http://4theweb.co.uk
date: Wed, 15 Apr 2009 12:21:36 +0100   author:   Geoff Berrow

Re: Sick of complicated workarounds   
In article ,
 Geoff Berrow  wrote:

> I want to centre a block of content on a page.
> 
> You'd think it was simple, you'd think it was something that people
> would want to do all the time.  But for IE, oh no.
> 
> Easy peasy way:
> 
> Stick everything in a single cell table, CSS it margin: auto and away
> you go.
> 
> <style>
> #mycontent table{
> margin:auto;
> }
> </style>
> 
> <div id='mycontent'>
>   <table>
>     <tr>
>       <td>
> <!--Content goes here, forms select boxes, lists headings etc-->
>       </td>
>     <tr>
> </div>
> 
> 
> Does anyone know of a similarly simple way of doing it  without using a
> table?

For centring blocks, for other than tables, you need to specify a width. 
Tables have a shrink to fit mechanism. Not so DIVS (unless floated).

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
        "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>aligning</title>
<style type="text/css" media="screen">
#mycontent div {margin:auto; border: 1px solid; width: 30em; }
</style>
</head>
<body>
<div id='mycontent'>
  <div>
    Content goes here, forms select boxes, lists headings etc
</div>
</div>
</body>
</html>

-- 
dorayme
date: Thu, 16 Apr 2009 08:22:07 +1000   author:   dorayme

Re: Sick of complicated workarounds   
In uk.net.web.authoring message <6dgbu45amsp248jm8l6u46bm520au0gttn@4ax.
com>, Wed, 15 Apr 2009 12:21:36, Geoff Berrow 
posted:
>I want to centre a block of content on a page.

Look at almost any of my pages :
        " No-Frame * Framed Index * Frame This "
is entirely styled by being in a <div class=CAN>

Essentially, CAN, defined in
 <http://www.merlyn.demon.co.uk/styles-a.css>, reduces to
 .CAN {
  border: 1px solid black; padding: 0.4ex;
  color: black; width: 42ex; background: #CCFFFF;
  margin: 1ex auto 1ex auto; text-align: center; }
which is more than you really need.



JavaScripters should read
<http://www.ecma-international.org/publications/files/drafts/tc39-2009-025.pdf>.

-- 
 (c) John Stockton, nr London, UK.    ?@merlyn.demon.co.uk     Turnpike v6.05.
 Web  <URL:http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms
 PAS EXE etc : <URL:http://www.merlyn.demon.co.uk/programs/> - see 00index.htm
 Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm etc.
date: Wed, 15 Apr 2009 20:40:56 +0100   author:   Dr J R Stockton

Re: Sick of complicated workarounds   
Message-ID: 
from dorayme contained the following:

>> Does anyone know of a similarly simple way of doing it  without using a
>> table?
>
>For centring blocks, for other than tables, you need to specify a width. 
>Tables have a shrink to fit mechanism. Not so DIVS (unless floated).

Quite so.  Shrink to fit is an obvious requirement on a dynamic site.
display:table works great in FF, sadly not in IE.

Of course, a single celled table doesn't break any accessibility rules.
Or does it?
-- 
Geoff Berrow  0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011
http://slipperyhill.co.uk - http://4theweb.co.uk
date: Thu, 16 Apr 2009 00:09:32 +0100   author:   Geoff Berrow

Re: Sick of complicated workarounds   
Message-ID: <Af78kruIhj5JFwGn@invalid.uk.co.demon.merlyn.invalid> from
Dr J R Stockton contained the following:

>Essentially, CAN, defined in
> <http://www.merlyn.demon.co.uk/styles-a.css>, reduces to
> .CAN {
>  border: 1px solid black; padding: 0.4ex;
>  color: black; width: 42ex; background: #CCFFFF;
>  margin: 1ex auto 1ex auto; text-align: center; }
>which is more than you really need.

I should have mentioned shrink to fit as a requirement
-- 
Geoff Berrow  0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011
http://slipperyhill.co.uk - http://4theweb.co.uk
date: Thu, 16 Apr 2009 00:12:41 +0100   author:   Geoff Berrow

Re: Sick of complicated workarounds   
In article ,
 Geoff Berrow  wrote:

> I should have mentioned shrink to fit as a requirement

In that case, maybe you might look at my pages at:

http://netweaver.com.au/centring/

and page 4 in particular.

-- 
dorayme
date: Thu, 16 Apr 2009 10:37:16 +1000   author:   dorayme

Re: Sick of complicated workarounds   
On Thu, 16 Apr 2009 00:09:32 +0100, Geoff Berrow
 wrote:

>Of course, a single celled table doesn't break any accessibility rules.
>Or does it?

The problem with tables is linearization of multiple cells and their
content. With a single cell table it would be impossible for it /not/
to linearize correctly, so I don't see any obvious accessibility
issues with it.
date: Thu, 16 Apr 2009 19:56:56 +0100   author:   Stuart Millington

Re: Sick of complicated workarounds   
Message-ID: 
from dorayme contained the following:

>
>> I should have mentioned shrink to fit as a requirement
>
>In that case, maybe you might look at my pages at:
>
>http://netweaver.com.au/centring/
>
>and page 4 in particular.

Already done so, my musical friend.  You are a master of the
understatement.

"In nearly all modern browsers *except currently used Internet Explorer
versions*" (my emphasis).

I've tried telling my clients that their pages look wonderful in my
browser. As far as they are concerned, if it doesn't work in IE, it's
worthless.

And the Bootnic fix is what prompted  the subject line of this thread.

Sod it, I'm using a table.  
-- 
Geoff Berrow  0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011
http://slipperyhill.co.uk - http://4theweb.co.uk
date: Thu, 16 Apr 2009 20:38:33 +0100   author:   Geoff Berrow

Re: Sick of complicated workarounds   
Message-ID:  from Stuart
Millington contained the following:

>>Of course, a single celled table doesn't break any accessibility rules.
>>Or does it?
>
>The problem with tables is linearization of multiple cells and their
>content. With a single cell table it would be impossible for it /not/
>to linearize correctly, so I don't see any obvious accessibility
>issues with it.


Swot I thought.  It does seem the simplest way to overcome IE's
deficiencies.
-- 
Geoff Berrow  0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011
http://slipperyhill.co.uk - http://4theweb.co.uk
date: Thu, 16 Apr 2009 20:40:08 +0100   author:   Geoff Berrow

Re: Sick of complicated workarounds   
On Thu, 16 Apr 2009 20:38:33 +0100, Geoff Berrow put finger to
keyboard and typed:

>Message-ID: 
>from dorayme contained the following:
>
>>
>>> I should have mentioned shrink to fit as a requirement
>>
>>In that case, maybe you might look at my pages at:
>>
>>http://netweaver.com.au/centring/
>>
>>and page 4 in particular.
>
>Already done so, my musical friend.  You are a master of the
>understatement.
>
>"In nearly all modern browsers *except currently used Internet Explorer
>versions*" (my emphasis).

Actually, that should now be "except older, but still common, versions
of Internet Explorer". IE8 is as good as, if not better than, Firefox
and Chrome when it comes to standards-compliance - something which
will come back to haunt many a web author who has created non-standard
pages that "work in IE" without caring about how it looks in other
browsers, as now it will look wrong in IE too. So much so, in fact,
that IE8 comes with a "compatibility" button which can make it emulate
IE7 in order to view websites that were authored with IE7 in mind.

Mark
-- 
Blog: http://mark.goodge.co.uk
Stuff: http://www.good-stuff.co.uk
date: Thu, 16 Apr 2009 21:15:12 +0100   author:   Mark Goodge

Re: Sick of complicated workarounds   
Mark Goodge wrote:
<snip>
> 
> Actually, that should now be "except older, but still common, versions
> of Internet Explorer". IE8 is as good as, if not better than, Firefox
> and Chrome when it comes to standards-compliance - something which
> will come back to haunt many a web author who has created non-standard
> pages that "work in IE" without caring about how it looks in other
> browsers, as now it will look wrong in IE too. So much so, in fact,
> that IE8 comes with a "compatibility" button which can make it emulate
> IE7 in order to view websites that were authored with IE7 in mind.
> 

Is IE8 XP compatible though? If not how long will IE6 & 7 stick
around, how many will up-grade from XP to Windows7 when it's released
after getting fingers and data burnt by the first (none test) version
of Vista... It could be years before we can forget all about IE6&7! :~(

-- 
Wikipedia: the Internet equivalent of
Hyde Park and 'speakers corner'...
Sorry, mail to this address goes unread.
Please reply via group.
date: Thu, 16 Apr 2009 21:57:05 +0100   author:   Jerry LID

Re: Sick of complicated workarounds   
On Thu, 16 Apr 2009 21:57:05 +0100, Jerry put finger to keyboard and
typed:

>Mark Goodge wrote:
><snip>
>> 
>> Actually, that should now be "except older, but still common, versions
>> of Internet Explorer". IE8 is as good as, if not better than, Firefox
>> and Chrome when it comes to standards-compliance - something which
>> will come back to haunt many a web author who has created non-standard
>> pages that "work in IE" without caring about how it looks in other
>> browsers, as now it will look wrong in IE too. So much so, in fact,
>> that IE8 comes with a "compatibility" button which can make it emulate
>> IE7 in order to view websites that were authored with IE7 in mind.
>> 
>
>Is IE8 XP compatible though? 

Works fine on XP for me. 

>If not how long will IE6 & 7 stick
>around, how many will up-grade from XP to Windows7 when it's released
>after getting fingers and data burnt by the first (none test) version
>of Vista... It could be years before we can forget all about IE6&7! :~(

It probably will be quite some time, yes, before they're gone
completely. But it won't be long before the only people running them
are those who have disabled automatic updates. IE8 hasn't been pushed
out via automatic update yet, on either XP or Vista, but it's expected
to start the full automatic roll-out later this month. So we are now
very close to the point where the majority of browsers are fully
standards compliant (or, at lease, close enough that they can be
assumed to be under all but the most unusual circumstances), so it
will soon have to be the norm to write standards-compliant CSS and
HTML and only then, if necessary, apply tweaks to cater for the
minority of non-compliant browsers. And any web authors who have built
sites in the past that were designed specifically for IE, without
adhering to standards, now have only a short time left in which to fix
them before even Microsoft reveals them to be faulty.

Mark
-- 
Blog: http://mark.goodge.co.uk
Stuff: http://www.good-stuff.co.uk
date: Thu, 16 Apr 2009 22:24:31 +0100   author:   Mark Goodge

Re: Sick of complicated workarounds   
In uk.net.web.authoring message <heqcu4l5kaf96f98ofi39dp38q6j64ojf7@4ax.
com>, Thu, 16 Apr 2009 00:12:41, Geoff Berrow 
posted:
>Message-ID: <Af78kruIhj5JFwGn@invalid.uk.co.demon.merlyn.invalid> from
>Dr J R Stockton contained the following:
>
>>Essentially, CAN, defined in
>> <http://www.merlyn.demon.co.uk/styles-a.css>, reduces to
>> .CAN {
>>  border: 1px solid black; padding: 0.4ex;
>>  color: black; width: 42ex; background: #CCFFFF;
>>  margin: 1ex auto 1ex auto; text-align: center; }
>>which is more than you really need.
>
>I should have mentioned shrink to fit as a requirement

Then if you were to compare my site in a variety of browsers you would
no doubt notice that I also would like such a facility.

It would be nice to have a Form, with border/background, that adjusts
its width to suit its contents as effectively as it adjusts its height,
not bodged by a Table..

-- 
 (c) John Stockton, nr London UK. ?@merlyn.demon.co.uk  BP7, Delphi 3 & 2006.
 <URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/&c., FAQqy topics & links;
 <URL:http://www.bancoems.com/CompLangPascalDelphiMisc-MiniFAQ.htm> clpdmFAQ;
 NOT <URL:http://support.codegear.com/newsgroups/>: news:borland.* Guidelines
date: Thu, 16 Apr 2009 19:35:25 +0100   author:   Dr J R Stockton

Re: Sick of complicated workarounds   
In article ,
 Geoff Berrow  wrote:

> Message-ID: 
> from dorayme contained the following:
> 
> >
> >> I should have mentioned shrink to fit as a requirement
> >
> >In that case, maybe you might look at my pages at:
> >
> >http://netweaver.com.au/centring/
> >
> >and page 4 in particular.
> 
> Already done so, my musical friend.  You are a master of the
> understatement.
> 
> "In nearly all modern browsers *except currently used Internet Explorer
> versions*" (my emphasis).
> 
> I've tried telling my clients that their pages look wonderful in my
> browser. As far as they are concerned, if it doesn't work in IE, it's
> worthless.
> 
> And the Bootnic fix is what prompted  the subject line of this thread.
> 
> Sod it, I'm using a table.  

That is fine by me and I don't blame you one teensy weensy bit! You just 
tell me if anyone tries to attack you for using a table, I have spent 
years defending uses of tables for things against some fundamentalist 
types and have developed a whole range of very hurtful weaponry.

-- 
dorayme
date: Fri, 17 Apr 2009 09:35:13 +1000   author:   dorayme

Re: Sick of complicated workarounds   
In article ,
 Mark Goodge  wrote:
...
> >>http://netweaver.com.au/centring/
> >>
...
> >"In nearly all modern browsers *except currently used Internet Explorer
> >versions*" (my emphasis).
> 
> Actually, that should now be "except older, but still common, versions
> of Internet Explorer". IE8 is as good as, if not better than, Firefox
> and Chrome when it comes to standards-compliance - something which
> will come back to haunt many a web author who has created non-standard
> pages that "work in IE" without caring about how it looks in other
> browsers, as now it will look wrong in IE too. So much so, in fact,
> that IE8 comes with a "compatibility" button which can make it emulate
> IE7 in order to view websites that were authored with IE7 in mind.
> 

Yes, thanks, I will change it to be more accurate.

-- 
dorayme
date: Fri, 17 Apr 2009 09:37:05 +1000   author:   dorayme

Re: Sick of complicated workarounds   
On Thu, 16 Apr 2009 20:40:08 +0100, Geoff Berrow
 wrote:

>Swot I thought.  It does seem the simplest way to overcome IE's
>deficiencies.

Well, other than Nuking Redmond... which certain people, from Redmond,
may frown upon ;-)
date: Fri, 17 Apr 2009 00:48:31 +0100   author:   Stuart Millington

Re: Sick of complicated workarounds   
On Thu, 16 Apr 2009 20:38:33 +0100, Geoff Berrow
 wrote:

>"In nearly all modern browsers *except currently used Internet Explorer
>versions*" (my emphasis).
>
>I've tried telling my clients that their pages look wonderful in my
>browser. As far as they are concerned, if it doesn't work in IE, it's
>worthless.

As an aside, I did have a client last year who "commented", rather
than complained, that a site worked OK in IE7 but was "broken" in IE8
Beta 1... my reply was along the lines of "it's a beta mate, once it's
released we'll 'support' it" ;-)

IE8 could end a lot of problems or introduce a *LOT* more, if people
have coded stuff based on a "guess" of which IE version users are
using.

Personally, I'm now treating IE6 like IE5.x - i.e. it's dead. As long
as it's readable and useable, it doesn't matter if it looks different
or has a fixed width to get around its bugs. It doesn't like
alpha-transparency, so it gets a gif via conditional CSS, etc...
date: Fri, 17 Apr 2009 01:20:52 +0100   author:   Stuart Millington

Re: Sick of complicated workarounds   
On Fri, 17 Apr 2009 01:20:52 +0100, Stuart Millington put finger to
keyboard and typed:

>On Thu, 16 Apr 2009 20:38:33 +0100, Geoff Berrow
> wrote:
>
>>"In nearly all modern browsers *except currently used Internet Explorer
>>versions*" (my emphasis).
>>
>>I've tried telling my clients that their pages look wonderful in my
>>browser. As far as they are concerned, if it doesn't work in IE, it's
>>worthless.
>
>As an aside, I did have a client last year who "commented", rather
>than complained, that a site worked OK in IE7 but was "broken" in IE8
>Beta 1... my reply was along the lines of "it's a beta mate, once it's
>released we'll 'support' it" ;-)
>
>IE8 could end a lot of problems or introduce a *LOT* more, if people
>have coded stuff based on a "guess" of which IE version users are
>using.

All recent versions of IE support conditional HTML and conditional
CSS. So the simplest and most appropriate way of dealing with IE's CSS
rendering bugs is to code for compliance, and then use conditional
HTML to insert additional CSS that will only be seen by IE in order to
make IE render the page correctly.

If you're doing it that way, then IE8 isn't a problem. You still code
for compliance as the default, but instead of simply testing for any
version of IE in order to insert the additional CSS you just change it
to testing for IE<=7.  

If you want to go a bit further, you could add additional options for
IE<=6 and IE<=5, but I'm of the opinion that that's just a waste of
time - there are few significant differences in rendering between IE6
and IE7, and anyone using IE5 or earlier must surely be used to the
fact that all websites look crap.

Mark
-- 
Blog: http://mark.goodge.co.uk
Stuff: http://www.good-stuff.co.uk
date: Fri, 17 Apr 2009 08:25:55 +0100   author:   Mark Goodge

Re: Sick of complicated workarounds   
Stuart Millington wrote:
<snip>
> 
> Personally, I'm now treating IE6 like IE5.x - i.e. it's dead. 

IE6 is far from dead, MS had to admit that they got many things wrong 
in IE7 and thus many have *not* 'up-graded' to version 7 - in fact 
many people seem to considered that (as far as usability is concerned, 
which is what /most/ people judge software on) IE7 was actually a 
down-grade!

-- 
Wikipedia: the Internet equivalent of
Hyde Park and 'speakers corner'...
Sorry, mail to this address goes unread.
Please reply via group.
date: Fri, 17 Apr 2009 08:40:41 +0100   author:   Jerry LID

Re: Sick of complicated workarounds   
Message-ID: 
from Mark Goodge contained the following:

>And any web authors who have built
>sites in the past that were designed specifically for IE, without
>adhering to standards, now have only a short time left in which to fix
>them before even Microsoft reveals them to be faulty.

Came across a beauty last night...


http://icsb.bnbsoft.co.kr/reg/reg.html

"System Requirements
Operating System - Microsoft® Windows® 2000 or Microsoft® Windows® XP or
Microsoft® Windows® VISTA
Browser - Microsoft® Internet Explorer version 6.0 or later must be
installed on your computer,
though it does not need to be your default browser.
(If you do not have Microsoft® Internet Explorer, you can download it
here.) "
-- 
Geoff Berrow  0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011
http://slipperyhill.co.uk - http://4theweb.co.uk
date: Fri, 17 Apr 2009 09:25:46 +0100   author:   Geoff Berrow

Re: Sick of complicated workarounds   
In article ,
 Mark Goodge  wrote:

> All recent versions of IE support conditional HTML and conditional
> CSS. So the simplest and most appropriate way of dealing with IE's CSS
> rendering bugs is to code for compliance, and then use conditional
> HTML to insert additional CSS that will only be seen by IE in order to
> make IE render the page correctly.

Very sensible too. <g>

What is conditional CSS? Do you mean the HTML star hack? Or really HTML 
conditionals where you can make IE feast its beady eyes on a particular 
stylesheet that is invisible to other compliant browsers?

-- 
dorayme
date: Fri, 17 Apr 2009 18:42:18 +1000   author:   dorayme

Re: Sick of complicated workarounds   
Message-ID: 
from Mark Goodge contained the following:

>>"In nearly all modern browsers *except currently used Internet Explorer
>>versions*" (my emphasis).
>
>Actually, that should now be "except older, but still common, versions
>of Internet Explorer". IE8 is as good as, if not better than, Firefox
>and Chrome when it comes to standards-compliance - something which
>will come back to haunt many a web author who has created non-standard
>pages that "work in IE" without caring about how it looks in other
>browsers, as now it will look wrong in IE too. So much so, in fact,
>that IE8 comes with a "compatibility" button which can make it emulate
>IE7 in order to view websites that were authored with IE7 in mind.

It's not as if complying to standards were rocket science, why has it
taken MS until version 8 of their software to finally achieve it!

I hope it does as you say.  The industry desperately needs all browsers
to perform reliably and render the code consistently.

However, I still think that css design is and will continue to be a huge
headache for many amateur designers (compared with the ease of use of
the layout tables). I know that if I want to do something quick and
dirty that will work reliably in all browsers, I'll use tables (keeping
linearisation in mind, obviously).  Issues like centering and minimum
height have made the alternative far too complex.  Hopefully that will
change soon.

-- 
Geoff Berrow  0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011
http://slipperyhill.co.uk - http://4theweb.co.uk
date: Fri, 17 Apr 2009 09:58:36 +0100   author:   Geoff Berrow

Re: Sick of complicated workarounds   
On Fri, 17 Apr 2009 09:58:36 +0100, Geoff Berrow put finger to
keyboard and typed:

>Message-ID: 
>from Mark Goodge contained the following:
>
>>>"In nearly all modern browsers *except currently used Internet Explorer
>>>versions*" (my emphasis).
>>
>>Actually, that should now be "except older, but still common, versions
>>of Internet Explorer". IE8 is as good as, if not better than, Firefox
>>and Chrome when it comes to standards-compliance - something which
>>will come back to haunt many a web author who has created non-standard
>>pages that "work in IE" without caring about how it looks in other
>>browsers, as now it will look wrong in IE too. So much so, in fact,
>>that IE8 comes with a "compatibility" button which can make it emulate
>>IE7 in order to view websites that were authored with IE7 in mind.
>
>It's not as if complying to standards were rocket science, why has it
>taken MS until version 8 of their software to finally achieve it!

Lack of will, rather than lack of ability. Earlier versions of IE
suffered from the arrogance of programmers who thought that standards
compliance simply wasn't necessary. It took the growing popularity of
competing browsers to change that mindset.

Mark
-- 
Blog: http://mark.goodge.co.uk
Stuff: http://www.good-stuff.co.uk
date: Fri, 17 Apr 2009 12:32:46 +0100   author:   Mark Goodge

Re: Sick of complicated workarounds   
On Fri, 17 Apr 2009 18:42:18 +1000, dorayme put finger to keyboard and
typed:

>In article ,
> Mark Goodge  wrote:
>
>> All recent versions of IE support conditional HTML and conditional
>> CSS. So the simplest and most appropriate way of dealing with IE's CSS
>> rendering bugs is to code for compliance, and then use conditional
>> HTML to insert additional CSS that will only be seen by IE in order to
>> make IE render the page correctly.
>
>Very sensible too. <g>
>
>What is conditional CSS? Do you mean the HTML star hack? Or really HTML 
>conditionals where you can make IE feast its beady eyes on a particular 
>stylesheet that is invisible to other compliant browsers?

The latter. IE supports a proprietory extension to HTML comments which
allow it to do basic client-side if/else conditions. So, for example,
to include conditional CSS in a page, you'd do something like this:

  <style type="text/css">@import "/css/standard.css";</style> 
  <!--[IF lte IE 7]>
  <style type="text/css">@import "/css/numptie.css";</style>
  <![ENDIF]--> 

To every other browser, the second line is simply a comment start and
the fourth line is a comment end, so the third line (the alternate
stylsheet) will never be read. IE, and only IE, parses the stuff
inside the square brackets in the comment tags and treats it as a
control statement. So, in this case, IE will also import the second
stylesheet, which contains IE-only versions of declarations in the
first. Since CSS is read sequentially, and later declarations of the
same class override earlier ones, IE will use those in its own
stylesheet where they override identically named declarations in the
main stylesheet. Other browsers will only use those in the main
stylesheet as they'll never import the second at all.

Mark 
-- 
Blog: http://mark.goodge.co.uk
Stuff: http://www.good-stuff.co.uk
date: Fri, 17 Apr 2009 12:44:40 +0100   author:   Mark Goodge

Re: Sick of complicated workarounds   
In uk.net.web.authoring message <bo7fu41nditcibf0lk1hmkdghuj0nstd4p@news
.markshouse.net>, Thu, 16 Apr 2009 22:24:31, Mark Goodge
 posted:

> IE8 hasn't been pushed
>out via automatic update yet, on either XP or Vista, but it's expected
>to start the full automatic roll-out later this month. So we are now
>very close to the point where the majority of browsers are fully
>standards compliant

Has   new Date().getYear()   been fixed to agree with Firefox, Safari,
Chrome, earlier Opera, non-normative ECMA 262 Ed 3  & Draft Ed 5 Annexes
B.2.4?


See
<URL:http://www.merlyn.demon.co.uk/js-datex.htm#AT>,
<URL:http://www.ecma-international.org/publications/files/drafts/tc39-2009-025.pdf>
 - April 2009, 3.38 MB PDF

-- 
 (c) John Stockton, nr London, UK.    ?@merlyn.demon.co.uk     Turnpike v6.05.
 Web  <URL:http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms
 PAS EXE etc : <URL:http://www.merlyn.demon.co.uk/programs/> - see 00index.htm
 Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm etc.
date: Fri, 17 Apr 2009 13:46:40 +0100   author:   Dr J R Stockton

Re: Sick of complicated workarounds   
On Fri, 17 Apr 2009 08:25:55 +0100, Mark Goodge
 wrote:
>On Fri, 17 Apr 2009 01:20:52 +0100, Stuart Millington put finger to
>keyboard and typed:

>>IE8 could end a lot of problems or introduce a *LOT* more, if people
>>have coded stuff based on a "guess" of which IE version users are
>>using.
>
>All recent versions of IE support conditional HTML and conditional
>CSS. So the simplest and most appropriate way of dealing with IE's CSS

Indeed. By "guess" I was referring to those who use J(ava)script or
user agent strings to "guess" what the browser is.

>If you want to go a bit further, you could add additional options for
>IE<=6 and IE<=5, but I'm of the opinion that that's just a waste of

I do use conditional CSS to "assist" IE7 and IE6 where necessary.

However, for IE6, I only get it to a "make it work" stage. If it looks
a little different to IE7 and web browsers, that's fine.
Unfortunately, there are still too many people using it to drop
support completely.
date: Fri, 17 Apr 2009 19:43:25 +0100   author:   Stuart Millington

Re: Sick of complicated workarounds   
On Fri, 17 Apr 2009 09:58:36 +0100, Geoff Berrow 
wrote in :

>However, I still think that css design is and will continue to be a huge
>headache for many amateur designers (compared with the ease of use of
>the layout tables). I know that if I want to do something quick and
>dirty that will work reliably in all browsers, I'll use tables (keeping
>linearisation in mind, obviously).  Issues like centering and minimum
>height have made the alternative far too complex.  Hopefully that will
>change soon.

I don't expect it to be soon but CSS Template Layout is probably what
will make the difference eventually.

http://www.w3.org/Style/CSS/current-work#layout

That assumes that the work is completed and the browser implementers
adopt it.

-- 
Owen Rees
[one of] my preferred email address[es] and more stuff can be
found at <http://www.users.waitrose.com/~owenrees/index.html>
date: Fri, 17 Apr 2009 20:05:12 +0100   author:   Owen Rees

Google
 
Web myreader.co.uk


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us