Asp.net CSS样式表未反映在我的aspx上

Asp.net CSS样式表未反映在我的aspx上,asp.net,css,Asp.net,Css,我在Site.CSS中有以下CSS样式表 .img { width: 1300px; height: auto; } 以及my default.aspx中的以下代码 <div class="img"> <img src="http://files.g4tv.com/images/blog/2008/06/18/633493967095957891.jpg" alt="DOMO" /> <div class="desc">Add a de

我在Site.CSS中有以下CSS样式表

.img
{
    width: 1300px; 
    height: auto;
}
以及my default.aspx中的以下代码

<div class="img">
 <img src="http://files.g4tv.com/images/blog/2008/06/18/633493967095957891.jpg" alt="DOMO" />
 <div class="desc">Add a description of the image here</div>
</div>

在此处添加图像的描述

为什么我的图片没有反映CSS中规定的宽度和高度

在您的
img
上应用类,而不是在
div

<div >
    <img class="img" 
         src="http://files.g4tv.com/images/blog/2008/06/18/633493967095957891.jpg"
         alt="DOMO" />
    <div class="desc">
                Add a description of the image here
    </div>
</div>

但它有一个缺点,即此css将应用于文档中的每个
img
。所以第一个更好。

在你的
img
上应用类,而不是
div

<div >
    <img class="img" 
         src="http://files.g4tv.com/images/blog/2008/06/18/633493967095957891.jpg"
         alt="DOMO" />
    <div class="desc">
                Add a description of the image here
    </div>
</div>

但它有一个缺点,即此css将应用于文档中的每个
img
。因此,第一个更好。

在您的样式中,您正在为div设置宽度,该div具有类“img”

在您的样式中,您正在为div设置宽度,该div具有类“img”

您正在向您的部门申请课程。如果您想选择分割内的图像,则 改为:

.img img
{
    width: 1300px; 
    height: auto;
}

您正在向您的部门申请课程。如果您想选择分割内的图像,则 改为:

.img img
{
    width: 1300px; 
    height: auto;
}

您好,谢谢您的回复。所以我的CSS样式是'img{width:2900px;height:auto;}',我的aspx代码是',但是为什么仍然没有反映出来呢?嗨,谢谢你的回复。所以我的CSS样式是“img{width:2900px;height:auto;}”,我的aspx代码是“”,但为什么仍然没有反映??