2014-02-23 40 views
0
<!DOCTYPE html> 
<html> 
<head> 
<meta charset="UTF-8"> 
<title>php-login-advanced</title> 
<style type="text/css"> 
    <LINK href="style.css" rel="stylesheet" type="text/css"> 
    body { 
     font-family: Arial, sans-serif; 
     font-size: 12px; 
     margin: 10px; 
    } 
    label { 
     position: relative; 
     vertical-align: middle; 
     bottom: 1px; 
    } 
    input[type=text], 
    input[type=password], 
    input[type=submit], 
    input[type=email] { 
     display: block; 
     margin-bottom: 15px; 
    } 
    input[type=checkbox] { 
     margin-bottom: 15px; 
    } 
</style> 
</head> 
<body> 

<?php 
// show potential errors/feedback (from login object) 
if (isset($login)) { 
if ($login->errors) { 
    foreach ($login->errors as $error) { 
     echo $error; 
    } 
} 
if ($login->messages) { 
    foreach ($login->messages as $message) { 
     echo $message; 
    } 
} 
} 
?> 

<?php 
// show potential errors/feedback (from registration object) 
if (isset($registration)) { 
if ($registration->errors) { 
    foreach ($registration->errors as $error) { 
     echo $error; 
    } 
} 
if ($registration->messages) { 
    foreach ($registration->messages as $message) { 
     echo $message; 
    } 
} 
} 
?> 

我試圖讓我所有的.php頁面與.html頁面匹配。如何使我的_header.php與.css協同工作?我需要對_footer.php做些什麼嗎?提前致謝。試圖讓我的整個網站匹配。_header.php不會鏈接到.css

回答

0

非法HTML/CSS。任何你放在<style>必須是有效的CSS。你有一個<link>元素,它不是css。

嘗試

<LINK href="style.css" rel="stylesheet" type="text/css"> 
<style type="text/css"> 
    ... blah blah blah... 
</style> 
+0

都能跟得上仍然沒有工作這種方式無論是。 – user3335963

+0

可能是因爲「type =:text/css」>兩次?一次在鏈接中,一次在鏈接之下。 – user3335963

+0

Doens't問有多少/幾次你有類型在那裏。上面的CSS完全被破壞了,因爲你已經在樣式塊中放置了一個html鏈接標記。這就像做''。在腳本塊內的HTML不是JavaScript,並且是一個徹頭徹尾的語法錯誤,就像你的鏈接在css –