Lexical Error Css
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the
Lexical Error Encountered
company Business Learn more about hiring developers or posting ads with us Stack Overflow css validator Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2
Html Validator
million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up CSS3 Parse Error Lexical error up vote 0 down vote favorite I keep getting this error and am not sure why it pops up when I validate it. Can anyone explain this to me and how to fix it? The error is this: 246 #copyright Parse Error Lexical error at line 249, column 2. Encountered: " " (32), after : "@" Here is the code. I am starting with line 246, which I guess where it starts...not really understanding what is going on here. Line 246 is the closing bracket for my smartphone css. I can post that also if you need it. Much appreciated. } /* ----- Tablet ----- */ @ media screen (min-width: 481px) and (max-width: 769px) { div#wrapper{ margin: 0 auto; padding: 1em; width: 98%; } header h1 { font-size: 1.8em; } } css css3 validation parse-error share|improve this question edited Jun 23 '14 at 5:26 BoltClock♦ 385k959371048 asked Jun 23 '14 at 5:15 floyd 61118 add a comment| 2 Answers 2 active oldest votes up vote 1 down vote accepted The error message is saying that the parser encountered a space " " after the "@" following line 246. The space is not supposed to be there, hence the parse error; you need to remove it. You are also missing an and from this media query. Here is the correct syntax: @media screen and (min-width: 481px) and (max-width: 769px) { share|improve this answer answered Jun 23 '14 at 5:29 BoltClock♦ 385k959371048 Thank, I am going to try this out and see if that works. –floyd Jun 23 '14 at 5:34 add a comment| up vote 1 down vote There shouldn't be any space between @ and media. It should be : @media //not @ media share|improve this answer answered Jun 23 '14 at 5:30 DareDev1l 15210 add a comment| Your Answer
W3C CSS Validation Service? If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 7 of 7 Thread: What causes "Lexical error" messages using The W3C CSS Validation Service? Tweet Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 09-14-2007,11:51 AM #1 KnoxVol View Profile View Forum Posts http://stackoverflow.com/questions/24358777/css3-parse-error-lexical-error Registered User Join Date May 2007 Posts 30 What causes "Lexical error" messages using The W3C CSS Validation Service? I'm trying to validate my style sheet programming using The W3C CSS Validation Service: http://jigsaw.w3.org/css-validator/ It's giving the following error message Lexical error at line 1, column 3. Encountered: "D" (68), after : " http://www.webdeveloper.com/forum/showthread.php?160745-What-causes-quot-Lexical-error-quot-messages-using-The-W3C-CSS-Validation-Service
Can anybody see what's causing the error? Thanks. Reply With Quote 09-14-2007,01:17 PM #2 ray326 View Profile View Forum Posts Visit Homepage Got Link? Join Date Nov 2003 Location Jerryville, Tejas Posts 11,715 That's HTML, not CSS. Is that the problem? "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." Brian W. Kernighan Reply With Quote 09-14-2007,01:50 PM #3 dtm32236 View Profile View Forum Posts You're a nerd. Join Date Aug 2007 Location New Jersey, US Posts 1,779 http://validator.w3.org/ that's what you want validate your CSS with a CSS validator Reply With Quote 09-15-2007,08:36 AM #4 KnoxVol View Profile View Forum Posts Registered User Join Date May 2007 Posts 30 ray326, dtm32236; Thanks for responding. I appreciate the input. What I'm trying to do is validate the CSS. I figured out what was causing the error message. I was copying and pasting all of the Html, instead of just the CSS, from the web page source code into the validator. This page says "Enter the CSS you would like validated:" http://jigsaw.w3.org/css-validator/#validate-by-input You can run the whole web page through the CSS validator.move on to CSS validation. You may find this a little trickier at first, because instead http://ifyoucodeittheywill.com/2009/04/easily-find-and-correct-errors-in-your-css/ of "mismatched" start and end tags, you run into things like http://w3schools.invisionzone.com/index.php?showtopic=34530 "parse errors" and "lexical errors," and when you run into one of these, the error is usually somewhere before the area that is pointed out to you by the validator. Take, for example, this CSS I found on the web, which is lexical error incidentally one good reason to make your CSS more readable to the human eye… span.username a, span.postname {color:#777777;}font-family:verdana;font-size:18px}
blockquote {border-width:1px;border-style:solid;border-color:#777777;background-color:#777777;font-family:verdana;font-size:18px;color:#FFFFFF;}
blockquote hr {display:none}
blockquote {background-color:transparent;
border: 2px inset:#FF1493;
font:bold 14px verdana;
color:#CD00CD;
} Run the above CSS through w3c's CSS Validator, and it gives you these errors: lexical error css 1 Unknown pseudo-element or pseudo-class :verdana 1 font-family Parse Error verdana; 2 Parse Error :18px} blockquote 5 blockquote Value Error : border attempt to find a semi-colon before the property name. add it 5 blockquote Property inset doesn't exist : #ff1493 Line 1 in the CSS says this: span.username a, span.postname {color:#777777;}font-family:verdana;font-size:18px} Notice that } before "font-family." Because of that, the validator (and browsers) think font-family is a tag name and :verdana is a pseudoclass of that tag name. Now we come to line 2, which complains about ":18px} blockquote." What it's really complaining about is the end of line 1, combined with the first part of line 2, which together reads: }font-family:verdana;font-size:18px}
blockquote It's the same } before "font-family" which caused the line 1 errors, that is causing the line 2 error, as well. Remove that } and run the CSS through the validator again… span.username a, span.postname {color:#777777; font-family:verdana;font-size:18px}
blockquote {border-width:1px;border-style:solid;border-color:#777777;background-color:#777777;font-family:verda
Detected You currently have javascript disabled. Several functions may not work. Please re-enable javascript to access full functionality. validation error Started by niche, Nov 08 2010 08:13 PM Please log in to reply 3 replies to this topic #1 niche niche Devoted Member Members 3,324 posts Gender:Male Location:Lincoln, Nebraska, USA Interests:God, niche marketing, inventing, coding, building large scale models, sci fi Languages:php, mysql, html, css, javascript (learning) Posted 08 November 2010 - 08:13 PM url = http://www.lincolnsr...om/temp107g.phpthree errors:Unknown error org.w3c.css.parser.analyzer.TokenMgrError: Lexical error at line 1, column 58. Encountered: after : "" Unknown error org.w3c.css.parser.analyzer.TokenMgrError: Lexical error at line 1, column 58. Encountered: after : "" Unknown error org.w3c.css.parser.analyzer.TokenMgrError: Lexical error at line 1, column 58. Encountered: after : "" don't know what it means after googling. Edited by niche, 08 November 2010 - 09:43 PM. "It will always be true that there are more categories of human endeavor that haven't been invented than ever have been invented in the history of mankind. Yet, most people work at jobs created by someone long dead or long retired and few of them understand why their jobs are disappearing and what to do about it. The people, that frequent these forums, are not among these enslaved masses. With each post, we develop our sense that the difference between what can be imagined and what can be accomplished has never been smaller." Back to top #2 thescientist thescientist Likes gettin' it on! Moderator 8,633 posts Gender:Male Location:Rhode Island, USA Interests:Music, programming, computers, web design, business, books, and politics. Languages:HTML/CSS, JS, PHP/MySQL, XML, bash, SVN/Git, Java, Python Posted 08 November 2010 - 08:21 PM page seems fine to me, aside from the PHP code at the bottom myTunes: www.analogstudios.net my {...} code {...} works in all the decent browsers. This of course means that it does not work in IE. Back to top #3 niche niche Devoted Member Members 3,324 posts Gender:Male Location:Lincoln, Nebraska, USA Interests:God, niche marketing, inventing, coding, building large scale models, sci fi Languages:php, mysql, html, css, javascript (learning) Posted 08 November 2010 - 08:43 PM I took out the php at the bottom and am