Highlighted

Expected LBRACE at Line 1 col 2

Explorer ,
Nov 29, 2019

Copy link to clipboard

Copied

Hi,

 

I am trying to write something to my main.css and I am getting the above error message.  Can anyone help me and the code in question is as follows

 

@font-face {
	font-family: 'HeyAlice' cursive;
	src: url("../fonts/HeyAlice-Regular.otf");
}

It is at the very top of the CSS.  Is that the correct place for it? 

I have had a friend who is a web developer down in Devon, UK, help me with it and between us, we have got it sorted.  Apparently there were 3 weird characters at the start when he looked at the CSS through a HexViewer.

Topics

Code, Error

Views

979

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Expected LBRACE at Line 1 col 2

Explorer ,
Nov 29, 2019

Copy link to clipboard

Copied

Hi,

 

I am trying to write something to my main.css and I am getting the above error message.  Can anyone help me and the code in question is as follows

 

@font-face {
	font-family: 'HeyAlice' cursive;
	src: url("../fonts/HeyAlice-Regular.otf");
}

It is at the very top of the CSS.  Is that the correct place for it? 

I have had a friend who is a web developer down in Devon, UK, help me with it and between us, we have got it sorted.  Apparently there were 3 weird characters at the start when he looked at the CSS through a HexViewer.

Topics

Code, Error

Views

980

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
LEGEND ,
Nov 29, 2019

Copy link to clipboard

Copied

Normally you would insert a comma after the font-family like below:

@font-face {
	font-family: 'HeyAlice', cursive;
	src: url("../fonts/HeyAlice-Regular.otf");
}

 

However its just possibly that Dreamweaver does not understand @font-face {} and so throws a warning/error.

Linting is NOT totally reliable, often a warning or error is reported when there is not one.

 

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Adobe Community Professional ,
Nov 29, 2019

Copy link to clipboard

Copied

@font-face throws no errors for me.  I think the comma is what's missing.

 

 

 

Nancy O'Shea, ACP
Alt-Web.com

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Explorer ,
Nov 29, 2019

Copy link to clipboard

Copied

I saw that and corrected it.  I still am getting the error.

 

@font-face {
	font-family: 'HeyAlice', cursive;
	src: url("../fonts/HeyAlice-Regular.otf");
}

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Adobe Community Professional ,
Nov 29, 2019

Copy link to clipboard

Copied

I think the error is probably caused by something else in your code.

Use the online validation service.

https://jigsaw.w3.org/css-validator/

Nancy O'Shea, ACP
Alt-Web.com

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Explorer ,
Nov 29, 2019

Copy link to clipboard

Copied

Okay, now I'm totally baffled.  It likes my CSS, apart from the webkit stuff, but the '@font-face' business, it doesn't see an error.  Does this mean that the LBRACE error is a bug? Or should I be worried about it?

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Adobe Community Professional ,
Nov 30, 2019

Copy link to clipboard

Copied

If the code works when tested on all devices and browsers, don't worry about the alleged error.  Code linting is what it is.  It's not perfect.

 

 

 

 

 

Nancy O'Shea, ACP
Alt-Web.com

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Adobe Community Professional ,
Dec 02, 2019

Copy link to clipboard

Copied

The error you are seeing is often caused by something in your code confusing DW's near useless Linter into marking lines of code that are otherwise fine. For example: having the odacity to use the fr unit when working with CSS Grid will throw that error.

Turn Linting off in your preferences and use the online resources like https://jigsaw.w3.org/css-validator/ for CSS validation and https://validator.w3.org/nu/ for HTML.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Explorer ,
Dec 02, 2019

Copy link to clipboard

Copied

I have had a friend who is a web developer down in Devon, UK, help me with it and between us, we have got it sorted.  Apparently there were 3 weird characters at the start when he looked at the CSS through a HexViewer.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Resources
Learn Resources
Add a group