> You can, according to this link, embed a stylesheet within an XML document.
> http://www.w3.org/Style/styling-XML.html#Embedded
This article seems to be discussing embedded stylesheets which look
like this: <style>tab { left: 50px; }</style>
I have to add support for inline styles like this one: <tab
style="left: 50px"></tab>
> I recommend using an external stylesheets for a more efficiency and
> cleaner document.
I would disagree here. In many cases inline styles are more suitable.
For example in order to implement draggable tabs I have to update CSS
values for "left" and "top" of the currently active tab every time
when mousemove event fires:
- With inline styles this is very easy to do:
tabElement.addEventListener('mousemove', function(event) {
myTabElement.setAttribute('style', 'left: ' + positionX + '; top:' +
positionY);
}
- It's impossible with static external stylesheets
- It would be tricky to do with embedded dynamic stylesheet because in
order to apply a style to specified element I would have to know the
correct CSS selector. I have many tabs in the same document, targeting
the correct one would require some additional logic.
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/[email protected]/
To search via a non-Google archive, visit here:
http://www.mail-archive.com/[email protected]/
To unsubscribe from this group, send email to
[email protected]