Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google      Sign In   
  • Create Account

Subscribe to HRA Now!

 



Are you a Google Analytics enthusiast?

Share and download Custom Google Analytics Reports, dashboards and advanced segments--for FREE! 

 



 

 www.CustomReportSharing.com 

From the folks who brought you High Rankings!


Sponsored Content

 

 
 

Photo
- - - - -

Css


  • Please log in to reply
8 replies to this topic

#1 rohgan03

rohgan03

    HR 6

  • Active Members
  • PipPipPipPipPipPip
  • 944 posts

Posted 19 July 2005 - 10:33 AM

I have a HTML template that refers to a stylesheet in the root directory. The developer has access to the template but needs to add his own styles. The developer has access to the a sub folder but not to root directory.

Can the developer include another stylesheet in his local folder that defines some tags used by his section of the page?

I would like to avoid giving the developer access to the original stylesheet lest they change any existing tags.

What are my options?

#2 rohgan03

rohgan03

    HR 6

  • Active Members
  • PipPipPipPipPipPip
  • 944 posts

Posted 19 July 2005 - 10:43 AM

This is how I am including the existing stylesheet:
<head>
...
<link href="/MyStyles/style.css" rel="stylesheet" type="text/css">
</head>
<body>

The devloper is adding text to table. Can the developer include another style sheet in the body tag and use that for his section or table?

#3 Dimmerswitch

Dimmerswitch

    HR 3

  • Active Members
  • PipPipPip
  • 72 posts
  • Location:Madison, Wisconsin

Posted 19 July 2005 - 10:53 AM

Simplest option: back up the original CSS file, and roll back if your developer makes a change that you don't like. (Actually, you should probably back up the entire site regardless - just to be on the safe side). Mandating that all the developer changes be appended to the orginal file allows them to take precedence over previously-declared style rules while neatly encapsulating all modifications.
QUOTE
Can the developer include another stylesheet in his local folder that defines some tags used by his section of the page?
Stylesheets that are either linked or imported will have their rules applied to all relevant elements. That is to say, you can't say that a stylesheet should only be applied to a certain section of the page. However, if that section of the page has a selectable container (is all contained within a div that has an id, for example), rule can be written that will only match the intended section.

CODE
p {font-size:2em; color:fc0;} /* this rule applies to all paragraph elements */

CODE
div#somesectionname p {font-size:2em; color:fc0;} /* this rule applies only to paragraph elements within the 'somesectionname' div  */


#4 rohgan03

rohgan03

    HR 6

  • Active Members
  • PipPipPipPipPipPip
  • 944 posts

Posted 19 July 2005 - 11:11 AM

Can you give an example of how to define a division?

#5 rohgan03

rohgan03

    HR 6

  • Active Members
  • PipPipPipPipPipPip
  • 944 posts

Posted 19 July 2005 - 11:12 AM

Also can the devloper:

1. Define his division on the page.
2. Also include a second stylesheet that only contain tags for his division so I dont have to give him access to the folder containing my original SSI.

#6 Dimmerswitch

Dimmerswitch

    HR 3

  • Active Members
  • PipPipPip
  • 72 posts
  • Location:Madison, Wisconsin

Posted 19 July 2005 - 12:09 PM

CODE
<div id="anythingyoulike">
...some content..
</div>


CODE
<link href="/MyStyles/style.css" rel="stylesheet" type="text/css">
<link href="/DevStyles/style.css" rel="stylesheet" type="text/css">


Although if you have a developer you trust so little, that could be viewed as a concern in itself...

#7 rohgan03

rohgan03

    HR 6

  • Active Members
  • PipPipPipPipPipPip
  • 944 posts

Posted 19 July 2005 - 07:47 PM

Thanks Dimmerswitch, that would help. Its not taht I dont trust a developer but i need to make HTML template avaialbe to a whole bunch of developers so chances of orginal stylesheet getting changesd somewhere by someone are pretty high

#8 Tom Philo

Tom Philo

    Photographer

  • Active Members
  • PipPipPipPipPip
  • 507 posts
  • Location:Beaverton, Oregon

Posted 20 July 2005 - 06:25 PM

Since styles are inherited and the closest style to the HTML wins the formatting what you could do is have multiple style sheet includes on your site with the developer's CSS listed first on every page, then your master, so that since the master loads last it trumps previously designed duplicate style names. Only inline styles would then override the master style sheet.

so every page would have
<link href="devstyle.css" rel="stylesheet" type="text/css">
<link href="/MyStyles/style.css" rel="stylesheet" type="text/css">

only unique class and ids in the developers style sheet would be applied this way.

#9 Dimmerswitch

Dimmerswitch

    HR 3

  • Active Members
  • PipPipPip
  • 72 posts
  • Location:Madison, Wisconsin

Posted 21 July 2005 - 12:22 PM

QUOTE(taphilo @ Jul 20 2005, 06:25 PM)
Since styles are inherited and the closest style to the HTML wins the formatting what you could do is have multiple style sheet includes on your site with the developer's CSS listed first on every page, then your master, so that since the master loads last it trumps previously designed duplicate style names. Only inline styles would then override the master style sheet.

so every page would have
<link href="devstyle.css" rel="stylesheet" type="text/css">
<link href="/MyStyles/style.css" rel="stylesheet" type="text/css">

only unique class and ids in the developers style sheet would be applied this way.
View Post


Good point, Tom.

rohgan03, I'd definitely go with the structure Tom suggested. A developer still could override the styles in your default stylesheet (by either having rules with greater specificity or including '!important' with their rules, for example). But the approach Tom suggested should minimize the chance of one of your developers accidentally causing your entire site to use purple 16pt Impact as a default font.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users