473,508 Members | 2,337 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multiple CSS Style Definitions

Hello,

I would like to define some internal styles within an HTML page, but
have those style overridden by an external style sheet if it exists at
the location specified by a <link> element.

If the external style sheet does not exist, then I would like the
internal styles that are defined in the HEAD section of the HTML page
to be used by default.

I have not been able to find any information on how to setup this type
of internal and external style definition.

Does anyone know how this can be done?

Regards,
Jacob.
Jul 20 '05 #1
5 5059
"Jacob" <ja******@hotmail.com> wrote in message
news:f9**************************@posting.google.c om...
....
I would like to define some internal styles within an HTML page, but
have those style overridden by an external style sheet if it exists at
the location specified by a <link> element.


Have you tried defining the internal styles
before the <link>?

AFAIU the last styles defined take precedence.

HTH

--
Andrew Thompson
* http://www.PhySci.org/ PhySci software suite
* http://www.1point1C.org/ 1.1C - Superluminal!
* http://www.AThompson.info/andrew/ personal site
Jul 20 '05 #2
"Andrew Thompson" <an******@bigNOSPAMpond.com> wrote in message news:<Mk******************@news-server.bigpond.net.au>...
"Jacob" <ja******@hotmail.com> wrote in message
news:f9**************************@posting.google.c om...
...
I would like to define some internal styles within an HTML page, but
have those style overridden by an external style sheet if it exists at
the location specified by a <link> element.


Have you tried defining the internal styles
before the <link>?

AFAIU the last styles defined take precedence.

HTH


Hi Andrew,

Yes, I tried putting the <link> both before and after the internal
styles, but when I then viewed the HTML in IE 6.x it was displayed
using the internal styles each time.

(I know it was using the internal styles as I temporarily changed the
color of the text in the internal style so I would know which set of
styles were being applied.)

Any other ideas?

Regards,
Jacob
Jul 20 '05 #3
"Andrew Thompson" <an******@bigNOSPAMpond.com> wrote in message news:<Mk******************@news-server.bigpond.net.au>...
"Jacob" <ja******@hotmail.com> wrote in message
news:f9**************************@posting.google.c om...
...
I would like to define some internal styles within an HTML page, but
have those style overridden by an external style sheet if it exists at
the location specified by a <link> element.


Have you tried defining the internal styles
before the <link>?

AFAIU the last styles defined take precedence.

HTH


Hi Andrew,

As it turns out I did not have a color explicitly defined in the
external styles, so the temporary color I did have defined in the
internal styles were always taking effect.

After I explicitly defined colors in the external styles, then the
external styles would obviously apply to the HTML page if the <link>
element was placed after the definition of the internal styles.

Thank you for your help.

Regards,
Jacob.
Jul 20 '05 #4
"Jacob" <ja******@hotmail.com> wrote in message
news:f9*************************@posting.google.co m...
"Andrew Thompson" <an******@bigNOSPAMpond.com> wrote in message news:<Mk******************@news-server.bigpond.net.au>...
"Jacob" <ja******@hotmail.com> wrote in message
news:f9**************************@posting.google.c om...
...
I would like to define some internal styles within an HTML page, but
have those style overridden by an external style sheet if it exists at
the location specified by a <link> element.


Have you tried defining the internal styles
before the <link>?

AFAIU the last styles defined take precedence.

.... Yes, I tried putting the <link> both before and after the internal
styles, but when I then viewed the HTML in IE 6.x it was displayed
using the internal styles each time.

(I know it was using the internal styles as I temporarily changed the
color of the text in the internal style so I would know which set of
styles were being applied.)

Any other ideas?


Sorry, no. I'll have to cede to those more
experienced w/ overriding styles. I'm still a
learner myself (with a great deal more to
learn, by all indications).

--
Andrew Thompson
* http://www.PhySci.org/ PhySci software suite
* http://www.1point1C.org/ 1.1C - Superluminal!
* http://www.AThompson.info/andrew/ personal site
Jul 20 '05 #5
"Jacob" <ja******@hotmail.com> wrote in message
news:f9**************************@posting.google.c om...
"Andrew Thompson" <an******@bigNOSPAMpond.com> wrote in message news:<MkUFb.62642
.... As it turns out...
:) I thought about it and realised my
understanding of styles must be very
remiss if I got the precedence wrong,
so I thought to check it myself.
http://www.physci.org/test/override/
Thank you for your help.


No worries. Glad you sorted it. ;-)

--
Andrew Thompson
* http://www.PhySci.org/ PhySci software suite
* http://www.1point1C.org/ 1.1C - Superluminal!
* http://www.AThompson.info/andrew/ personal site
Jul 20 '05 #6

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

Similar topics

5
2460
by: Charles L | last post by:
Can someone explain to me what the following means? "C permits multiple definitions of a variable in any given namespace, provided the definitions are the same and it generates only a single...
5
7235
by: Kobu | last post by:
Does anyone know how old style function definitions differ in "behaviour" to new style function definitions? I heard the old style function definitions caused integeral promotion and floating...
14
2516
by: Carramba | last post by:
hi! I have program with several funktion witch are in separete files, I have one include file were I have definet some variables and initiated 'const double fVar=0.874532;' this files is includet...
9
2777
by: lbj137 | last post by:
I have two files: A.c and B.c. In both files I define a global variable, int xxxx; When I compile with a green hills compiler (and also i think with a GNU compiler) I get no errors or warnings....
4
2708
by: Brian | last post by:
I am trying to use a web service from a non Microsoft product. When I do a "Add Web Reference" from the Visual Studio dialog box, a request is generated and received by the web services supplier....
5
5375
by: Jeff | last post by:
We are using .Net and the wsdl Utility to generate proxies to consume web services built using the BEA toolset. The data architects on the BEA side create XML schemas with various entities in...
6
2076
by: dndfan | last post by:
Hello, In the short time I have spent reading this newsgroup, I have seen this sort of declaration a few times: > int > func (string, number, structure) > char* string > int number >...
8
3280
by: yossi.kreinin | last post by:
Hi! When are multiple definitions of global variables with the same name considered legal in C, and how is it different from C++? It appears that in terms of assembly language, some C...
13
2454
by: a.zeevi | last post by:
free() multiple allocation error in C ==================================== Hi! I have written a program in C on PC with Windows 2000 in a Visual C environment. I have an error in freeing...
3
11669
by: jparulan | last post by:
Hi All, I'm using SOAP3.0. I was able to successfully call a WSDL file and get a value properly. But when the WSDL changed to have a MULTIPLE <element name> it was failing. This code works...
0
7225
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
7326
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
7383
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...
1
7046
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...
0
7498
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4707
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
3194
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3182
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.