Atom HTML preview doesn't update when CSS is changed - html

I'm using Atom and it's HTML preview feature. If I change my CSS file, nothing happens. But then if I go to my HTML file and make any change, even just adding a space somewhere, everything updates.
I've referenced my CSS file in my HTML file as:
<link rel="stylesheet" type="text/css" href="css/style.css">
Help?

If I understand the question correctly, you are making updates to your files but when you refresh the page in the browser, you are not seeing the style changes getting applied.
If that is the case, you can do a hard reload of the page by clicking Ctrl + F5
More information here: https://refreshyourcache.com/en/cache/

If your stylesheets are external file, then your browser may store it somewhere and loads the old content. If you use Google Chrome, then press F12, navigate mouse to refresh page button (with <- and ->) buttons and right click it, you will see options on how much you want to reload. :)
Is this what you asked?
Because this is what happens to me, when I do not reload the page completely.. Before it, no new content of externa files is updated.

guys I closed and opened Atom and it fixed the updating problem but I've still got the drop down menu problem. I think I'll create a new post for that since it's probably code-related

Related

html changes won't show up in browser

I'm working on an assignment for a class where our teacher has given us a webpage built out with html and css. We are eventually supposed to create some animations with gsap, but first need to make our own edits to the webpage itself. I am using vscode and when I edit any of the html, the changes show up in my index.html, but not in the browser. Any idea why this is?
try to right click your browser and check in the sources to make sure it really saved your changes.
Try to use live server on VS Code and then whenever you save it will show up on the page.
-> https://techstacker.com/local-live-server-vscode/
Make sure you save the file and reload the page in the browser

Hover on <a href only works after a click or page refresh

I have a problem with my site.
I'm using HTML and CSS only.
I'm using several "a hrefs" that are supposed to slightly change their background colors when hovered.
The problem is, whenever I clear the browser's cache (or go into inprivate mode) I need to refresh the webpage or click on a link, which ONLY then (all of them) starts to do the hovering effect. Only by clicking a second time I'm able to open that link.
This happens in all browsers.
I have the following code on the head section.
<link href="css/sticky-menu.css?v=2.4" rel="stylesheet">
Anyone suspects what is happening here?
I've found the problem, and it's related to a third-party script, in this case from sharethis.com
I guess I'm going to contact them about this.
Thanks, anyway.

HTML won't link up to CSS when I open it again

My problem is that I linked the CSS correctly when I created my HTML file, but then when I try to edit the CSS the other day, it just didn't update my HTML file and I did save it of course. One way I can get around this is by deleting the CSS in my htdocs and creating a new stylesheet with the exact same contents then linking the new one to my HTML. Can you guys tell me why is this happening and how can I prevent this from happening again?
I think that the problem is with cache. You can try running the site in an incognito/private window of your browser.
You can also inspect the page and see if the new styles are loaded. You can also try Empty Cache and Hard Reload option when you right click the reload button on chrome browser while inspecting.
one way you can prevent it is by doing all your css in the actual html file like so
<head><style></style></head>

Why is my jQueryMobile CSS Style being applied to a linked page?

I am using a jQuery CSS style on the main portion of my website. It works fine. Now, I also have a sub-directory of my website which should not use the style. When I manually navigate my browser to the sub-directory of the website, no style is applied which is what I want. When I click on a link to the sub-directory from the main area, however, it is applying the CSS style from the main part even though I am not referencing this CSS anywhere in the HTML of that sub-directory. If I refresh the browser, the style goes away.
Please can someone help me understand what is going on here? Thank you.
You are using jquery mobile, which by default loads the content of links via ajax. That means you don't have a page refresh when clicking on a link. The contents get dynamically inserted in your document which still has all your css.
More information here.
http://jquerymobile.com/demos/1.2.0/docs/pages/page-links.html
You have to disable ajax for that link. More information here.
jquery-mobile - how can I bind disable ajax links to a certain class
Clear your history and browser data, then refresh and try.
Try to open the link in chrome and using the developer options (F12)
look for the resources it is referencing. If the page is referencing
the CSS files then either Javascript is making the referencing or
you have accidentally kept the resource link. Let the forum know your findings.
Edit
Somebody seems to have done what I have mentioned and has come to conclusions that they are because of AJAX. The steps I have mentioned above would let you do that all by yourself.

hash link reloads page

I have a code snippet that is installed on third party websites. I can't get into the details, but it loads HTML, CSS and JS onto the page through the use of a <script> tag.
Part of the code is a JS function that executes when this link is clicked:
?
If there are JS errors on the page that prevent the function from executing, clicking the link obviously just adds the hash to the URL and takes the user to the top of the page. This is the expected fallback behavior.
However, on one third party site with a multitude of JS errors, clicking the link removes everything after the top level domain, adds the hash, and directs to that page (the home page). For example, the link would take the user from:
http://www.example.com/2010/05/14/very-interesting-blog-post/
to
http://www.example.com/#
Notably, the issue occurs in Firefox and Chrome, but not IE9. I know it may be impossible to properly diagnose the issue without more detailed code, but I'm not at liberty to provide it. I'm just hoping to get some kind of reasonable explanation for this strange browser behavior.
If it helps at all, the site in question is a WordPress blog. Thanks in advance.
EDIT: This is apparently not caused by any JS on the site, because turning off JS and adding the link with the inspector produced the same behavior.
I had a similar error where clicking on any <a href="#"> causes a full page reload. I managed to solve this by removing the <base href="/"> tag from the <head> of the page. I couldn't find any informations on this (yet). I'll add more if I can find any additional info.
This problem happens when you use windows.onpopstate to handle back or forward buttons and load page using ajax. Try to solve your js code for handling history.