Code Monkey home page Code Monkey logo

Comments (3)

jnizet avatar jnizet commented on May 24, 2024

Hi @kewur.

That's quite expected. The HTML page file needs CSS and JS files to work as expected. So just saving the index.html file and opening this file won't apply the styles defined in these non-existent files.

Besides, this doesn't have anything to do with ng-bootstrap.

from ng-bootstrap.

kewur avatar kewur commented on May 24, 2024

interesting, so bootstrap isn't ssr compatible? my understanding is that seo crawlers aren't guaranteed to run javascript, hence the need to do server side rendering. adding the bootstrap.min.css file in the index.hml header as a link gets around this problem and all styles load correctly however, so it does seem possible. I would have hoped someone would've had a better solution to it.

from ng-bootstrap.

jnizet avatar jnizet commented on May 24, 2024

Bootstrap is SSR compatible, like any othr CSS solution. But SSR-compatible does't mean that styles are magically applied to a page even when you save a page on the disk without its associated stylesheets and then open that page.
SSR consists in rendering a page on the server so that a browser, or a bot, can load the page and get HTML that is ready to read or crawl. But of course, browsers and bots, when they see a HTML page which links to a CSS stylesheet (which is also served by the web server), do download the CSS as well:

  Browser or bot                              Web server
  ______________                              __________

     1 ---------- GET index.html ---------------->

       <----------send bach index.html content --- 2

     3 read html, 
       find link to styles.css

     4 ---------- GET styles.css ---------------->

       <--------- send back styles.css content --- 5

     6 render styled page

from ng-bootstrap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.