473,466 Members | 1,363 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

DOMming for stylesheet properties

Hi there javascript fiends

If you had to return all 'font-size'-properties from a stylesheet, how
would you do it?

Or in more generic fashion, what kind of solution would you code for
fetching all instances of a particular property in a stylesheet?

I'm thinking one has to iterate through the document.style tree, and if a
property is found, its added into a result-array...
Jul 23 '05 #1
3 1137
DU
Jam Pa wrote:
Hi there javascript fiends

If you had to return all 'font-size'-properties from a stylesheet, how
would you do it?

Or in more generic fashion, what kind of solution would you code for
fetching all instances of a particular property in a stylesheet?

This could be done with DOM 2 CSS methods.
I'm thinking one has to iterate through the document.style tree, and if a
property is found, its added into a result-array...


What exactly are you trying to achieve? If you want to dynamically
modify the font-size of a document, then best is to just use relative
font-size in your document and let the user use the already available
command of his browser.

W3C Quality Assurance tip for webmaster:
Care With Font Size
"Do not specify the font-size in pt, or other absolute length units.
They render inconsistently across platforms and can't be resized by the
User Agent (e.g browser).
Use relative length units such as percent or (better) em"
http://www.w3.org/QA/Tips/font-size#goodpractice

DU
--
The site said to use Internet Explorer 5 or better... so I switched to
Firefox 1.0.4 :)
Jul 23 '05 #2
DU <dr*******@hotNOSPAMmail.com> wrote in
news:3g************@uni-berlin.de:
This could be done with DOM 2 CSS methods.
Really?!?!? WOW!! Good job, Einstein!
What exactly are you trying to achieve?
I wrote that in the first post. Quoted below:
If you had to return all 'font-size'-properties from a stylesheet, how
would you do it?
Or in more generic fashion, what kind of solution would you code for
fetching all instances of a particular property in a stylesheet?


Now, does anyone actually have ideas or experience to share on this?
W3C Quality Assurance tip for webmaster:
Care With Font Size
"Do not specify the font-size in pt, or other absolute length units.
They render inconsistently across platforms and can't be resized by
the User Agent (e.g browser).
Use relative length units such as percent or (better) em"
http://www.w3.org/QA/Tips/font-size#goodpractice


ANY decent coder or webdesigner knows NOT to follow that rule as 'em' or
percents will F*CK UP your layout bigtime so that you cannot create 'cross
browser consistent' layouts. Now how about you go preach someplace else and
reply *only* if you have something to reply on the topic of this thread.
Danke.
Jul 23 '05 #3
Jam Pa wrote:
DU <dr*******@hotNOSPAMmail.com> wrote in
news:3g************@uni-berlin.de:
This could be done with DOM 2 CSS methods.

Really?!?!? WOW!! Good job, Einstein!


You are about 100 years off the mark.
What exactly are you trying to achieve?

I wrote that in the first post. Quoted below:


But you failed to explain what your end results/intentions were. To
phrase it gently for you, your question was too generic.
If you had to return all 'font-size'-properties from a stylesheet, how
would you do it?
Or in more generic fashion, what kind of solution would you code for
fetching all instances of a particular property in a stylesheet?


Now, does anyone actually have ideas or experience to share on this?


Yes, and you got some good advice that you chose to ignore. Since you
ignored it and attempted to flame it, I will keep my advice to myself
also. I actually have experience doing something close to what you
vaguely described. Maybe if you repost your question not so vaguely you
might get an answer.
W3C Quality Assurance tip for webmaster:
Care With Font Size
"Do not specify the font-size in pt, or other absolute length units.
They render inconsistently across platforms and can't be resized by
the User Agent (e.g browser).
Use relative length units such as percent or (better) em"
http://www.w3.org/QA/Tips/font-size#goodpractice

ANY decent coder or webdesigner knows NOT to follow that rule as 'em' or
percents will F*CK UP your layout bigtime so that you cannot create 'cross
browser consistent' layouts.


Oh humpty dumpty bullshit. Wait, the decent ones might not follow that
rule. But the really good ones always do. So, I guess you are right on
that one.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?
Jul 23 '05 #4

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

Similar topics

2
by: wjbell | last post by:
I have a piece of javascript I need to modify. Right now it changes a stylesheet in the document between style.css and no_indent.css. These are in the head of my document: <link rel=stylesheet...
0
by: Catherine Lynn Wood | last post by:
I have a page that I just developed using a combination of stylesheets and div layers. It uses a 'tab' style system placing four div layers in the same space with visibility 'hidden' and position...
2
by: Jan Roland Eriksson | last post by:
Archive-name: www/stylesheets/authoring-faq Posting-Frequency: twice a week (Mondays and Thursdays) Last-modified: August 28, 2002 Version: 1.15 URL: http://css.nu/faq/ciwas-aFAQ.html...
0
by: Jan Roland Eriksson | last post by:
Archive-name: www/stylesheets/authoring-faq Posting-Frequency: twice a week (Mondays and Thursdays) Last-modified: April 10, 2003 Version: 1.16 URL: http://css.nu/faq/ciwas-aFAQ.html Maintainer:...
2
by: Praveen | last post by:
Hi, Is there a way to copy over a table's properties and styles (NOT it's child elements like tbody, trs, etc) into another table, besides doing them manually, one by one? Thanks Praveen
1
by: Christophe Peillet | last post by:
I have a CompositeControl with two types of properties: 1.) Mapped Properties that map directly to a child control's properties (ex.: this.TextboxText = m_txt.Text). These properties are handled...
3
by: rkhurana | last post by:
Hi I am writing a JSF application that uses some third party charts. While I can see the chart but the javascript that is supposed to calla function to update chart periodically has a problem. It...
3
by: J055 | last post by:
Hi I want to add some css rules to the this.Header.StyleSheet property. I need to add margin and some other css properties but the Style class doesn't support them. What is the best way or some...
6
by: chengiz | last post by:
I have a situation where the css is coming from an external template and I only have control after it has done its thing. One of the things it does is set text-align of all html table fields (td,...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.