Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialGuillermo Gomez
7,413 PointsCss Validation error
I'm having the next error when I try to validate my css:
Disculpas! Hemos encontrado las siguientes errores (1) URI : TextArea Error de análisis sintáctico @media screen and (min-width: 660px){ /********************************* HEADER **********************************/ nav { background:none; float:right; font-size: 1.125em; margin-right: 5%; text-align: right; } #logo { float: left; margin-left: 5%; text-align: left; } h1{ font-size: 2.5em; } h2{ font-size: 0.825em; margin-bottom: 20px; } header{ border-bottom: 7px solid #599a68; margin-bottom: 60px; } }
The error type in english is something like "Syntactic analysis error" Does anybody know what can it be? I've try to check the css for typos but I've find none.
5 Answers
Wayne Priestley
19,579 PointsHi Guillermo,
When you use the whole file your getting the error because your missing a closing bracket after the first media query. Add one and you'll be fine.
:)
James Anwyl
Full Stack JavaScript Techdegree Graduate 49,960 PointsWhat validator are you using? I used the W3C validator and it said "Contratulations. No error found"
Guillermo Gomez
7,413 PointsThat was the one I was using actualy, now i've copy-pasted just the returned errored code and it validates just fine, but when I try to validate the whole file it gives me that error:
@media screen and (min-width: 480px) {
/*********************************
TWO COLUM LAYOUT
**********************************/
#primary{
width: 50%;
float: left;
}
#secondary{
width: 40%;
float: right;
}
/*********************************
PAGE: PORTFOLIO
**********************************/
#gallery li{
width: 28.3333%;
}
#gallery li:nth-child(4n){
clear: left;
}
/*********************************
PAGE: ABOUT
**********************************/
img.profile-photo {
float: left;
margin: 0 5% 80px 0;
}
@media screen and (min-width: 660px){
/*********************************
HEADER
**********************************/
nav {
background:none;
float:right;
font-size: 1.125em;
margin-right: 5%;
text-align: right;
}
#logo {
float: left;
margin-left: 5%;
text-align: left;
}
h1{
font-size: 2.5em;
}
h2{
font-size: 0.825em;
margin-bottom: 20px;
}
header{
border-bottom: 7px solid #599a68;
margin-bottom: 60px;
}
}
Wayne Priestley
19,579 PointsHi Guillermo,
So I put this code into the validator and got no errors:
@media screen and (min-width: 660px){
/********************************* HEADER **********************************/
nav {
background:none;
float:right; font-size: 1.125em;
margin-right: 5%;
text-align: right;
}
#logo {
float: left;
margin-left: 5%;
text-align: left;
}
h1{
font-size: 2.5em;
}
h2{
font-size: 0.825em;
margin-bottom: 20px;
}
header{
border-bottom: 7px solid #599a68; margin-bottom: 60px;
}
}
Guillermo Gomez
7,413 PointsYes, I know, I've tried to validate just the errored part of the code and it gives me no error, but when I try to validate the whole code (I pasted it in the previous comment) it gives me the mentioned error : /
Jonathan Gurr
Courses Plus Student 1,859 PointsCould it be something to do with the html code? Instead of the CSS.
Guillermo Gomez
7,413 PointsI'm just pasting the css code into the validator, not linking to the webpage, so the validator knows nothing about the html. But even when I try to validate the uri for css errors it mention the css file and not the html file.
Jonathan Gurr
Courses Plus Student 1,859 PointsGuillermo Wayne found the error it is a missing } after
img.profile-photo { float: left; margin: 0 5% 80px 0;
Wayne Priestley
19,579 PointsWayne Priestley
19,579 PointsAdd
}
to the code above.Guillermo Gomez
7,413 PointsGuillermo Gomez
7,413 PointsIt worked perfectly, i was checking the errored part for typos and it was actually in the last valid statement. You're great, thank you very much : )