Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html <;表>;属性不起作用_Html_Css - Fatal编程技术网

Html <;表>;属性不起作用

Html <;表>;属性不起作用,html,css,Html,Css,我尝试添加边框并对齐我的桌子中心,但它不起作用。 原因是什么?是什么导致我的代码忽略表的属性? 到目前为止,我还尝试添加style='border:1;'到它,但它仍然不工作。 <link rel='stylesheet' href='../CSS/style.css' media="all"/> </head> <body> <!--Main Wrapper starts here!--> &

我尝试添加边框并对齐我的桌子中心,但它不起作用。 原因是什么?是什么导致我的代码忽略表的属性? 到目前为止,我还尝试添加
style='border:1;'到它,但它仍然不工作。

    <link rel='stylesheet' href='../CSS/style.css' media="all"/>
    </head>
<body>  
            <!--Main Wrapper starts here!-->
    <div class="main_wrapper"> 

            <!--Header Wrapper starts here!-->
        <div class="header_wrapper" >

        <a href='index.php'><img id="logo" src="../Pictures/logo.png"/></a>
        </div>
            <!--Header ends here!-->

            <!--Menu Bar starts here!-->
        <div class="menubar">

        <div id="form">
            <form method="get" action="results.php" enctype="multipart/form-data">
                <!--<input type="text" name="user_query"  placeholder="Search Product"/>
                <input type="submit" name="search" value="search" style='background-color:#80dfff; border:none;'/>-->
            </form> 
        </div>
        </div><!--Menubar ends here!-->

            <!--Content Wrapper here!-->
        <div class="content_wrapper">

            <!--CONTENT AREA starts here-->
            <div id="content_area">
            <a href='admin_login.php' style='color:white; font-size:20px; position:absolute;top:275px; right:210px;'>
            Logout</a>

            <table align ='center' border = '1'>
            <tr>
                <td>CustomerID</td>
                <td>ItemID</td>
                <td>Price</td>
                <td>Quantity</td>
                <td>Total</td>
                <td>Date</td>
            </tr>

            </table>
            </div><!--END OF CONTENT AREA-->
        </div><!--Content Wrapper ends here!-->
        <div id="footer"><h2 style='text-align:center; padding-top:25px;'>&copy; Jerlon Buenconsejo 2015</h2> </div>
    </div><!--Wrapper-->
</body>
</html> 

我在浏览器中尝试了该代码,它确实将表格居中并添加边框。我猜css中有一些样式覆盖了表内联样式。注释掉样式表链接以查看结果,如果是这样,请查看css文件以找到它。@amespower我已经编辑了它并添加了样式表。是的,它与根据您在问题中设置的期望添加的样式一起工作,带边框和居中。检查小提琴:什么不起作用?如果你的样式表覆盖了你的内联样式,你可以尝试添加
!重要信息
为内联样式提供优先级。例如,
table align=“center!important;”
。使用浏览器“检查元素”工具查看发生了什么。
body{

    background:url('../Pictures/background_login.jpg');
}

input[type='text']{

    height:50px;
    width: 250px;
    padding-left: 20px;
    margin-left: 20px;
    opacity: .5;
    border: none;
}
input[type='password']{

    height:50px;
    width: 250px;
    padding-left: 20px;
    margin-left: 20px;
    opacity: .5;
    border: none;
}

input[type='submit']{
    position:relative;
    top:-330px;
    left:50px;
    height:50px;
    width: 250px;
    padding-left: 20px;
    margin-left: 20px;
    border: none;
    border-radius: 11px;
    background-color:#27b061 ;
}

label{

    font-family:courier;
    font-size: 18;
    display:inline;
    color:white;


}

#emailtext{
    margin-left: 52px;
}
#login_wrapper{
margin-top:150px;

}

.formdata{
position:relative;
top:-350px;
padding:10px;
padding-left:10px;
text-align: center;
}