2016-08-09 11 views
1

'top2'の背景色が薄い緑色になります。しかし、それはCSSが動作していないようです!私がテキスト「オンラインディスカッションポータル」を垂直に中心にしたいので、「左」部門のセルパディングは機能しません。div id背景色が表示されない

助けてください。

account.php

<?php 
require 'connection.php'; 
session_start(); 

if(!isset($_SESSION['id'])) { 
    header("location:login.php"); 
} else { 
?> 

<!doctype html> 
<html> 
<head> 
    <title>welcome</title> 
    <link href="acc.css" type="text/css" rel="stylesheet" media="all" /> 

    <style> 
    table { 
     table-layout:fixed; 
     width:1030px; 
    } 

    body { 
     background-image: url("border1.jpg"); 
     background-size:cover; 
    } 
    </style> 

</head> 

<body> 

    <div id="top1"> 

     <div id="left"> 
      <h4> <center> <font color="green"> ONLINE DISCUSSION PORTAL </font> </center> </h4> 
     </div> 

     <div id="middle"> 
      </h4> 
      <center> <i> <a href="notification.php" class="class1"> Notifications </a> </i> </center> 
      </h4> 
     </div> 

     <div id="right"> 
      </h4> 
      <center> <i> <a href="logout.php" class="class1"> Logout </a> </i> </center> 
      </h4> 
     </div> 

    </div> 

    <div id="top2"> 
     <table height="60px" width="1030px"> 
      <tr> 
       <th> <u> <a href="forum.php" class="class2"> Forum </a> </u> </th> 
       <th> <u> <a href="questions.php" class="class2"> My Questions </a> </u> </th> 
       <th> <u> <a href="answers" class="class2"> My Answers </a> </u> </th> 
      </tr> 
     </table> 
    </div> 


    <div id="content"> 

     <h3> You are Logged in. </h3> 
    </div> 

</body> 

</html> 


<?php 

} 

CSS

acc.css A.class1 { 
    color: green; 
} 
A.class1:link { 
    text-decoration: none; 
    color: green; 
} 
A.class1:visited { 
    text-decoration: none; 
    color: green; 
} 
A.class1:hover { 
    text-decoration: underline; 
    color: red; 
} 
A.class1:active { 
    text-decoration: none; 
    color: green; 
} 
A.class2 { 
    color: white; 
} 
A.class2:link { 
    text-decoration: none; 
    color: white; 
} 
A.class2:visited { 
    text-decoration: none; 
    color: white; 
} 
A.class2:hover { 
    text-decoration: underline; 
    color: yellow; 
} 
A.class2:active { 
    text-decoration: none; 
    color: white; 
} 
#top1 { 
    height: 40px; 
    width: 1030px; 
    border: 1px solid #008000; 
    font-family: whimsy TT; 
    margin: auto; 
    margin-top: 50px; 
} 
#left { 
    border: 1px solid #008000; 
    height: 25px; 
    width: 624px; 
    float: left; 
    margin: auto; 
    color: 82b52f; 
    padding-bottom: 15px; 
} 
#middle { 
    border: 1px solid #008000; 
    height: 32px; 
    width: 200px; 
    float: left; 
    margin: auto; 
    color: white; 
    padding-top: 8px; 
} 
#right { 
    border: 1px solid #008000; 
    height: 32px; 
    width: 200px; 
    float: left; 
    margin: auto; 
    color: white; 
    padding-top: 8px; 
} 
#top2 { 
    background-color: 82b52f; 
    height: 60px; 
    width: 1030px; 
    border: 1px solid #008000; 
    font-family: whimsy TT; 
    margin: auto; 
    color: white; 
} 
#content { 
    border: 1px solid #008000; 
    height: 430px; 
    width: 1030px; 
    margin: auto; 
} 

答えて

1

あなたは色・背景プロパティの#を欠場。したがって、それはbackground-color:#82b52f になるはずです<center>タグを削除する必要があります。あなたはカラーコードの前にハッシュ記号#が欠落している

+0

