Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-03-09 19:05:18

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

selector support in WIN IE

I can do the following and it seems to work nicely in FF. Use…

.classOne.classTwo{attribute:property}

…to target this…

<div class="classOne classTwo">

…but neither of these…

<div class="classOne"> or <div class="classTwo">

…but this doesn’t seem to work in Win IEs.

Anyone got any experience with this? Is this approach even valid?

Last edited by mrdale (2007-03-09 19:05:59)

Offline

#2 2007-03-09 20:25:37

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: selector support in WIN IE

It’s valid according to the Spec granted that means nothing regarding IE.


Shoving is the answer – pusher robot

Offline

#3 2007-03-09 20:38:14

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: selector support in WIN IE

So does anyone else use this technique?

If this can work in WIN IEs it would make styling different sections and categories uniquely (where needed) a snap… by including section and category calls in your article forms and page templates.

for example…

<div class="story <txp:section/> <txp:category>">

then you can select uniquely with

.story.default{attribute:property}
.story.contact{attribute:differentProperty}

All kindsa krazy kontrol.

Offline

#4 2007-03-09 21:38:37

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: selector support in WIN IE

Is this something that you would use for an archive type page with various div.story from different sections and categories in it or as a template switcher of sorts?

Not sure if I’m making sense


Shoving is the answer – pusher robot

Offline

#5 2007-03-09 22:05:42

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: selector support in WIN IE

>hakjoon

Is this something that you would use for an archive type page with various div.story from different sections and categories in it or as a template switcher of sorts?

Well, I use it so I can feed different attributes to the same div in different sections… for example…

gallery page => <div id="content" class="gallery"> => full width div
standard page => <div id="content" class="default"> => 2/3 width div, padding x, margin y
fullsize calendar page => <div id="content" class="calendar"> => full width div, padding y

Probably better ways to do this. Just gives you more options…

Offline

#6 2007-03-09 22:46:45

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: selector support in WIN IE

I do something similar.

I was ending up with div#section.category although IE doesn’t like that very much either.

What I do now is place the section one element up. For example I tend to always have a #wrapper div around content and sidebar divs so I apply the section to that those.

so I end up with

#wrapper #content {
  default formatting;
}

#wrapper.section #content {
 section specific
}

#wrapper.section #content.category {
 section specific and category specific
}

needs extra markup though. But I tend to always have it in there anyway. Conversely you can apply the section to the body which I have done a bunch too. In fact it ends up very clean.

#content {
default
}

body.section #content {
 section format
}

#content.category {
 category format
}

body.section #content.category {
section + category format
}

the higher specificity of the last rule will overrid previous ones. This is what I love about CSS. There are like 100 ways to do something. And I hadn’t even considered what you wanted to do which is also awesome. I found I use body classes a lot because they always allow you to be more specific and override other previous rules.


Shoving is the answer – pusher robot

Offline

#7 2007-03-09 22:53:12

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: selector support in WIN IE

>hak

…So you do a <body class="<txp:section/>">

Now that’s way more smart

Offline

#8 2007-03-09 22:56:19

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: selector support in WIN IE


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#9 2007-03-09 23:28:02

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: selector support in WIN IE

>maniqui wrote

IE6 doesn’t accept multiple classes in CSS.

WTF was MS thinking? Is there any rationale behind all the flaws in their products? It can’t simply be shoddy work, can it.

Offline

Board footer

Powered by FluxBB