Jump to content

Syntax Error on line 1

Recommended Posts

Site URL: https://www.kinestheticskills.com/

Hi, 

I cant figure out whats wrong on my CCS. I get a syntax error on line 1. If I delete it, it points on the following line etc. It is a picture I needed a URL for. I have uploaded many pictures for site backgrounds.

Do you have any ideas on what to do? Thank you!

The line is as following: https://static1.squarespace.com/static/57c0aaa8bebafbec82d0fbfe/t/61603b23e842ed0479100cf3/1633696550032/OLY+background/IMG_5513.jpg

Edited by Zewel
spelling mistakes

Fysiotherapist bored of Wordpress hoping Squarespace will make a huge difference for his freelance job.

Link to comment

Hi @Wolfsilon!

Sure, thank you.

This is what is used for the background on the Page setting under Advanced:

<style type="text/css">
 
 #outerWrapper {
   background-image: url("https://static1.squarespace.com/static/57c0aaa8bebafbec82d0fbfe/t/61603b23e842ed0479100cf3/1633696550032/OLY+background.IMG_5513.jpg");
   
   background-repeat: no-repeat;
   background-position: center center;
   background-size: cover;
   background-attachment: fixed;
 }
 
 </style>

Fysiotherapist bored of Wordpress hoping Squarespace will make a huge difference for his freelance job.

Link to comment

Are you trying to add a background image to just one section? Adding an image using the Advanced > Code Injection isn't normally how you do this unless you have direct control on the "#outerWrapper". Meaning, the outerWrapper doesn't exist without your code. But, in my experience, I believe it's built in. I'd consider just using Custom CSS and applying the background through that menu only.

If you're saying that the code above is currently in your Custom CSS menu, you're likely running into the Syntax error because you cannot have "<style>" tags in this menu and you might just need to remove both of them and leave the innermost CSS.

Link to comment
On 11/3/2021 at 11:21 PM, Wolfsilon said:

Are you trying to add a background image to just one section? Adding an image using the Advanced > Code Injection isn't normally how you do this unless you have direct control on the "#outerWrapper". Meaning, the outerWrapper doesn't exist without your code. But, in my experience, I believe it's built in. I'd consider just using Custom CSS and applying the background through that menu only.

If you're saying that the code above is currently in your Custom CSS menu, you're likely running into the Syntax error because you cannot have "<style>" tags in this menu and you might just need to remove both of them and leave the innermost CSS.

Hi @Wolfsilon and thanks for reply!

I am adding background image to every page I have using the above mentioned code in Advanced >code injection. So it is not in my custom CSS menu. There I only upload those pictures used in background.  

If I understand correct I shouldn't be using the Advanced section for it?

Any idea what the issue can be?

Thank you!

Fysiotherapist bored of Wordpress hoping Squarespace will make a huge difference for his freelance job.

Link to comment
  • 9 months later...

Hello could someone please help me on this?

Im using Aviator, Trombone Shorty theme. My page https://www.kinestheticskills.com/lubomirkafonek

Each photo on my site is stretched and when scrolling down the the photo is scrolling with the page instead of being static. I havent changed anything in coding. But it says Syntax Error on line 1.  Any idea what to do?

What I used in Page Settings/ Advanced : on each page is this: 

<style type="text/css">
#outerWrapper {
   background-image: url("http://static1.squarespace.com/static/57c0aaa8bebafbec82d0fbfe/t/57cd4600c534a5dcc4369d8b/1473070599024/1.jpg");
   background-repeat: no-repeat;
   background-position: center center;
   background-size: cover;
   background-attachment: fixed;
 }
  
   </style>

 

Fysiotherapist bored of Wordpress hoping Squarespace will make a huge difference for his freelance job.

Link to comment
9 hours ago, Zewel said:

But it says Syntax Error on line 1.

Page Settings > Advanced > Page Header Code Injection don't report syntax errors. It sounds like you are talking about Design > Custom CSS.

If I had to guess you've put a <style> tag in Design > Custom CSS. Design > Custom. CSS doesn't understand HTML tags.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment

Hello Creedon and thank you very much for quick reply!!!

Yes you are right, it is in Design>Custom CSS where I get to see the syntax error ,sorry for the unclear description. 

I have used the <style> tag only in Page Settings/ Advanced. Is that wrong?

