0

I've looked on here and managed to get my css file to work with php, however when I validate it, I get errors, specifically:

Unknown error org.w3c.www.http.HttpInvalidValueException: Invalid content type.

The file in question is medium.php

The html to link to the file reads:

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" type="text/css" href="medium.php" media="screen and (max-width: 1024px)" />

The CSS/PHP file starts like this:

  <?php header("Content-type: text/css; charset: UTF-8");

include 'login.php';

$link = mysql_connect($hostname,$username,$password);
mysql_select_db($database) or die("Unable to select database");

Anyone know how to correct this so it formats correctly and does not generate an error please?

1 Answer 1

6

charset: UTF-8 is incorrect syntax; replace with charset=utf-8.

Sign up to request clarification or add additional context in comments.

2 Comments

+1. Also, delete the whitespace before the opening <?php tag in the css/php file
Thanks Peter, there isn't any however, just happened to copy that way. Annoying.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.