Adapting overrides for use in S2 (advanced version)

Jun 16, 2005 10:07

So I've been evangelizing S2 around lots of layout communities, and been doing quite a bit of helping people to convert their S1 styles to S2. I've turned up a couple of quirks that might be of interest, and I'm also curious to know why these things work the way they do, if anyone can tell me.

S2 CSS quirks )

Leave a comment

Comments 10

kunzite1 June 16 2005, 16:20:58 UTC
you can't use HTML comments in print_custom_head() but you can use css comments:

/* css comment */

Reply


cmshaw June 16 2005, 18:48:27 UTC
S2 doesn't, in the core defaults, add a DOCTYPE, but it may be that the styles you're overriding do. I know IE's behavior changes quite radically on some container issues depending on whether it is being forced into standards compliance or not.

One way to test that might be to comparing the sources of the pages produced in S1 and S2 -- I know I did a lot of work on widelines by copying the produced pages onto my desktop and tweaking the layout there, then backtracking to the actual style definition. Certainly it's faster than recompiling every time! I would definitely suggest fiddling with the DOCTYPE lines and seeing if that's the source of the different behavior.

Reply


phoenixdreaming June 17 2005, 17:31:20 UTC
Generator S1 and S2, at least, have different DOCTYPEs. ( is S2 Generator's. is S1's. I'm hazy on this, but I think that the S1 doctype is incomplete and puts IE into Quirks mode.)

Comments: are HTML comments, which are stripped from S2 layers. CSS comments are /* like those surrounding this text */ and which aren't stripped.

I only knew about a couple of these differences before this post, so I'm really glad you posted about them.

Reply

asciident June 18 2005, 20:53:44 UTC
... Why is S2 Generator using "HTML 4.01 Trans" and then linking to the Loose DTD? O_o; That's a pretty big bug.

Reply

asciident June 18 2005, 20:54:32 UTC
Oh, nevermind, I forgot that HTML (and not XHTML) is Weird and calls its trans with the "loose" DTD. Heh.

Reply

quezzie February 6 2006, 22:49:34 UTC
Is there a way to get around stripping the HTML comments, so they appear in the source of the page?

Reply


carriep63 June 18 2005, 16:09:17 UTC
I only use two different browsers (firefox and IE), so I'm not sure how cross-platform this hack really is, but intstead of using the child selector, I use the !important attribute in my overrides. Firefox will read the !important line, IE will always read the last line of code. For example:

.entries{
width: 400px !important;
width: 500px;
}

Perhaps that will help?

Reply

jaded220 March 28 2006, 02:37:01 UTC
Does the !important attribute work with s2? I'm using overrides that I've converted from s1 to s2 and it looks fine in IE but some parts are screwy when I view it with Firefox

Reply

carriep63 March 28 2006, 02:40:40 UTC
I don't see why not. I've done it before with S2. What are you having issues with specifically? I have noticed that when I code with S2 I don't usually have many cross browser issues.

Reply

jaded220 March 28 2006, 02:43:13 UTC
I'm having issues in Firefox with the background colour of the entries and the border around entries, its meant to be white with the darker pink border to match the sidebar. It's working fine in IE though. Also the font for the subject line isn't working in FF. This is the first time I've ever used s2 so I really have no idea what I'm doing.

Reply


Leave a comment

Up