HighDots Forums  

Overriding CSS Declaration for Different Use

HTML Writing HTML for the Web (comp.infosystems.www.authoring.html)


Discuss Overriding CSS Declaration for Different Use in the HTML forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Michael R. Copeland
 
Posts: n/a

Default Overriding CSS Declaration for Different Use - 03-30-2008 , 03:50 PM






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-colorrange; padding:0.2em 0.6em;}
a:hover {background-color:#ff3300}
li {display:inline}
</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

Reply With Quote
  #2  
Old   
Stan Brown
 
Posts: n/a

Default Re: Overriding CSS Declaration for Different Use - 03-30-2008 , 04:26 PM






Sun, 30 Mar 2008 13:50:25 -0700 from Michael R. Copeland <mrc2323
@cox.net>:
Quote:
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.

Quote:
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/200..._wont_help_you


Reply With Quote
  #3  
Old   
Ben C
 
Posts: n/a

Default Re: Overriding CSS Declaration for Different Use - 03-30-2008 , 04:32 PM



On 2008-03-30, Michael R. Copeland <mrc2323 (AT) cox (DOT) net> wrote:
Quote:
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">...

Quote:
style type="text/css"
a {width:9em; text-decoration:none; color:black;
background-colorrange; padding:0.2em 0.6em;}
No point setting width on an inline element-- it;s ignored.


Reply With Quote
  #4  
Old   
BobaBird
 
Posts: n/a

Default Re: Overriding CSS Declaration for Different Use - 04-01-2008 , 10:03 AM



On Sun, 30 Mar 2008 13:50:25 -0700, (Michael R. Copeland) wrote:

Quote:
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.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.