1
site.css 파일에서 css 클래스에 액세스 할 수 없습니다. 이러한 클래스를 개별보기 (.cshtml) 파일에 기록하면 액세스 할 수 있습니다. 코드 세부 정보는 아래와 같습니다 : #mask { 위치 : 절대; }.css 클래스를 .cshtml에 사용하는 방법
/* You can customize to your needs */
.Add-popup
{
background: white;
}
img.btn_close
{
float: right;
}
'
i have above classes in CSS file
1) this is my _layout.cshtml
'
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>@ViewBag.Title</title>
<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css"/>
</head>
</html>
'
2) this is my view
'
@{
ViewBag.Title = "View";
Layout = "~/Views/Shared/_Layout.cshtml";
}
@if (false)
{
<script src="../../Scripts/jquery-1.7.1-vsdoc.js" type="text/javascript"></script>
<link type="text/css" href="../../Content/Site.css" rel="stylesheet" />
<script src="...../ui/jquery.ui.mouse.js"></script>
<script src="...../ui/jquery.ui.draggable.js"></script>
}
@if (User.IsInRole("Owner"))
{
<div id="box" class="Add-popup"> <a href="#" class="close"><img src="../../Content/images/close_button.png" class="btn_close" title="Close Window" alt="Close" /></a>
</div>
}
'
still i am not able to access those classess from CSS file.
please reply if anybody has solution?
감사합니다. – user1802212
헤더에서 CSS 파일을 호출합니다. 추가 정보 : http://stackoverflow.com/questions/10279873/dynamic-stylesheets-using-razor –
vishal 제 코드에 변경 사항을 제안하십시오 .i uint는 링크 u를 이해하지 못합니다. – user1802212