Jump to content

Broken SVG links?


k_mckraken

Recommended Posts

So, I was using WebMatrix 3 initially, but decided to transfer over to Notepad++ because my jQuery file wasn't running.

 

Upon doing so, I moved the main folder onto my desktop for quicker access and now the links to my SVG logo files are broken. The SVG files were located in their own folder within the main folder. The file structure within the main folder is the same, so why are my images missing?

 

The rest of the CSS is working , so I know that it's still properly linked to the HTML file.

 

Also, a side note: I'm pretty sure my jQuery file is linked properly, but none of the functions are working... any solutions there?

<!DOCTYPE html><html>    <head>        <title>Template Site | Welcome!</title>        <link type="text/css" rel="stylesheet" href="site.css"/>        <script type="text/javascript" src="script.js"></script>     </head>

And the CSS:

.logo-tag {    display: inline-block;    height: 100px;    width: 100px;    background-image: url("../SVG/NSV2.svg");    float: left;

And the jQuery, if anyone is interested:

$(document).ready(function() {    $(".splash-sqr-med").mouseenter(function() {        $(this).fadeTo("fast", 0.1);    });});

Any help is greatly appreciated! Thank you!

Link to comment
Share on other sites

I have the jQuery file listed as the script.js file. That's how I was taught to save and link it. My folder hierarchy is this: C:Users(username)DesktopNeverSleep_Demo

 

The NeverSleep_Demo folder contains the HTML, CSS, and JS files along with two folders labelled IMG and SVG. Within the SVG folder are the AI and SVG files for the logos.

 

I hope this was helpful.

Link to comment
Share on other sites

If script.js is actually jquery-2.1.4.min.js then where is the jQuery code you posted above?

 

Also it would seem that...

background-image: url("../SVG/NSV2.svg");

...should be...

background-image: url("./SVG/NSV2.svg");
Link to comment
Share on other sites

Well, I learned jQuery, initially, from codecademy.com who didn't explain that part, probably because their editor has it built in. I'll look over the tutorial on w3schools and see what I need to do. Thank you for the help!

 

EDIT: Also, the CSS fixed worked and I solved my jQuery issue, thanks again!

Edited by k_mckraken
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...