SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2001
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    SSI &CSS conflicts

    thanx to the peeps here at sitepoint i was able to learn about common borders thru the use of ssi.

    Now, heres the new problem...

    I'm using css styles for the links.

    The three include pages have been stripped of html, head,and body tags to keep the code cleaner on the main page.
    http://www.rbr.com/newrbr/top.asp

    check the source code- is this wrong to do this?

    I use the css styles code on the main page which in turn works on the includes.
    http://www.rbr.com/newrbr/index.asp

    but i wanted to use an external style sheet. so when i did so i had a problem because the main page would override the styles if i used the

    <body topmargin="5" marginheight="5" text="black" link="navy" vlink="navy" alink="navy">

    I used this because there is content/links(The section called daily news) that is changed daily and dont want to go in and code in the class="whatever" on every new link for that particular section.

    So am i stuck with using inline css code or is there a way around this so i can use external style sheets but still have the page attributes shown above?

    I hope i explained this in an understandable way

    Thanx for any help!!

  2. #2
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,121
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Okay, remember why CSS is called CSS? Not just because of the SS (Style Sheets). It's because they cascade. I don't remember the exact order, that's irrelevant, but CSS defined in-page will always supersede values set from the external style sheet.

    So, your external style sheet could have:

    BODY
    {
    font-family:arial;
    color:blue;
    }

    And your inpage could have:

    BODY
    {
    font-family:whosit;
    }

    And it would output blue whosit style text on that page.
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  3. #3
    SitePoint Enthusiast
    Join Date
    Oct 2001
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah i understand how multiple css styles cascade, but
    its not inline thats over riding the external sheet. its the actual page attributes for links thats over riding the style sheet. not two css's

    I guess its all the same though...

    If you have styles that define the links, any text links that arent defined by a class="blah" tag will show up as the web default version

    link blue, visited purple, etc...

    Thats what im looking to change, the links not effected by style tags.

    Anyway, i guess theres no way around that.

    Thnx tho

  4. #4
    SitePoint Wizard Ian Glass's Avatar
    Join Date
    Oct 2001
    Location
    Beyond yonder
    Posts
    2,384
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't think I quite follow you, Irishdego--SSI is applied before the browser ever applies the stylesheet, before the browser even gets the page--but I'll take a stab at it.

    So you don't want to add 'class="blah"' to every link you want to be adifferent color, you can do that with contextual selectors {http://www.w3.org/TR/REC-CSS1#contextual-selectors}. For instance:
    Code:
    #header a:link { /* CSS Code */ }
    #header a:vidited { /* CSS Code */ }
    #header a:hover { /* CSS Code */ }
    #header a:active { /* CSS Code */ }
    Where you name the parrent eliment of the hyperlinks as 'header'( <table id="header"> or <tr id="header">). That should work for you, if this is what you wanted. This way you don't need to include the class attribute on every link.

    ~~Hope This Helps

  5. #5
    SitePoint Enthusiast
    Join Date
    Oct 2001
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry, I know it sounded confusing.

    actually it shouldnt have been ssi & css conflicts. It should have been css & page att. conflicts.

    If you have this for your body tag...

    <body topmargin="5" marginheight="5" text="black" link="navy" vlink="navy" alink="navy">

    And this is your css...

    <!-- This is the css classes for the nav bars: -->
    <STYLE TYPE="text/css">
    a.tnav:link { color: white; text-decoration: none }
    a.tnav:active { color: white; text-decoration: none }
    a.tnav:visited { color: white; text-decoration: none }
    a.tnav:hover { color: yellow; text-decoration: underline }
    </STYLE>
    <!-- This ends the css classes for the nav bars -->

    Now, If your css is inline it will override the body link att. and work fine.

    If it goes to an external css it has conflicts.
    The link, active, and visited use the body link att. while the hover will use the css.

    and i wanted to be able to use a external css for the purpose of changing only one doc.

    But i just pasted the css inline on one of the include sheets so now its still only needs to be updated once. so its fixed, whether its the right way i dont know. but it works. i've tested on netscape and IE with op system Windows NT, 2000, Millenium, and 98

    The css isnt recognized in netscape 4.7 but it gets no errors so i geuss thats a good thing

    Thanx for the help. the contextual selectors seem good but this seemed to work better for my situation.

    p.s.-The W3C should explain their stuff better. Not everybody is a pro at this

  6. #6
    SitePoint Guru
    Join Date
    Jul 2000
    Location
    Long Island, NY
    Posts
    755
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The thing to keep in mind is that for your purposes, there's really only one document. If you think of it this way it's easier to understand - SSI calls are just helping you construct a page by using the same code over on however many pages you want to use it one - such as navigation bars. Once it's put together, it's just one page and will behave that way, unlike something like frames, for instance, which are separate pages appearing together. So, your code will behave exactly as though you wrote it on the main document, rather than calling it with SSI. Well, I was trying to be clear. Not sure I succeeded, though.

  7. #7
    SitePoint Enthusiast
    Join Date
    Oct 2001
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ya'll have been a great help

    Thanx


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •