473,382 Members | 1,396 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

applying CSS styles to xml elements via class attribute

My server-side php script is generating an xml response with the
following structure:

<thread class='Columns'>
<Id class='Column dataDetail'>12345</Id>
<Command class='Column dataDetail'>SET</Command>
..
..
..
</thread>

I have CSS styles defined for Columns, Column, and dataDetail like
so...

..Columns {overflow: auto; width: 100%; font-size: smaller}
..Column {position: relative; float: left; width: 100px; height: 20px;}
..dataDetail { border-top: 1px solid #c0dfc5; font-size: smaller}

But these styles don't apply to the thread element and its children
even though they have the class attribute. Do CSS class-specific
selectors only apply to HTML elements? If I replace the xml element
names with 'div' the CSS styles apply correctly.

How can I make the CSS apply to XML elements with class atributes?

Thanks.

Jan 25 '06 #1
2 1833
lu*********@gmail.com wrote:
<thread class='Columns'> I have CSS styles defined for Columns, Column, and dataDetail like
so...

.Columns {overflow: auto; width: 100%; font-size: smaller}


The CSS class selector is a bit of magic that *only* applies to HTML
documents[1]. Use the attribute selector instead.

[class=Columns] { ... }
[1] So not to generic XML documents, and not to XHTML[2] documents
[2] XHTML documents served as text/html are not XHTML, they are broken HTML
(confused? Yes. XHTML is silly).

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jan 26 '06 #2
On 26/01/2006 00:00, David Dorward wrote:

[snip]
[class=Columns] { ... }


[class~=Columns] { ... }

would more closely match the behaviour of class selectors with HTML.

[snip]

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
Jan 26 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jaz | last post by:
Is there a reason why IE wont apply styles on table cells? Either I shouldn't do this, I've got an error somewhere, or IE has a bug or doesn't support it. (Opera and Moz render okay) Since I've...
1
by: Steve Pugh | last post by:
I have some styles which IE (Win - tested in 5, 5.5 and 6) is only applying to the first letter of the element. Basic stuff like font-weight and font-size applied to a <p> or <hx> element via...
12
by: dan.vendel | last post by:
Hi, I know nothing about javascript, but quite a lot about regulat html and CSS. Have bumped into a problem that people in this fine congregation perhaps can help me with. I'm making a...
2
by: acko bogicevic | last post by:
Hi How can i make my styles work on HyperLink web server control. I want it to be some color when the mouse is over it... Thanks. Alex *** Sent via Developersdex http://www.developersdex.com...
7
by: sasquatch | last post by:
Hi, I've a a site with nested master pages and content pages. I tried using a theme with a stylesheet in the app_themes directory referencing it in the web.config file from a pages tag theme...
29
by: Richard Lionheart | last post by:
Hi All, I've taken the advice of a few people and managed to cobble together an HTML 4.01 Strict-compliant document (according to the W3C Validation Service), but the way I try to pass a...
3
by: Bob | last post by:
Hi, i'm testing the order of application when it comes to styling with skin and CSS files and i come to contradiction between what i get and what i read about theme and CSS. I wrote that...
2
by: shapper | last post by:
Hello, I have the following: <div class="Body"> <div class="Content"> <h2>First Header</h2> <div class="Post"> <h2>Second Header</h2> </div>
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.