私は、テキストのオンラインディスカッション・フォーラム」です...左除算を意味しました。私は中心にhorzntlyだけでなく、垂直方向にテキストをb!垂直にセンタリングするためには、セルのパディングを使用する必要があります。私はパディングボトムタグを使用していますが、それは動作しません。 –

+0

と色がハッシュ.... withxxxxx –

+0

h4タグのマージンのプロパティを変更 – Geding

0

acc.css 
 

 

 
A.class1 {color:green;} 
 
A.class1:link {text-decoration: none; color: green;} 
 
A.class1:visited {text-decoration: none; color: green;} 
 
A.class1:hover {text-decoration: underline; color: red;} 
 
A.class1:active {text-decoration: none; color: green;} 
 

 

 
A.class2 {color:white;} 
 
A.class2:link {text-decoration: none; color: white;} 
 
A.class2:visited {text-decoration: none; color: white;} 
 
A.class2:hover {text-decoration: underline; color: yellow;} 
 
A.class2:active {text-decoration: none; color: white;} 
 

 
#top1 
 
{ 
 
height:40px; width:1030px; border:1px solid #008000; font-family:whimsy TT; margin:auto; margin-top:50px; 
 
} 
 

 
#left 
 
{ 
 
border:1px solid #008000; height:25px; width:624px; float:left; margin:auto; color:82b52f; padding-bottom:15px; 
 
} 
 

 
#middle 
 
{ 
 
border:1px solid #008000; height:32px; width:200px; float:left; margin:auto; color:white; padding-top:8px; 
 
} 
 

 
#right 
 
{ 
 
border:1px solid #008000; height:32px; width:200px; float:left; margin:auto; color:white; padding-top:8px; 
 
} 
 

 

 
#top2 
 
{ 
 
background-color:#82b52f; height:60px; width:1030px; border:1px solid #008000; font-family:whimsy TT; margin:auto; color:white; 
 
} 
 

 

 
#content 
 
{ 
 
\t border:1px solid #008000; height:430px; width:1030px; margin:auto; 
 
}
account.php 
 

 
<?php 
 

 
require 'connection.php'; 
 

 
?> 
 

 
<?php 
 

 
    
 
session_start(); 
 
if(!isset($_SESSION['id'])) 
 
{ 
 
\t header("location:login.php"); 
 
} 
 
else 
 
{ 
 
\t ?> 
 

 
<!doctype html> 
 
<html> 
 
<head> 
 
<title>welcome</title> 
 
<link href="acc.css" type="text/css" rel="stylesheet" media="all" /> 
 

 

 
<style> 
 

 
table { 
 
\t table-layout:fixed; 
 
\t width:1030px; 
 
} 
 

 
body { 
 
\t background-image: url("border1.jpg"); 
 
\t background-size:cover; 
 
} 
 
</style> 
 

 
</head> 
 

 

 
<body> 
 

 
<div id="top1"> 
 

 
<div id="left"> 
 
    <h4> <center> <font color="green"> ONLINE DISCUSSION PORTAL </font> </center> </h4> 
 
</div> 
 

 
<div id="middle"> 
 
</h4> <center> <i> <a href="notification.php" class="class1"> Notifications </a> </i> </center> </h4> 
 
</div> 
 

 
<div id="right"> 
 
</h4> <center> <i> <a href="logout.php" class="class1"> Logout </a> </i> </center> </h4> 
 
</div> 
 

 
</div> 
 

 
<div id="top2"> 
 
    <table height="60px" width="1030px"> 
 
    <tr> 
 
     <th> <u> <a href="forum.php" class="class2"> Forum </a> </u> </th> 
 
     <th> <u> <a href="questions.php" class="class2"> My Questions </a> </u> </th> 
 
     <th> <u> <a href="answers" class="class2"> My Answers </a> </u> </th> 
 
    </tr> 
 
    </table> 
 
</div> 
 

 

 
<div id="content"> 
 

 
<h3> You are Logged in. </h3> 
 
</div> 
 

 
</body> 
 
</html> 
 

 

 
<?php 
 
\t 
 
} 
 

 
?>

+0

ハッシュで動作します.... thanx –

関連する問題