PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.info.authoring.html > Overriding CSS Declaration for Different Use
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Overriding CSS Declaration for Different Use

Réponse
 
LinkBack Outils de la discussion
Vieux 30/03/2008, 22h50   #1
Michael R. Copeland
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Overriding CSS Declaration for Different Use

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
  Réponse avec citation
Vieux 30/03/2008, 23h26   #2
Stan Brown
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Overriding CSS Declaration for Different Use

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 You:
http://diveintomark.org/archives/200..._wont__you
  Réponse avec citation
Vieux 30/03/2008, 23h32   #3
Ben C
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Overriding CSS Declaration for Different Use

On 2008-03-30, Michael R. Copeland <mrc2323@cox.net> wrote:
> 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-colorrange; padding:0.2em 0.6em;}


No point setting width on an inline element-- it;s ignored.
  Réponse avec citation
Vieux 01/04/2008, 17h03   #4
BobaBird
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Overriding CSS Declaration for Different Use

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.
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 02h49.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,11421 seconds with 12 queries