473,408 Members | 2,009 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

avoiding duplication

Computer programmers like myself don't like to clone specifications. I
like to specify things only once. Is there a way to abbreviate this
pair of styles. They are identical except for background colour.

I suppose I could use a pair of styles, but then I have to change all
the markup and it looks ugly in the markup. Is there as way to do
this purely in the style sheet so the markup does not know about it?
..titlejgloss, {
/* for java glossary title */
background : #91eaff;
border-color : #808080;
border-style : inset;
border-width : 1px;
display : block;
font-family : Arial,Helvetica,sans-serif;
font-size : 200%;
font-weight : bold;
padding : 5px;
margin-bottom : 10px;
margin-top : 0px;
}

..titlebgloss {
/* for gay glossary title */
background : red;
border-color : #808080;
border-style : inset;
border-width : 1px;
display : block;
font-family : Arial,Helvetica,sans-serif;
font-size : 200%;
font-weight : bold;
padding : 5px;
margin-bottom : 10px;
margin-top : 0px;
}

In practice I have a dozen or so of these things with theme and
variations.

--
Bush crime family lost/embezzled $3 trillion from Pentagon.
Complicit Bush-friendly media keeps mum. Rumsfeld confesses on video.
http://www.infowars.com/articles/us/...s_rumsfeld.htm

Canadian Mind Products, Roedy Green.
See http://mindprod.com/iraq.html photos of Bush's war crimes
Jul 21 '05 #1
2 1447
Roedy Green wrote:
Computer programmers like myself don't like to clone specifications. I
like to specify things only once. Is there a way to abbreviate this
pair of styles. They are identical except for background colour.


.titlejgloss, .titlebgloss {
/* add properties that apply to both classes */
}
.titlejgloss {
/* add properties that only apply to titlejgloss */
}
.titlebgloss {
/* add properties that only apply to titlebgloss */
}

--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Jul 21 '05 #2
On 22/06/2005 09:03, Johannes Koch wrote:

[snip]
.titlejgloss, .titlebgloss {
/* add properties that apply to both classes */
}
.titlejgloss {
/* add properties that only apply to titlejgloss */
}
.titlebgloss {
/* add properties that only apply to titlebgloss */
}


Adding to that, one can collapse some of the separate declarations into
single shorthand declarations. Namely:

border: 1px inset #808080;
font: bold 200% Arial, Helvetica, sans-serif;

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 21 '05 #3

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

Similar topics

3
by: simon.alexandre | last post by:
Hi all, I use csv module included in python 2.3. I use the writer and encouter the following problem: in my output file (.csv) there is a duplication of the end of line character, so when I open...
5
by: CJM | last post by:
In an application I'm working the user has the opportunity to record the despatching of one or more items with serial numbers. For each item they despatch, they have to chose the serial no that...
20
by: Steve Jorgensen | last post by:
A while back, I started boning up on Software Engineering best practices and learning about Agile programming. In the process, I've become much more committed to removing duplication in code at a...
2
by: perryche | last post by:
Experts, Bascially I want to avoid people entering duplicated records. However, the check for the duplication are in 2 separate fields. i.e. Field1 + Field2 can not be duplicated. What's the...
3
by: Tcc | last post by:
Hi All, Assume there are some data in "a.txt": e.g. ABC
4
by: Frank-René Schäfer | last post by:
-- A class needs to have N members according to N types mentioned in a typelist (possibly with one type occuring more than once). -- The classes should be generated **avoiding** multiple...
7
by: =?Utf-8?B?S2F2aXRh?= | last post by:
We have one web application developed in .Net framework 1.1. This site is live on production server since one year and used across world by many users. But only one of the users is facing...
1
by: dbarmer | last post by:
I have a unix database system that hold three tables, 254, 255, 256, and all are linked together by WO, CUST NO, LOC NO. This is for Unix Program Purposes Only. Duplication here is by design. So...
61
by: arnuld | last post by:
I have created a program which creates and renames files. I have described everything in comments. All I have is the cod-duplication. function like fopen, sprint and fwrite are being called again...
4
by: henry | last post by:
Folks: Using Dreamweaver CS3... Consider a home page, "index.php" which conditionally REQUIREs one of 'N' HTML files of pure content. All site styles are specified in a master CSS file,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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...
0
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...
0
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...

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.