Skip to main content
Inspiring
November 29, 2019
Answered

Expected LBRACE at Line 1 col 2

  • November 29, 2019
  • 2 replies
  • 9623 views

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

 

@11220649-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? 

This topic has been closed for replies.
Correct answer Damo Quinn

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.

2 replies

Jon Fritz
Community Expert
Community Expert
December 2, 2019

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.

Damo QuinnAuthorCorrect answer
Inspiring
December 2, 2019

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.

Legend
November 29, 2019

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.

 

 

Nancy OShea
Community Expert
Community Expert
November 29, 2019

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

 

 

 

Nancy O'Shea— Product User & Community Expert
Inspiring
November 29, 2019

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

 

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