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 trial

HTML

error validation for meta name

I have an error for my meta name I put like this <meta name="viewport" content=width="device-width, initial-scale=1.0">

I checked so many times with the video

Here errors showed by W3C

↑ TOP

Validation Output: 4 Errors

Error Line 11, Column 39: = in an unquoted attribute value. Probable causes: Attributes running together or a URL query string in an unquoted attribute value. <meta name="viewport" content=width="device-width, initial-scale=1.0">

Error Line 11, Column 40: " in an unquoted attribute value. Probable causes: Attributes running together or a URL query string in an unquoted attribute value. <meta name="viewport" content=width="device-width, initial-scale=1.0">

Error Line 11, Column 72: " in an unquoted attribute value. Probable causes: Attributes running together or a URL query string in an unquoted attribute value. <meta name="viewport" content=width="device-width, initial-scale=1.0">

Error Line 11, Column 73: Attribute initial-scale not allowed on element meta at this point. <meta name="viewport" content=width="device-width, initial-scale=1.0"> Attributes for element meta: Global attributes name http-equiv content charset

many many thanks if somebody can help me

You might need to attach your code so anyone can have a look and help you out.

5 Answers

Try this:

<meta name="viewport" content="width=device-width, initial-scale=1">

Indeed Isaac

here my code

<!DOCTYPE html> <html>

<head> <meta charset="utf-8"> <title> Tunis D./Web designer </title> <link rel="stylesheet" href="css/normalize.css"> <link href='http://fonts.googleapis.com/css?family=Fredericka+the+Great%7CPacifico%7CHomemade+Apple%7CBuda:300' rel='stylesheet' type='text/css'> <link rel='stylesheet' href="css/main.css"> <link rel="stylesheet" href="css/responsive.css"> <meta name="viewport" content=width="device-width, initial-scale=1.0"> </head> <body> <header> <a href="index.html" id="logo"> <h1> Tunis D.</h1> <h2>Web designer</h2> </a> <nav> <ul> <li> <a href="index.html" class="selected"> Inspiration </a></li> <li><a href ="projets.html">Projets </a> </li> <li><a href="about.html">About </a></li> <li><a href="contact.html">Contact </a></li> </ul> </nav> </header>

Hi Tunis There are no meta tags in the code you posted so I can't understand what is going on. You need to specify them in the <head></head> tag and not in your <header></header> tag which is part of the <body></body> of the html file. Equally fot the stylesheet link tag, it must be in the "head":

<html>
      <head>
              <!--- Meta Tags --->
              <link rel="stylesheet" href="css/responsive.css" type="text/css">
      </head>
      <body>
              <header>
                       <a href="index.html" id="logo">
                                <h1> Tunis D.</h1>
                                <h2>Web designer</h2>
                       </a>
                      <nav>
                               <ul>
                                        <li> <a href="index.html" class="selected"> Inspiration </a></li>
                                        <li><a href ="projects.html">Projets </a> </li>
                                        <li><a href="about.html">About </a></li>
                                        <li><a href="contact.html">Contact </a></li>
                               </ul>
                      </nav>
               </header>
      </body>
</html>

Oh thanks I copy my entire index html thanks Andrei

< meta name="viewport" content=width="device-width, initial-scale=1.0" >

it works many many thanks

Cheers! :)