Click here to get back home

Overriding CSS Declaration for Different Use

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Overriding CSS Declaration for Different Use Michael R. Copeland 03-30-2008
Posted by Michael R. Copeland on March 30, 2008, 4:50 pm
Please log in for more thread options
How do I override the usage of a CSS declaration that's used in a
different way? That is, I want to use the <a..../a> in 2 ways:
initially as horizontal (menu) links, but later as a link to a document
(Word, PDF, etc.). Following is code that illustrates what I'm trying
to do:

<style type="text/css">
a {width:9em; text-decoration:none; color:black;
background-color:orange; padding:0.2em 0.6em;}
a:hover
li
</style>
[...]

<body style="color: rgb(255, 255, 255); background-color: blue"
alink="#ff6600" link="#99ff99" vlink="#990099">
<div style="text-align: center;">
<ul>
<li><a href="#bulletins">Bulletins & Alerts</a></li>
<li><a href="#rules">Rules & Regulations</a></li>
<li><a href="#board">HOA Board</a></li>
<li><a href="#staff">Building Staff</a></li>
<li><a href="#news">Area News</a></li>
<li><a href="#services">Service Directory</a></li>
</ul>
</div>

<div style="text-align: left; color: white;">
<p class="margin">The Regency House Rules and Regulations defines "how
things work"
for residents of the building. This document is here:
<A HREF="RH_Rules01.doc"/A>Rules & Regulations</A><br></p></div>
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Thge usage above doesn't render as I'd like (because it inherits the
characteristics of the CSS declaration), but I'd like it to look like
the text where it appears. Searching Google and looking at several
books doesn't show how to do what I want. Please advise. TIA

Posted by Stan Brown on March 30, 2008, 5:26 pm
Please log in for more thread options
Sun, 30 Mar 2008 13:50:25 -0700 from Michael R. Copeland <mrc2323
@cox.net>:
> How do I override the usage of a CSS declaration that's used in a
> different way? That is, I want to use the <a..../a> in 2 ways:
> initially as horizontal (menu) links, but later as a link to a document
> (Word, PDF, etc.).

I don't understand -- a link is a link is a link. But if you want to
style two sets of links differently, give one set a class. If the
"exception" set is in a menu, you could put a class once on the top
level of the menu and then use
                .classname a
in your CSS for the declarations you want to apply only to the menu
links.

> Following is code that illustrates what I'm trying
> to do:

Sigh.

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2.1 spec: http://www.w3.org/TR/CSS21/
validator: http://jigsaw.w3.org/css-validator/
Why We Won't Help You:
http://diveintomark.org/archives/2003/05/05/why_we_wont_help_you

Posted by Ben C on March 30, 2008, 5:32 pm
Please log in for more thread options
> How do I override the usage of a CSS declaration that's used in a
> different way? That is, I want to use the <a..../a> in 2 ways:
> initially as horizontal (menu) links, but later as a link to a document
> (Word, PDF, etc.). Following is code that illustrates what I'm trying
> to do:

Use classes.

a.foo { color: black }
a.bar { color: red }

<a class="foo">...

<a class="bar">...

>
><style type="text/css">
> a {width:9em; text-decoration:none; color:black;
> background-color:orange; padding:0.2em 0.6em;}

No point setting width on an inline element-- it;s ignored.

Posted by BobaBird on April 1, 2008, 11:03 am
Please log in for more thread options
On Sun, 30 Mar 2008 13:50:25 -0700, (Michael R. Copeland) wrote:

> <body style="color: rgb(255, 255, 255); background-color: blue"
> alink="#ff6600" link="#99ff99" vlink="#990099">

Move the style attributes to your external style sheet, then the HTML
of your 6 or 7 pages will each simply have <body>
--

Charles.

Similar ThreadsPosted
overriding inner nested November 27, 2006, 12:53 pm
Re: overriding inner nested December 7, 2006, 12:51 pm
Dealing with overriding styles with stylesheets in Microsoft Word November 19, 2004, 7:28 am
DOCTYPE declaration on intranet sites. May 19, 2006, 5:09 am
Last rites declaration of Ioannes Paulus PP. II (Karol Wojtyla) May 2, 2005, 2:23 am
Need help changing anchor text color in this style declaration April 19, 2006, 11:28 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap