是CSS问题还是其他问题? [英] Is it CSS problem or something else?

查看:108
本文介绍了是CSS问题还是其他问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友

在身体"标签中有3个div:

Hello Friends

In Body tag there are 3 div :

<div class="header"></div>
<div class="menu"></div>
<div class="body"></div>



我从未在项目中使用任何边距或填充CSS属性. (css文件和webForm都同时存在)
但是,当我在浏览器中看到结果时,在第一个div上方以及在第一和第二个div之间大约有10px的空格.
t
哪种代码会导致此问题?

整个HTML代码为:



I never used any margin or padding css atribute in my project. (css file and webForm both)
But when I see the result in browsers there are about 10px spaces above the first div and also between first and second div.
t
What kind of code can cause this problem?

The whole HTML code is:

<html xmlns="http://www.w3.org/1999/xhtml">
<head  runat="server">
    <title>.:: Home ::.</title>
    <link href="StyleSheet.css" rel="Stylesheet" />
</head>
<body>
    <form id="form1"  runat="server">
    <div>
        <center>
            <div class="header">
                <h1 class="title">Asp.Net Sample</h1>
            </div>
            <div class="menu">
                <ul>
                    <li><a href="Default.aspx">Home</a></li>
                    <li><a>Contact us</a></li>
                </ul>
            </div>
            <div class="body">
                <table cellspacing="15">
                    <td class="toolbox">
                    </td>
                    <td rowspan="2" class="main">
                    </td>
                    <tr>
                        <td>
                        </td>
                    </tr>
                </table>
            </div>
        </center>
    </div>
    </form>
</body>
</html>



而这里的css文件:



And Here the css file:

.header
{
    font-family: Times New Roman;
    height: 140px;
    background-color: #854242;
    width: 60%;
}

.body
{
    height: 700px;
    background-color: #999;
    width: 60%;
}

.toolbox
{
    border-radius: 10px 10px 0 0;
    width: 110px;
    background-color: #7A7A7A;
    height: 150px;
}

.main
{
    border-radius: 10px 10px 10px 10px;
    width: 620px;
    background-color: #7A7A7A;
    height: 500px;
}

.menu
{
    height: 40px;
    text-align: left;
    background-color: #CCC;
    width: 60%;
}

推荐答案

将此添加到CSS
Add this into your CSS
ul { margin: 0; padding: 0; }


问候..:)


Regards..:)


这篇关于是CSS问题还是其他问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