HTML file does not recognize CSS specified using link tag on RStudio Cloud

I created an HTML file on RStudio Cloud and linked it to a CSS file, in the same directory.

When I preview the HTML file (using the Preview button in the Toolbar), the HTML file gets opened in a pop-up window and the style gets applied. However, if I try to open the file in a browser, the HTML styles do not get applied.

If I specify the style inline, using the tag, it works.

I tried moving the CSS file to a www directory, but that did not work either.

Am I not specifying the CSS file correctly?

Here is a link to the RStudio Cloud project with access to everyone: RStudio Cloud

And here is the code for the HTML and CSS files.

    <link rel="stylesheet" href="styles.css">
    <div class = 'div-class'>
      This is blue text
.div-class {
  color: blue;


This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.