473,785 Members | 3,349 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Where should small amount of page specific style go?

I am curious if there is something that would be considered a proper
method for locating small (three to four items) amounts of page specific
styling. Or does it really matter in the great scheme of things?

I have a linked style sheet that covers everything I want to do
globally. What should be done if I want to change and/or add a couple of
divs and paragraphs on a specific page and the style applied is specific
to that one page?

Should this be placed on a separate linked style sheet, placed in the
global style sheet (considering that I may be modifying something that
has already been declared like a paragraph), or would it be considered
ok to simply have this page specific styling on the web page itself
since it is specific to that one page?

Mark
Jul 20 '05 #1
6 3669
In article <3E************ @netscape.net> in
comp.infosystem s.www.authoring.stylesheets, Mark Cunningham
<ma*****@netsca pe.net> wrote:
I am curious if there is something that would be considered a proper
method for locating small (three to four items) amounts of page specific
styling. Or does it really matter in the great scheme of things?


I'm sure I'll have to dodge some brickbats, but if you have styles
that _really_ only apply to on document, I don't see great harm in
putting them in a <style> element.

However...

Even if today you're 100% certain that they will never apply to any
other document, I'll bet in a surprisingly short time you'll find
you do need them in a second document, and you'll wish they had been
in an external stylesheet all along. If their use is truly rare, you
could keep them in a special sheet, have that special sheet import
the main one, and then have your unusual document link to the
special sheet instead of the main one.

--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
validator: http://jigsaw.w3.org/css-validator/
Jul 20 '05 #2
On Sat, 28 Jun 2003 20:03:27 -0400, Stan Brown
<th************ @fastmail.fm> wrote:
In article <3E************ @netscape.net> in
comp.infosyste ms.www.authoring.stylesheets, Mark Cunningham
<ma*****@netsc ape.net> wrote:
I am curious if there is something that would be considered a proper
method for locating small (three to four items) amounts of page specific
styling. Or does it really matter in the great scheme of things?
I'm sure I'll have to dodge some brickbats, but if you have styles
that _really_ only apply to on document, I don't see great harm in
putting them in a <style> element.
Agreed - I often do that.
However...

Even if today you're 100% certain that they will never apply to any
other document, I'll bet in a surprisingly short time you'll find
you do need them in a second document, and you'll wish they had been
in an external stylesheet all along. If their use is truly rare, you
could keep them in a special sheet, have that special sheet import
the main one, and then have your unusual document link to the
special sheet instead of the main one.


On the other hand (a) if you have several pages with unique styles, that
introduces several extra files; (b) it's not that much work to move the
in-page styles to a separate stylesheet later if they become needed on a
second page.

Sometimes I use in-page styles for something like tweaking a margin
where, even if I did exactly the same thing on another page, I wouldn't
necessarily want a change to one page to affect other pages elsewhere.

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Jul 20 '05 #3
In article <3E************ @netscape.net>, ma*****@netscap e.net says...
I am curious if there is something that would be considered a proper
method for locating small (three to four items) amounts of page specific
styling. Or does it really matter in the great scheme of things?

I have a linked style sheet that covers everything I want to do
globally. What should be done if I want to change and/or add a couple of
divs and paragraphs on a specific page and the style applied is specific
to that one page?

One option is to add an id to the body element of the specific page and
use eg :

#specialOne p {
... stuff specific to #specialOne page
}

Which makes life easy when you want to use that style in another page.
Jul 20 '05 #4
Mark Cunningham wrote:
I am curious if there is something that would be considered a proper
method for locating small (three to four items) amounts of page specific
styling. Or does it really matter in the great scheme of things?


It depends on how much of this you are expecting to do, and how visited the
pages are compared with the rest of the site. If there's just a few rules
here and there, then I'd just put them in the global stylesheet. It would
be a matter of 1K or so download for each visitor on the initial pageview,
and nothing from that point on, as opposed to a guaranteed 1K every time
somebody retrieves one of the pages from your server (the 1K is a complete
guess of course, but the principle holds, at least for small values).
--
Jim Dabell

Jul 20 '05 #5
Mark Cunningham schrieb:

I am curious if there is something that would be considered a proper
method for locating small (three to four items) amounts of page specific
styling. Or does it really matter in the great scheme of things?

I have a linked style sheet that covers everything I want to do
globally. What should be done if I want to change and/or add a couple of
divs and paragraphs on a specific page and the style applied is specific
to that one page?

Should this be placed on a separate linked style sheet, placed in the
global style sheet (considering that I may be modifying something that
has already been declared like a paragraph), or would it be considered
ok to simply have this page specific styling on the web page itself
since it is specific to that one page?


Most "page specific" styles turn out to be useful for other pages too,
while you'll find that some global styles really only apply to a few
pages. If you follow the route of "page-specific styles directly in the
web page", you could end up moving styles back and forth between
individual pages and the global stylesheet - time-intensive,
complicated, and error-prone.

