Results 1 to 5 of 5

Thread: Server Side Include ignores CSS

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Ray Campbell
    Guest

    Default Server Side Include ignores CSS

    Hey, all.

    I've used an open source FAQ script for a web site, which I've embedded
    using an Inline Frame.

    I'm trying to use a Server Side Include instead of the I-Frame, as I've read
    I-Frames can be problematic with some browsers, and I'm not fond of the way
    it looks. I'd rather have the entire page expand to match the content than
    have a small page with a scroll-bar in the middle.

    Anyhoo... I've embedded the script, but the CSS that the script references
    is not being acknowledged. Before I go around randomly blowing things up, I
    thought I'd ask:

    What do I need to do to have the script use it's CSS?

    I'm looking through the "Adding a CSS File" and "Adding a CSS Rule" sections
    of NOF Help, and I'm thinking it would be best to define a separate master
    border for this page and use "MasterBorder Specific" scope to apply only to
    this page. Does that make sense?

    I've only just begun exploring the CSS side of NOF, and I don't want to make
    a total mess of everything.

    Any pointers or suggestions greatly appreciated.

    Thanks,
    -RayCSS


  2. #2
    Derek
    Guest

    Default Re: Server Side Include ignores CSS

    On 27/02/2010 13:43, Ray Campbell wrote:

    >
    > Anyhoo... I've embedded the script, but the CSS that the script
    > references is not being acknowledged. Before I go around randomly
    > blowing things up, I thought I'd ask:
    >
    > What do I need to do to have the script use it's CSS?
    >

    Provided that the CSS has been loaded to the page, it's the browser's
    job to render the CSS. The script does nothing per se, it just has to
    make sure that it generates elements with the correct ID or class (and
    possibly hierarchy) to match the CSS declarations. If you check the page
    source in your browser, there should be a line something like

    <link rel="stylesheet" type="text/css" href="path_to_css_file" />

    It may be that the link in your page is wrong, which is why it isn't
    appearing as you expected. Try accessing the CSS file directly as a URL
    in the browser, you should get the text back.

    > I'm looking through the "Adding a CSS File" and "Adding a CSS Rule"
    > sections of NOF Help, and I'm thinking it would be best to define a
    > separate master border for this page and use "MasterBorder Specific"
    > scope to apply only to this page. Does that make sense?
    >

    There are several was to get the CSS file in to your page. For my money
    the most maintainable is to add the CSS file to your site style. You
    could add a line to the head section HTML for your page and link it that
    way, but you have to remember it's there if you change anything later.

    When you add the CSS file (or afterwards, actually) to your Active
    SiteStyles list (in Style View, natch!), you have the option for it to
    apply site-wide, so NOF adds a link on every page of your site,
    Masterborder Specific, so it gets added to every page with that MB, or
    to Page Specific (the one you didn't mention) so's it only gets added to
    selected pages. NOF adds the link to the page <head> sections so it's
    'visible' for all elements on the page.

    Note that when you add CSS styling from more than one source, the order
    is important. There are three routes to add CSS to a page; these are:

    External stylesheets - loaded using a <link> tag
    Internal stylesheets - declared between <style></style> tags
    Inline style - applied directly to the style attribute of an element

    If the same element style occurs in more than one place then the styles
    are merged; if there's a clash between different attributes then the
    most 'recent' one overrides. So an inline style trumps an internal
    stylesheet which trumps an external stylesheet. This can give rise to
    some, err, unexpected results on occasions!

    HTH

    Derek

  3. #3
    gotFusion LLC
    Guest

    Default Re: Server Side Include ignores CSS

    ...
    without a URL to see the higherarcial priority of the css you will only get
    guesses as to what is wrong.

    My guess...... would be that you have a priority conflict on tags and the
    one you expect is listed behind another so it is being applied then
    overridden by a newer declaration.

    --

    gotFusion Support Team
    ----------------------------------------------------
    Supplemental NetObjects Fusion Product Support
    http://www.gotfusion.com


    "Ray Campbell" <crayz@SPAMMENOT.amonavi.com> wrote in message
    news:hmb7ss$gs5$1@DailyPlanet.news.netobjects.com. ..
    > Hey, all.
    >
    > I've used an open source FAQ script for a web site, which I've embedded
    > using an Inline Frame.
    >
    > I'm trying to use a Server Side Include instead of the I-Frame, as I've
    > read I-Frames can be problematic with some browsers, and I'm not fond of
    > the way it looks. I'd rather have the entire page expand to match the
    > content than have a small page with a scroll-bar in the middle.
    >
    > Anyhoo... I've embedded the script, but the CSS that the script references
    > is not being acknowledged. Before I go around randomly blowing things up,
    > I thought I'd ask:
    >
    > What do I need to do to have the script use it's CSS?
    >
    > I'm looking through the "Adding a CSS File" and "Adding a CSS Rule"
    > sections of NOF Help, and I'm thinking it would be best to define a
    > separate master border for this page and use "MasterBorder Specific" scope
    > to apply only to this page. Does that make sense?
    >
    > I've only just begun exploring the CSS side of NOF, and I don't want to
    > make a total mess of everything.
    >
    > Any pointers or suggestions greatly appreciated.
    >
    > Thanks,
    > -RayCSS
    >





  4. #4
    Ray Campbell
    Guest

    Default Re: Server Side Include ignores CSS

    Thanks, guys.

    I managed to get it working using "Add CSS File..." from the Style page.
    - Right-click on "Active SiteStyles
    - Select "Add CSS File..."
    - Locate the CSS file and open it.

    You are then given the option of applying this site-wide, to a specific
    Master Border, or to a specific page. I chose the specific page, since it
    applies only to the script that had been embedded on that page.

    As I understand it, the browser will look at the site-wide CSS first, and
    any page specific CSS that applies to the same thing will override that.

    The cool thing is, once you've imported the external CSS file, you can look
    at it in the Style page under the Selectors and CSS Code tabs, and tweak it
    there if you need to.

    My hunch as to why it wasn't being read originally, is likely due to the
    script's CSS file (and all the script files) being in a separate folder
    outside of the "HTML" folder, which works fine if you run the script
    stand-alone (or via I-Frame). But when you "INCLUDE" it, the directory that
    the script is running from becomes the same directory as the page executing
    the "INCLUDE". I also had some problems with some links and image files
    within the script for the same reason -- the relative path to the file being
    referenced was messed up.

    I suppose I could have moved the files for the script into my HTML folder,
    but that gets messy knowing which files belong to the script and which are
    published by NOF.

    If my assumptions are off, please straighten me out.

    -RayC

    "gotFusion LLC" <newsgroup-support@autoresponder-gotfusion.com> wrote in
    message news:A921.1267281526.51@gfwebforum.com...
    > ..
    > without a URL to see the higherarcial priority of the css you will only
    > get guesses as to what is wrong.
    >
    > My guess...... would be that you have a priority conflict on tags and the
    > one you expect is listed behind another so it is being applied then
    > overridden by a newer declaration.
    >
    > --
    >
    > gotFusion Support Team
    > ----------------------------------------------------
    > Supplemental NetObjects Fusion Product Support
    > http://www.gotfusion.com
    >
    >
    > "Ray Campbell" <crayz@SPAMMENOT.amonavi.com> wrote in message
    > news:hmb7ss$gs5$1@DailyPlanet.news.netobjects.com. ..
    >> Hey, all.
    >>
    >> I've used an open source FAQ script for a web site, which I've embedded
    >> using an Inline Frame.
    >>
    >> I'm trying to use a Server Side Include instead of the I-Frame, as I've
    >> read I-Frames can be problematic with some browsers, and I'm not fond of
    >> the way it looks. I'd rather have the entire page expand to match the
    >> content than have a small page with a scroll-bar in the middle.
    >>
    >> Anyhoo... I've embedded the script, but the CSS that the script
    >> references is not being acknowledged. Before I go around randomly blowing
    >> things up, I thought I'd ask:
    >>
    >> What do I need to do to have the script use it's CSS?
    >>
    >> I'm looking through the "Adding a CSS File" and "Adding a CSS Rule"
    >> sections of NOF Help, and I'm thinking it would be best to define a
    >> separate master border for this page and use "MasterBorder Specific"
    >> scope to apply only to this page. Does that make sense?
    >>
    >> I've only just begun exploring the CSS side of NOF, and I don't want to
    >> make a total mess of everything.
    >>
    >> Any pointers or suggestions greatly appreciated.
    >>
    >> Thanks,
    >> -RayCSS
    >>

    >
    >
    >



  5. #5
    Derek
    Guest

    Default Re: Server Side Include ignores CSS

    Glad you got it working...

    On 27/02/2010 20:35, Ray Campbell wrote:
    > Thanks, guys.
    >
    > I managed to get it working using "Add CSS File..." from the Style page.
    > - Right-click on "Active SiteStyles
    > - Select "Add CSS File..."
    > - Locate the CSS file and open it.
    >

    ....
    > As I understand it, the browser will look at the site-wide CSS first,
    > and any page specific CSS that applies to the same thing will override
    > that.
    >


    Correct. See my comments about the order of things in my original reply...

    > My hunch as to why it wasn't being read originally, is likely due to the
    > script's CSS file (and all the script files) being in a separate folder
    > outside of the "HTML" folder, which works fine if you run the script
    > stand-alone (or via I-Frame). But when you "INCLUDE" it, the directory
    > that the script is running from becomes the same directory as the page
    > executing the "INCLUDE". I also had some problems with some links and
    > image files within the script for the same reason -- the relative path
    > to the file being referenced was messed up.
    >


    Also correct. The problem with SSI scripts is that they are executing
    literally within the server's O/S environment, not the *web* server's
    environment. You therefore have to be careful if you generate any
    relative paths within the script, as it may expand things a little
    differently.

    > I suppose I could have moved the files for the script into my HTML
    > folder, but that gets messy knowing which files belong to the script and
    > which are published by NOF.
    >


    What I generally do is create a separate top-level folder for my own
    (i.e. non-NOF) scripts etc. (e.g. /scripts) and then call them with full
    rather than relative paths. This keeps life simple (for me at least!)
    and also comes in handy on those odd occasions when you want to delete
    all of the NOF-generated stuff and re-publish...


Posting Permissions

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