473,765 Members | 2,047 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I over-ride external CSS inside HTML file?


Folks,

I'm new to CSS and realise that by posting in the html newsgroup, I
might upset one or two readers by raising a CSS question in an html
newsgroup however my ISP only has one small CSS newsgroup available -
I'm hoping someone here might be able to help.

I have an external style sheet which I call/install from inside my head
tags like so:

<link href="css/module.css" rel="stylesheet " type="text/css">
<link href="css/vst.css" rel="stylesheet " type="text/css">

I would like to over-ride the fonts that are defined in the style sheet
but leave the rest of the setup the same - I'm sure there must be a
method that will allow me to over ride this via an html (or style tag)
that appears somewhere after the above - but I don't know which (or how).

Can someone help? All replies please via the newsgroup so that others
can learn too...

Thanks in advance,
randelld

Jul 20 '05 #1
14 11000
Els
Reply Via News Group Please wrote:
Folks,

I'm new to CSS and realise that by posting in the html
newsgroup, I might upset one or two readers by raising a
CSS question in an html newsgroup however my ISP only has
one small CSS newsgroup available - I'm hoping someone here
might be able to help.

I have an external style sheet which I call/install from
inside my head tags like so:

<link href="css/module.css" rel="stylesheet "
type="text/css"> <link href="css/vst.css" rel="stylesheet "
type="text/css">

I would like to over-ride the fonts that are defined in the
style sheet but leave the rest of the setup the same - I'm
sure there must be a method that will allow me to over ride
this via an html (or style tag) that appears somewhere
after the above - but I don't know which (or how).


After the <link> elements but still inside the <head>:
<style type="text/css">
body{
font-family:Arial, sans-serif;
font-weight:bold;
}
</style>

Make sure that the styles you write in this styleblock aren't
less specific than the styles written in the stylesheet.

--
Els
http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Jul 20 '05 #2
Els wrote:
Reply Via News Group Please wrote:

Folks,

I'm new to CSS and realise that by posting in the html
newsgroup, I might upset one or two readers by raising a
CSS question in an html newsgroup however my ISP only has
one small CSS newsgroup available - I'm hoping someone here
might be able to help.

I have an external style sheet which I call/install from
inside my head tags like so:

<link href="css/module.css" rel="stylesheet "
type="text/css"> <link href="css/vst.css" rel="stylesheet "
type="text/css">

I would like to over-ride the fonts that are defined in the
style sheet but leave the rest of the setup the same - I'm
sure there must be a method that will allow me to over ride
this via an html (or style tag) that appears somewhere
after the above - but I don't know which (or how).

After the <link> elements but still inside the <head>:
<style type="text/css">
body{
font-family:Arial, sans-serif;
font-weight:bold;
}
</style>

Make sure that the styles you write in this styleblock aren't
less specific than the styles written in the stylesheet.


Thanks for the prompt reply - I've tried what you've suggested and I've
seen a small change - To confirm changes were happening, I swapped the
order of the font family you suggested and noted that only the fonts
outside of tables were changing - anything inside a table was as per the
style sheet.

Since the majority of my table cells have "class=formLabe l", and my
style sheet has a style set for formLabel, is there a method that I can
use to over ride this class? I've tried using your syntax above, but
changing the word 'body' for 'formLabel' but that didn't work.

All help is much appreciated - I've actually just downloaded the PDF
file for CSS2 and I'm looking at the fonts section - but anything you
can do to help me along my way would be greatly appreciated,

thanks in advance,
randelld

Jul 20 '05 #3
Reply Via News Group Please wrote:
Els wrote:
Reply Via News Group Please wrote:

Folks,

I'm new to CSS and realise that by posting in the html
newsgroup, I might upset one or two readers by raising a
CSS question in an html newsgroup however my ISP only has
one small CSS newsgroup available - I'm hoping someone here
might be able to help.
I have an external style sheet which I call/install from
inside my head tags like so:

<link href="css/module.css" rel="stylesheet "
type="text/css"> <link href="css/vst.css" rel="stylesheet "
type="text/css">
I would like to over-ride the fonts that are defined in the
style sheet but leave the rest of the setup the same - I'm
sure there must be a method that will allow me to over ride
this via an html (or style tag) that appears somewhere
after the above - but I don't know which (or how).


After the <link> elements but still inside the <head>:
<style type="text/css">
body{
font-family:Arial, sans-serif;
font-weight:bold;
}
</style>

Make sure that the styles you write in this styleblock aren't less
specific than the styles written in the stylesheet.

Thanks for the prompt reply - I've tried what you've suggested and I've
seen a small change - To confirm changes were happening, I swapped the
order of the font family you suggested and noted that only the fonts
outside of tables were changing - anything inside a table was as per the
style sheet.

Since the majority of my table cells have "class=formLabe l", and my
style sheet has a style set for formLabel, is there a method that I can
use to over ride this class? I've tried using your syntax above, but
changing the word 'body' for 'formLabel' but that didn't work.

All help is much appreciated - I've actually just downloaded the PDF
file for CSS2 and I'm looking at the fonts section - but anything you
can do to help me along my way would be greatly appreciated,

thanks in advance,
randelld


I got it... with your help... thanks...

In order to over-ride the font for the class 'formLabel' I've tested it with

<style type="text/css">
..formLabel { font-family: Baskerville, "Heisi Mincho W3", Symbol, serif }
</style>

I got those font names from the PDF on CSS2 and I noted that my style
sheets had their classes prefixed with a period/full-stop - I have the
styles after the <link> tags in my html file and it changed the font
through-out.

Thanks again for the prompt help,
randelld
Jul 20 '05 #4
Reply Via News Group Please <re*******@news groups.please.t hanks> wrote in
news:li******** *******@newsfe5-gui.ntli.net:

Folks,

I'm new to CSS and realise that by posting in the html newsgroup, I
might upset one or two readers by raising a CSS question in an html
newsgroup however my ISP only has one small CSS newsgroup available -


A)
Ask your ISP to add the 'missing' newsgroups that you want to use.
B)
In the interim, you can use Google Groups to search the archives
of prior postings to many newsgroups, and to post to newsgroups
not carried by your ISP.

--
Dave Patton
Canadian Coordinator, Degree Confluence Project
http://www.confluence.org/
My website: http://members.shaw.ca/davepatton/
Jul 20 '05 #5
Els
Reply Via News Group Please wrote:
<style type="text/css">
.formLabel { font-family: Baskerville, "Heisi Mincho W3",
Symbol, serif } </style>

I got those font names from the PDF on CSS2 and I noted
that my style sheets had their classes prefixed with a
period/full-stop - I have the styles after the <link> tags
in my html file and it changed the font through-out.
This is how classes are defined in CSS always.
The full stop means class.
For example:

div{width:150px ;}
will give a width of 150px to all divs.

div.foo{width:1 50px;}
will give a width of 150px to all divs with class="foo"

..foo{width:150 px;}
will give a width of 150px to all block level elements with
class="foo". (would be all elements if inline elements could
take widths)

#bar{width:150p x;}
will give a width of 150px to the one element with id="bar".
(an id can only be used once per html file)
Thanks again for the prompt help,


You're welcome.

--
Els
http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Jul 20 '05 #6
Dave Patton wrote:
Reply Via News Group Please <re*******@news groups.please.t hanks> wrote in
news:li******** *******@newsfe5-gui.ntli.net:

Folks,

I'm new to CSS and realise that by posting in the html newsgroup, I
might upset one or two readers by raising a CSS question in an html
newsgroup however my ISP only has one small CSS newsgroup available -

A)
Ask your ISP to add the 'missing' newsgroups that you want to use.
B)
In the interim, you can use Google Groups to search the archives
of prior postings to many newsgroups, and to post to newsgroups
not carried by your ISP.


Thanks - I do on occassions search the google groups, dunno why I didn't
think of it this time around...

cheers
randelld
Jul 20 '05 #7
Els wrote:
Reply Via News Group Please wrote:

<style type="text/css">
.formLabel { font-family: Baskerville, "Heisi Mincho W3",
Symbol, serif } </style>

I got those font names from the PDF on CSS2 and I noted
that my style sheets had their classes prefixed with a
period/full-stop - I have the styles after the <link> tags
in my html file and it changed the font through-out.

This is how classes are defined in CSS always.
The full stop means class.
For example:

div{width:150px ;}
will give a width of 150px to all divs.

div.foo{width:1 50px;}
will give a width of 150px to all divs with class="foo"

..foo{width:150 px;}
will give a width of 150px to all block level elements with
class="foo". (would be all elements if inline elements could
take widths)

#bar{width:150p x;}
will give a width of 150px to the one element with id="bar".
(an id can only be used once per html file)

Thanks again for the prompt help,

You're welcome.


I've filed this weeee piece of text in my useful folder - I have a whole
mixture of posts from javascript, php and other bits that I know at
some time or other, will come in useful.

again... thanks for that... enjoy the rest of the weekend whereever you are,

randelld
Jul 20 '05 #8
Reply Via News Group Please wrote:


I got it... with your help... thanks...

In order to over-ride the font for the class 'formLabel' I've tested it
with

<style type="text/css">
.formLabel { font-family: Baskerville, "Heisi Mincho W3", Symbol, serif }
</style>

I got those font names from the PDF on CSS2 and I noted that my style
sheets had their classes prefixed with a period/full-stop - I have the
styles after the <link> tags in my html file and it changed the font
through-out.