And those page-specific styles in their individual page are usually
forgotten pretty soon; they'll rear their ugly head when you're updating
your global stylesheet and wonder about all the weird things that are
happening on some pages.

The same goes for linked stylesheets: You could end up with a css folder
full of different files that control some aspect of some pages but not
other aspects of some other pages - one big confusing mess.

That's why I usually suggest putting it all in one global stylesheet,
with lots of documentation to it. Properly organized sites can probably
risk separate linked stylesheets for separate sections of the site, but
even with good organization the potential for a big mess is just a
<link> away.

Whatever you do, try not to have too many different sources for the
final style rule - the cascade is a big pain in the tuckus, and
sometimes hard to understand for both authors and browsers.
Matthias
Jul 20 '05 #6
Matthias Gutfeldt wrote:
Mark Cunningham schrieb:
I am curious if there is something that would be considered a proper
method for locating small (three to four items) amounts of page specific
styling. Or does it really matter in the great scheme of things?

I have a linked style sheet that covers everything I want to do
globally. What should be done if I want to change and/or add a couple of
divs and paragraphs on a specific page and the style applied is specific
to that one page?

Should this be placed on a separate linked style sheet, placed in the
global style sheet (considering that I may be modifying something that
has already been declared like a paragraph), or would it be considered
ok to simply have this page specific styling on the web page itself
since it is specific to that one page?

Most "page specific" styles turn out to be useful for other pages too,
while you'll find that some global styles really only apply to a few
pages. If you follow the route of "page-specific styles directly in the
web page", you could end up moving styles back and forth between
individual pages and the global stylesheet - time-intensive,
complicated, and error-prone.

And those page-specific styles in their individual page are usually
forgotten pretty soon; they'll rear their ugly head when you're updating
your global stylesheet and wonder about all the weird things that are
happening on some pages.

The same goes for linked stylesheets: You could end up with a css folder
full of different files that control some aspect of some pages but not
other aspects of some other pages - one big confusing mess.

That's why I usually suggest putting it all in one global stylesheet,
with lots of documentation to it. Properly organized sites can probably
risk separate linked stylesheets for separate sections of the site, but
even with good organization the potential for a big mess is just a
<link> away.

Whatever you do, try not to have too many different sources for the
final style rule - the cascade is a big pain in the tuckus, and
sometimes hard to understand for both authors and browsers.
Matthias


Matthias, Jim Dabell, Jacqui or (maybe) Pete, Stephen Poley, Stan Brown,
many thanks for taking the time to respond. It is greatly appreciated.
Sound advice and food for thought.

--

Mark Cunningham
Jul 20 '05 #7

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

Similar topics

25
2568
by: Tor Erik Sønvisen | last post by:
Hi I need to browse the socket-module source-code. I believe it's contained in the file socketmodule.c, but I can't locate this file... Where should I look? regards tores
14
1933
by: Alan Silver | last post by:
Hello, Sorry if this is covered somewhere, but I've looked at countless sites explaining how to do multicolumn layouts in CSS, but have yet to find one that does what I want. In the old days, I would use something like this (deliberately small fragment of air code, so no comments about validity please!!) to produce a two-column layout, where the left column was (say) for site links...
20
5246
by: Frank-O | last post by:
Hi , Recently I have been commited to the task of "translating" some complex statistical algorithms from Matlab to C++. The goal is to be three times as fast as matlab ( the latest) . I've used various techniques ( loop unrolling, loop jamming...) and tried some matrix libraries : newmat (slow for large matrix) , STL (fast but ..not usefull) , hand coding (brain consuming...), and recently Meschach...
2
1399
by: Barely Audible | last post by:
Guys Skype provides the following to put on a web page to show their visitors when their next skypecast is being broadcast - but somewhere there is an error and the actual time shown is an hour early which tends to cause a certain amount of confusion. Can anyone fix it so that it shows the correct time? <script type="text/javascript"
41
18222
by: Miroslaw Makowiecki | last post by:
Where can I download Comeau compiler as a trial version? Thanks in advice.
6
6170
by: moondaddy | last post by:
I want to fill the entire background of a page with a gradient. As a test, I first filled with a solid color like this: <body style="background-color: #ccffff;" > and the entire page was this color. next I replaced that with a gradient style like this: <body style="filter:
58
5775
by: Don Li | last post by:
I've tried <body style="font-family:Verdana,Arial,Helvetica;font-size:0.8em;"> or <body style="font-family:Verdana,Arial,Helvetica;font-size:11pct;"> or <body style="font-family:Verdana,Arial,Helvetica;font-size:80%;"> to no avail. In IE7 it shows up as Medium. What did I do wrong? Thanks.
7
10208
by: cmrchs | last post by:
Hi, In Windows Vista: where does asp.net write its cookies? I use HttpCookie objCookie = new HttpCookie("nameCookie"); in Win2000 (and later) they used to be in C:\Documents and Settings\Administrator\Cookies but not anymore
0
9643
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
9947
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...
0
8971
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7496
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
6737
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
5380
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
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4046
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2877
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.