Re: [css-d] Combining :only-of-type with :before?
Den 6. mar. 2010 kl. 08.09 skrev Philippe Wittenbergh: On Mar 6, 2010, at 12:04 AM, Sjur Moshagen wrote: The other thing i missed was the need to use double colons, like ::before - I tried only ':before'. What's the reason? When used directly with an element only a single colon (like :before) is needed. CSS2.1 vs CSS3 notation as Tim pointed out. Thanks to both you and Tim for taking the time to explain. Best regards, Sjur Moshagen __ css-discuss [cs...@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
[css-d] Combining :only-of-type with :before?
Hello, I'm trying to style XML with CSS. I have successfully used the :only-of-type pseudo-class to let single instances of an element become inline, and multiple instances of the same be block elements. What I am NOT able to do is to combine this pseudo-class with the :before pseudo-class. What I want to achieve is: * multiple children of the same type should be displayed as a numbered list * lone children of the above type should be displayed as inline text, *without* any numbering Since i'm not able to combine the :before element with any variant of pseudo selectors that would differentiate between the two cases, I'm not able to remove the numbering from the single child case (or add it only to the multiple children case). The present state can be seen at: https://victorio.uit.no/langtech/trunk/words/dicts/nobfkv/src/adv_nobfkv.xml (NB. self-signed certificate) The present setup works in Safari 4, Opera 10.10, and Firefox 3.5 (all Mac). I have no intention to support older browsers beyond reasonable degradation. Any suggestion for how I could achieve what I want would be very much apprechiated. Best regards, Sjur N. Moshagen __ css-discuss [cs...@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] Combining :only-of-type with :before?
Den 5. mar. 2010 kl. 15.52 skrev Philippe Wittenbergh: What I want to achieve is: * multiple children of the same type should be displayed as a numbered list * lone children of the above type should be displayed as inline text, *without* any numbering Since i'm not able to combine the :before element with any variant of pseudo selectors that would differentiate between the two cases, I'm not able to remove the numbering from the single child case (or add it only to the multiple children case). The present state can be seen at: https://victorio.uit.no/langtech/trunk/words/dicts/nobfkv/src/adv_nobfkv.xml E:only-of-type::before {content: none; content:''; } should work correctly. Thanks a lot! That made it:) In Safari 4,Chrome 4, Opera 10.5, Gecko 1.9.2. Forget about IE, it doesn't understand 'only-of-type'. That's ok. I don't think working with counters() would produce different results. testcase: http://dev.l-c-n.com/_temp/only-of-type-cssD220305.html Thanks, I didn't find that one. note: neither WebKit nor Opera support 'content: none', hence the double declaration. Ok, that one put me off - didn't know about that. The other thing i missed was the need to use double colons, like ::before - I tried only ':before'. What's the reason? When used directly with an element only a single colon (like :before) is needed. otherwise you could also do E:not(only-of-type)::before {content:'something'} I tried variants of that as well, but again missed out on the double colon :: part. I don't have time to wade through your whole stylesheet / page. A simplified test case please ? I will try to simplify it next time. Thanks a lot for your help! Best regards, Sjur N. Moshagen __ css-discuss [cs...@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
[css-d] Unwanted spacing in front of inline generated content
Hello, I'm new to the list, so please bear with me:) I'm trying to style a set of XML source files (served directly off a Subversion repository) using only CSS. The XML is a quite simple dictionary structure, and to make the presentation of the content more dictionary-like, I have added some generated content, like comma+space in front of the non-first sibling, to separate two independent translations, or semicolon+space to separate groups of related translations. The problem is that in this case there is an extra space - not a space character, but some sort of space - in front of the generated content. This can be seen in the first entry on this page: https://victorio.uit.no/langtech/trunk/words/dicts/nobfkv/src/adv_nobfkv.xml If you look at the translation of the first head word (akkurat), there is some (unwanted) space in front of the ';' separating the two translations. I have tried to find the source of that space, but I have not succeeded. I have checked all possible properties using WebInspector in Safari as well as Firebug in Firefox, but I can find nothing. All margins, paddings, etc are zero as far as I can see, and there is no space character inserted as part of the content: rule (the space is added *after* the ';'). The extra space is only seen when the generated content is inserted between siblings of the same type. When inserting in other structural relations, there is no problem. In some cases the space seems to belong to the first element (ie, as some sort of padding in front of the generated content belonging to the following element), in other cases it seems to be some sort of right-padding of the generated content, or sit unspecified between two elements. The only thing I can think of is some sort of magic with generated content, but I have not been able to find anything Googling the Net. I have tested this on the Mac, using Safari 4 and Firefox 3.5.1. Both behave the same. Any help would be greatly appreciated. Best regards, Sjur Moshagen __ css-discuss [cs...@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] Unwanted spacing in front of inline generated content
Den 4. mar. 2010 kl. 13.08 skrev david: Sjur Moshagen wrote: Hello, I'm new to the list, so please bear with me:) I'm trying to style a set of XML source files (served directly off a Subversion repository) using only CSS. The XML is a quite simple dictionary structure, and to make the presentation of the content more dictionary-like, I have added some generated content, like comma+space in front of the non-first sibling, to separate two independent translations, or semicolon+space to separate groups of related translations. The problem is that in this case there is an extra space - not a space character, but some sort of space - in front of the generated content. This can be seen in the first entry on this page: https://victorio.uit.no/langtech/trunk/words/dicts/nobfkv/src/adv_nobfkv.xml Hmmm, Konqueror gives me a message saying: The server certificate failed the authenticity test (victorio.uit.no). Firefox essentially reports the same. Ah, yes, it is a self-signed certificate. If it is ok for you, accept it, and you will get the page. The page is directly off our Subversion repository, which is read-only for the outside world. There is no malware there to our knowledge. Best regards, Sjur __ css-discuss [cs...@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] Unwanted spacing in front of inline generated content
Den 4. mar. 2010 kl. 14.57 skrev Philippe Wittenbergh: So I took the risk... Now my goldfish is jumping madly around... :) If I understood correctly, you are talking about a space before the second tg shown below tg t pos=xjusthiin/t /tg tg t pos=xjuuri/t /tg (Set a border on each tg to visualise.) Is the markup generated as above with all line-breaks between elements (that is how my browser sees the page)? Yes. Then the explanation is easy: the tg elements are set to 'display:inline', white-space etc in the source code affect the spacing between individual elements. Thanks, I didn't know. Maybe tg + tg {display: inline; margin-left: -.1em} ? Thats it, thanks a lot! Best regards, Sjur Moshagen __ css-discuss [cs...@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/