Thanks again for the prompt help,
randelld

Two things, "Symbol" in that font-family is most likely NOT what you
want, as it creates literally symbols instead of text! so if
"Baskervill e" and "Heisi Mincho W3" does not exist, and "Symbol" does,
it will be used before any `serif` font.

Secondly for any style to be marked important, and over-ride any other
rule in _your_ stylesheets (since user and UA stylesheets can over-ride
this with the same keyword) add "!important " (without the quotes) to
the end of your CSS property description, before the semi-colon.

Such as

body { font-family: ariel, helvetica, "Times New Roman", sans-serif
!important; }

(from memory on that only)

~Justin Wood
Jul 20 '05 #9
On Sun, 11 Jul 2004, Justin Wood wrote:
Two things, "Symbol" in that font-family is most likely NOT what you
want,
Agreed,
as it creates literally symbols instead of text!


Not on a standards-conforming client, no. Symbol fonts aren't
constructed according to the principles of character representation in
HTML4 (RFC2070), and where this trick gives a visual impression of
working, it reveals only that the client agent isn't applying the
strict principles of HTML4, but is perpetuating a legacy trick that
was applied to earlier and simpler designs of HTML.

You'll see HTML4 done properly when Mozilla-based browsers are working
on standards-conformance mode.

Unless the client agent is aware somehow of which Unicode characters
are found at which position in the font, it shouldn't be using Symbol
fonts at all. It certainly shouldn't be seeing a Latin "q" and
displaying a "theta", and so on. Except perhaps when the charset is
user-defined.
Jul 20 '05 #10

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

Similar topics

7
3310
by: rdh | last post by:
Hi all, I am in process of developing a Server in C++ supporting multiple protocols. The server will be exposing various functionalities, and the clients can communicate over any of the protocols may be TCP, IPX, SAP, NETBEUI to access the server to access the functionalities exposed. The server doesnot know in advance which client is using what protocol. ALSO, ALL THE INTERACTION WILL BE MADE OVER XML. example my server has...
2
1394
by: Matt | last post by:
here's some more code i inherited on a project: function set_background(pic){ if(pic==""){ if(ie4)over.backgroundImage="none"; if(ns6)over.style.backgroundImage="none"; }else{ if(ns4){ over.background.src=pic; }else if(ie4){
56
5972
by: Raphi | last post by:
Hi, I've been using an Access application I wrote for an office with the front-end stored on all computers and the back-end on one of them serving as an Access file server. Now we're moving to a 2nd office 15 minutes down the road. Only one office will be open at a time, so theoretically it'd be possible to copy the back-end manually every night from one office to another, but frankly, that's pretty annoying.
0
1095
by: Josh | last post by:
Hi, I am trying to capture the MouseDown event over a 3rd-party control (a streaming video screen). I am trying to draw a rubberbanding rectangle over an area of the streaming screen (which is refreshing slowly). When I drag and stretch a rectangle starting on the form, I can pass it over the streaming screen. However, I cannot start a
8
12667
by: rawCoder | last post by:
Hi All, I need some advanced samples or references for passing custom objects over the network using sockets. Without using Remoting what are other options in .NET Framework for this binary serialization. Thank You rawCoder
5
12040
by: Nikolay Petrov | last post by:
I have a ListBox, which is binded to a DataTable. I would like to display a tooltip when the mouse cursor hovers over the items in the ListBox. I don't know how to find the index if ListBox item, on which mouse cursor is over and how to display the tooltip. Any suggestions? TIA
19
4348
by: Mark 123 | last post by:
I just read at http://groups.google.com/group/microsoft.public.access.forms/browse_frm/thread/766ba7b493eacb63/8a7d5504ee848c21?lnk=st&q=migrate+access+97+to+access+2007&rnum=1#8a7d5504ee848c21 that if you have a spilt db using SQL server rather than jet, the front-end's can connect to the backend SQL server over the internet. Has anyone had experience with this? We are thinking of migrating an commercially sold Access97 runtime app to...
3
4109
by: Sebastian | last post by:
Hello all I have a report where I have two nested groups. I know there are only three standard options for running sum: None, Over Group and Over All. I have a MyTextBox in detail section where the data is summed over group. But the data is summed over the second group. When a new group begins MyTextBox value is resetting to zero. I need a running sum over the first group so when another second group begins MyTextBox value will
3
4616
by: Andrew 2006 | last post by:
Hi there, I'm trying to understand the differences between sending XML over TCP and XML over HTTP (SOAP). However I'm not having much luck finding good articles on the www. Can anyone recommend a good web page that explains the differences? Many thanks
0
9568
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9404
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10164
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9959
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9835
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7379
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6649
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5277
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5423
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.