Trouble with CSS Styling in Implementation of Website on Heroku

While the deployment of the application on the server works perfectly, there seems to be an issue on the website itself. The content is displayed without the CSS styles.

Original Website link:

This problem is not present when accessing the application locally. It should resemble the following:

The logs from Heroku can be seen using the command heroku logs --tail.

2020-07-23T17:48:24.825819+00:00 app[web.1]: 10.143.53.219 - - [23/Jul/2020:17:48:24 +0000] "GET /about_Rio/ HTTP/1.1" 200 882 "http://riorana95.herokuapp.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36"
    ...
    more log entries
    ...

Python code snippet:

from flask import Flask, render_template

app = Flask(__name__)


@app.route('/')
def home():
    return render_template("Journey.html")


@app.route('/about_Rio/')
def about():
    return render_template("About Rio.html")


if __name__ == "__main__":
    app.run(debug=True)

CSS file snippet:

body {
    margin: 0;
    padding: 0;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: #060;
    ...
    additional CSS styling rules here
    ...
}

Answer №1

The issue was unclear to me initially, but it seems to have resolved itself now.

To fix it, I removed the app from Heroku and deleted the .git folder from my "website" directory. Additionally, I changed the folder name from CSS to css within the static folder.

After going through the steps again, everything is functioning smoothly now.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Tips for creating a button hover effect with dynamic color and opacity

On my webpage, the button color is determined by an admin using JavaScript on page load. Since I don't know what color will be used, I can't apply rgba(). While using opacity does change the button's color, it also affects the text, which is ...

Middleware that handles form post requests quickly became overwhelmed and resulted in a RangeError

Currently, I am working with a form using ejs templates to collect data. When accessing the "/" route, my application renders the "main" view and utilizes a middleware to handle the form data. However, I encountered an error stating "RangeError: Maximum ca ...

Using a personalized font in CSS isn't functioning correctly and is displaying Times New Roman instead

I've been struggling to include a custom font in my project, but it's not working as expected. Here's how I added it to the .css file: @font-face { font-family: 'Open Sans'; src: url('/open-sans.eot'); src: u ...

Selenium is struggling to locate a CSS selector

While using Selenium, I encountered a NoSuchElementException error after successfully retrieving 9 entries from the website. It seems like the page content might not have had enough time to load properly, but I'm still unsure. The code I wrote was ba ...

If the div element with the ID "arrow" is present, assign the class "odd0" to its corresponding table row

    My current implementation involves assigning different colors to alternate table rows using the provided JavaScript: function alternate(id){         if(document.getElementsByTagName){            var table = document.getElementById(id);   ...

Establish a table containing rows derived from an object

I am currently dealing with a challenge in creating a table that contains an array of nested objects. The array I have follows this schema: array = [ { id: 'Column1', rows: { row1: 'A', row2 ...

The onload function on the iframe is triggering twice in Internet Explorer 11

I am encountering a strange issue with an iframe in HTML that has an onload function. When using IE11, the onload function is being triggered twice, whereas it works fine in Chrome. Here is the HTML code: <iframe src="someurl" onload="someFunction( ...

Stylesheets are being requested over the network, however, they are not being applied to the HTML

https://i.sstatic.net/GGYxm.png The screenshot above shows the initial setup in Firefox's developer tools. There is a <link rel="stylesheet"> in the header, but no styles are applied to the <body> element in the lower viewport. The second ...

Vue.js error: Unable to locate requested resources

Recently, I've been encountering a curious issue when trying to access a specific component in my application. When I manually type the URL http://localhost:8080/detailed-support/start into the browser, the content loads without error. However, none o ...

Copy values of multiple input fields to clipboard on click

I have a collection of buttons in my Library, each with different text that I want to copy when clicked function copyTextToClipboard(id) { var textElement = document.getElementById(id); textElement.select(); navigator.clipboard.writeText(textElement. ...

Tips for aligning spin.js spinner in the center of a bootstrap 3 modal?

I'm attempting to showcase and center the spin.js spinner within a Bootstrap 3 modal. Despite successful implementation in IE and FF using the code below, I am encountering issues in Chrome, Safari Desktop, Chrome IOS, Safari IOS. The problem appears ...

HTML, PHP, and MySQLI registration form without any noticeable errors

For a personal project, I am currently working on coding a registration form for my webpage. Although the webpage loads, nothing seems to be happening. No data is being inserted into the database. Below is the HTML code for the form. Note that I am usin ...

The jQuery div enclosure technique

I am trying to wrap HTML around an existing div, here is what I have attempted: HTML: <input type="text" data-placeholder="username" /> It should look like this when rendered: <div class="placeholding-input"> <input type="text" data-pl ...

What causes JavaScript image to stop loading while displaying a prompt dialog?

I have nearly finished my project. I will include a codepen link at the end of the post for debugging purposes. What Should Happen? The img element has an id property of dragon, and the image specified in the src attribute should be pre-loaded as the defa ...

Ensure that the anchor element's height fills the entire div when using the display:block property

My HTML code is very simple: <div class='mydiv'> <a href='#'>Link</a> <div> As for the CSS: div.mydiv { height: 200px; width: 200px; background-color:red; } div.mydiv a { display:block; color:yellow; b ...

Modify the stroke attribute of the <path> element using CSS

I have a generated svg path code that I want to customize using CSS to remove the default stroke. How can I override the stroke property and set it to none? code: <div class="container" style="position: absolute; left: 3px; z-index: 1;"> <svg he ...

What is the best way to utilize Python to solve and visualize a particular mathematical equation?

Hello, I am new to Python and have two questions that I hope you can help me solve. 1) How would I go about plotting all the points (x, y) that satisfy the following equation? y==11+(1+2x)((11x)/(5+10x))^((3y)/(3y-(5+x))) Given x>0 and y>0. 2) No ...

Troubleshooting problem with aligning grid items at the center in React using

I've been facing a challenge in centering my elements group using the material ui grid system. Problem: There seems to be excess margin space on the extreme right. Code snippet: const renderProjects = projects.map(project => ( <Grid item ...

JavaScript Popup prompting user on page load with option to redirect to another page upon clicking

Can a JavaScript prompt box be created that redirects to a site when the user selects "yes" or "ok," but does nothing if "no" is selected? Also, can this prompt appear on page load? Thank you! UPDATE: Answer provided below. It turns out it's simpler ...

Having difficulty compiling Bootstrap css with grunt

After struggling for two days and finding numerous online tutorials, I still require assistance. My goal is to add a namespace to Bootstrap so that I can use it in Salesforce without conflicting with Salesforce's stylesheet. I plan on wrapping the boo ...