Can someone help me with this css problem?

7 replies
  • WEB DESIGN
  • |
I have two css files (style.css) and two html files
Each html file is connected to their own css files.

How can I have all of these files in the root folder of the domain without the style.css files overwrites eachother, is there a simple solution to this problem?

Sincerely
Karl
#css #problem
  • Profile picture of the author wayfarer
    Sure, rename them, or put them in separate directories.
    Signature
    I build web things, server things. I help build the startup Veenome. | Remote Programming Jobs
    {{ DiscussionBoard.errors[558769].message }}
  • Profile picture of the author Challe77
    but if I rename the css files, won´t the html files loose their direction so to speak, is there somewhere in the html code that points to specific css files?

    Sincerely
    Karl
    {{ DiscussionBoard.errors[558834].message }}
  • Profile picture of the author staxx
    After you rename you css file, go into your html and change any reference to that file to the new file name. Simple
    {{ DiscussionBoard.errors[558881].message }}
  • Profile picture of the author mywebwork
    At the top of you html documents you'll see a line like this:

    Code:
    <LINK REL=StyleSheet HREF="styles.css" TYPE="text/css" MEDIA=screen>
    This line references your style sheet, and you can have as many of them as you want - just give each style sheet its own name and reference them all in every document.

    One thing to watch out for though is conflicts between the two sheets. For example, if both sheets define the pages body background color only one will actually be applied. It can get very confusing as some browsers will apply the first entry they read and ignore the rest while others will apply the last one they read!

    Bill
    {{ DiscussionBoard.errors[559041].message }}
  • Profile picture of the author wayfarer
    The HTML will be linked to the CSS in the <head> of the document somewhere, either like this:
    HTML Code:
    <link href="/path/to/style.css" rel="stylesheet" type="text/css" />
    or like this:
    HTML Code:
    <style type="text/css">@import url("path/to/style.css");</style>
    You'll need to change either the href="" attribute in the first example, or the contents of the url("") indicator in the second.

    ***EDIT*** hey! we posted at the same time! think ur quicker on the draw or something?! :p
    Signature
    I build web things, server things. I help build the startup Veenome. | Remote Programming Jobs
    {{ DiscussionBoard.errors[559048].message }}
  • Profile picture of the author Richard Whyte
    Following the directions above....

    I often will make a standard CSS file for general things that every pages uses
    Then a custom one for each page if they have very different features

    If you are good with naming in you CSS file code and know what you are doing, you don't have to go to this extent, but some times it is handy...

    On big sites, I have had CSS files that have over 400 individual classes that I have setup... Then you can use them in your HTML any place you want to.

    Have a Great Day!
    {{ DiscussionBoard.errors[562708].message }}
  • Profile picture of the author brp002
    Are you using a PHP script because then it might be in your header.php file. Can you give me a link to your website and I will tell you.
    Signature

    If you want a link here please email me!

    {{ DiscussionBoard.errors[564712].message }}

Trending Topics