473,387 Members | 1,303 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,387 software developers and data experts.

[CSS|JS] questions

>> Why is it that sometimes you must use inline styles? (I have tried
doing it in may different ways)

Do a google search on "css specficity", but that's outside the scope of this group.
Matt Kruse wrote:
css specificity ...

I wonder to which extent I could have conflicting CSS rules, since in
my trials I used both classes and id selectors and found the same
behavior. Also I post here in this group too, because JS and CSS do not
always play well together when you dynamically play setting/(re)-/(un)-
CSS properties with JS
..
Here are the two examples, one with inline styles and the other with a
CSS.
..
// __ this one works!
http://www.geocities.com/tekmonk2005...02_inline.html
..
// __ this other one, based on CSS-based styles, does NOT!
http://www.geocities.com/tekmonk2005/example04_css.html
..
Both pages validated (except for the unfinished form, which I complete
dynamically and whose "action" you don't really need in this case)
..
I need to understand this prob and fix it because I don't see any
benefit in using inline styles
..
Also:
..
How can you work around the "end tag for "..." which is not finished."
types of errors?
..
The form element I need only in order to format the pop up and to use
the id selector, in order to feed it in with. I need to complete the
forms dynamically because I work on multilang sites
..
Also there are ways to dynamically insert elements in a select box via
"new Option(...)". How can you do the same thing with radio button or
check boxes options in a form?
..
otf js css

Apr 30 '06 #1
3 1181
onetitfemme said the following on 4/30/2006 2:20 PM:
Why is it that sometimes you must use inline styles? (I have tried
doing it in may different ways) Do a google search on "css specficity", but that's outside the scope of this group.
Matt Kruse wrote:
css specificity ...

I wonder to which extent I could have conflicting CSS rules, since in
my trials I used both classes and id selectors and found the same
behavior. Also I post here in this group too, because JS and CSS do not
always play well together when you dynamically play setting/(re)-/(un)-
CSS properties with JS
..
Here are the two examples, one with inline styles and the other with a
CSS.
..
// __ this one works!
http://www.geocities.com/tekmonk2005...02_inline.html
..
// __ this other one, based on CSS-based styles, does NOT!
http://www.geocities.com/tekmonk2005/example04_css.html
..
Both pages validated (except for the unfinished form, which I complete
dynamically and whose "action" you don't really need in this case)


If you complete it dynamically then completely create it dynamically.
But, you shouldn't say it validated, you should say "It validated before
I put it on Geocities".
..
I need to understand this prob and fix it because I don't see any
benefit in using inline styles
Then don't if you don't understand them.
Also:
..
How can you work around the "end tag for "..." which is not finished."
types of errors?
End the tag, no more "end tag...." errors.
The form element I need only in order to format the pop up and to use
the id selector, in order to feed it in with. I need to complete the
forms dynamically because I work on multilang sites
Then create the form dynamically as well.

myForm = document.createElement('form')
..
Also there are ways to dynamically insert elements in a select box via
"new Option(...)". How can you do the same thing with radio button or
check boxes options in a form?


radioInput = document.createElement('input')
radioInput.type = "radio"

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Apr 30 '06 #2
> > The form element I need only in order to format the pop up and to use
the id selector, in order to feed it in with. I need to complete the
forms dynamically because I work on multilang sites
Then create the form dynamically as well. myForm = document.createElement('form') ..
You know when I code JS I expect for things not to work ;-). I wonder
how cross browser these (to me) naively looking statements are. (new
Option(...)) statements are DOM 0 so they will probably work flawlessly
in all browsers, but I wonder if the same applies to check boxes and
radio buttons.
.. ..
Also there are ways to dynamically insert elements in a select box via
"new Option(...)". How can you do the same thing with radio button or
check boxes options in a form?

radioInput = document.createElement('input')
radioInput.type = "radio"

..
Thanks and let me test this in all browsers I need to test this web
app.
..
onetitfemme

Apr 30 '06 #3
onetitfemme said the following on 4/30/2006 7:13 PM:
The form element I need only in order to format the pop up and to use
the id selector, in order to feed it in with. I need to complete the
forms dynamically because I work on multilang sites

Then create the form dynamically as well.

myForm = document.createElement('form')

..
You know when I code JS I expect for things not to work ;-). I wonder
how cross browser these (to me) naively looking statements are. (new
Option(...)) statements are DOM 0 so they will probably work flawlessly
in all browsers, but I wonder if the same applies to check boxes and
radio buttons.


ISTR a browser that had problems with new Option. I don't remember the
browser and I don't remember the problem to be honest. But, if a browser
doesn't support createElement then it is sufficiently broken/old enough
not to worry with it.
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
May 1 '06 #4

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

Similar topics

4
by: Mike Clair | last post by:
Hey, I'm having an issue with CSS, JS and the DOM. It's gonna drive me batty. I am trying to access the properties of a layer in JS which have been initially set in an external CSS. The problem...
15
by: Davide R. | last post by:
Ciao a tutti, vi spiego il mio problema Ho una pagina HTML che referenzia un CSS esterno. Ho alcuni elementi HTML che appartengolo ad una classe (chiamiamola "class1"). Avrei la necessitą,...
9
by: Rhino | last post by:
How hard (and desireable) would it be to give the user certain choices when it comes to printing web pages? The pages on my site use colours and pictures and contain an imbedded menu, among...
3
by: onetitfemme | last post by:
>> Why is it that sometimes you must use inline styles? (I have tried >> doing it in may different ways) > Do a google search on "css specficity", but that's outside the scope of this group. >...
7
by: Adam | last post by:
Hello All, I have run into a JS / CSS layout issue in IE, and I can't for the life of me figure out what's going on. Basically, I have one DIV that is expanding beyond the bounds of the...
9
by: Mahernoz | last post by:
Hello Friends, The JavaScript File exmplmenu_var.js contains the code... (for the sake of brevity i am showing only that code which needs to be changed) I am actually developing a menu using...
53
by: brave1979 | last post by:
Please check out my javascript library that allows you to create any layout for your web page, nested as deep as you like, adjusting to width and height of a browser window. You just describe it in...
2
by: crumsoft | last post by:
hello every one i have face some problem related to css. my css file work good in firefox but not looking so good and work properly in internet explorer 6.0 plz help me and solve this problem....
1
by: dustylane | last post by:
I know very little about HTML and CSS but I've been able to decipher most of what I've needed to know based on trial and error. I had a friend coding me a website long ago and he abandoned the...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: 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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.