Below is what I have in Design>Custom CSS : just links to photos and one code in the end..

Thank you for your time!

 

https://static1.squarespace.com/static/57c0aaa8bebafbec82d0fbfe/t/61603b23e842ed0479100cf3/1633696550032/OLY+background/IMG_5513.jpg

https://static1.squarespace.com/static/57c0aaa8bebafbec82d0fbfe/t/57eb7de92994cae67c07014e/1475050985807/13606868_1006971339399233_2773698822222552557_n.jpg

https://static1.squarespace.com/static/57c0aaa8bebafbec82d0fbfe/t/57ea4f18f7e0ab1a344b0807/1474973465838/background+contact.jpg

https://static1.squarespace.com/static/57c0aaa8bebafbec82d0fbfe/t/57ea4f18f7e0ab1a344b0807/1474973465838/background+contact.jpg

http://static1.squarespace.com/static/57c0aaa8bebafbec82d0fbfe/t/57dd5318725e2573714c3bb4/1474122524067/IMG_7185.JPG

http://static1.squarespace.com/static/57c0aaa8bebafbec82d0fbfe/t/57daa0ce59cc6819438f71f0/1473945806585/13718568_1007876795975354_1319907471751798249_n.jpg

http://static1.squarespace.com/static/57c0aaa8bebafbec82d0fbfe/t/57da9dd303596e21e42a1119/1473945044375/Movement+classes+course.jpg

http://static1.squarespace.com/static/57c0aaa8bebafbec82d0fbfe/t/57d6e3a1f7e0ab29571987a4/1473700769547/13669023_1007876539308713_8875973563280660084_n.jpg

http://static1.squarespace.com/static/57c0aaa8bebafbec82d0fbfe/t/57d6dd8620099e32e85a7e26/1473699207274/13754107_1006970942732606_1242551558740232710_n.jpg

http://static1.squarespace.com/static/57c0aaa8bebafbec82d0fbfe/t/57cd9f7715d5db35c681502a/1473093496227/profile+picture+skype+KS.jpg

http://static1.squarespace.com/static/57c0aaa8bebafbec82d0fbfe/t/57cda2d5440243f4dee0b6f6/1473094360912/Workshops.JPG

https://static1.squarespace.com/static/57c0aaa8bebafbec82d0fbfe/t/6160a2d5678246069ad471d1/1633723098322/Squat+workshop+new.jpg

https://static1.squarespace.com/static/57c0aaa8bebafbec82d0fbfe/t/6160a536678246069ad4a6b7/1633723706072/Profile+photo.jpg

http://static1.squarespace.com/static/57c0aaa8bebafbec82d0fbfe/t/57d5c048725e254062261206/1473626192637/Worskhops+background.jpg

https://static1.squarespace.com/static/57c0aaa8bebafbec82d0fbfe/t/6160b91e34ef2b52e3c4942a/1633728803443/IMG_5200.jpg

https://static1.squarespace.com/static/57c0aaa8bebafbec82d0fbfe/t/6160bf8ddf20482dec0ec0e5/1633730449228/IMG_5351.jpg

1. #page-title {
2. display: none; }
#title-area h1 
{display: none !important;}

Fysiotherapist bored of Wordpress hoping Squarespace will make a huge difference for his freelance job.

Link to comment

I just tried to open my web at Safari browser and there the background is just normal..

While at Google Chrome it makes background stretched..Could it be because of CSS coding?

Fysiotherapist bored of Wordpress hoping Squarespace will make a huge difference for his freelance job.

Link to comment

If your CSS field looks like the following, starting with an image URL, that is not CSS syntax. That is why you are getting a syntax error on line 1.

583504463_ScreenShot2022-08-24at3_16_19PM.thumb.png.c1db7ec90589306bb40bfe7293a22832.png

The image URLs should be removed.

Also there are syntax errors in the rule-sets. It should look like the following.

#page-title {

  display : none;
  
  }

#title-area h1 {

  display : none !important;
  
  }

 

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment

Hello Creedon!

Problem solved! I had no idea the photo links can/should be removed once I get the URLs for my backgrounds photos. 

I corrected the rule-sets and it works all fine now. 

Thank you very much for your help! How can I reward you:)!

Fysiotherapist bored of Wordpress hoping Squarespace will make a huge difference for his freelance job.

Link to comment

Create an account or sign in to comment

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

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.