如何防止html页面中的样式并将其包含在asp.net mvc3的site.css页面中 [英] How to prevent styling in html page and include it in site.css page in asp.net mvc3

查看:98
本文介绍了如何防止html页面中的样式并将其包含在asp.net mvc3的site.css页面中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有一些关于造型的问题,任何人都可以帮助我。



1.在我的页面中,我给出了一些div元素和一些文本框以及一些其他小部件。

对于所有小部件和div我定义了一些类和id。对于那些id和类

我在< style>中定义样式标记在同一页面中。然后应用于视图页面的更改已经



现在我的问题是我可以在site.css中给出这些样式并且我可以将它们用于所有

页面并删除< style>每页都标记。



2.我使用的是kendo ui小部件。对于每个小部件(listview,grid),我定义了一个css

文件。我将css文件包含在我需要的每个页面中。但是我希望样式

就像在一个页面中我希望列表视图背景颜色为灰色而在另一个页面我想要

listview背景颜色为浅橙色。我可以在

相同的css文件中给出颜色,或者我包含另一个css文件

希望你们理解我的问题。我在等待回复



问候,

Srinivas

Hi,

I have some questions regarding styling can any one help me on those.

1. In my page i am giving some div elements and some textboxes and some other widgets.
For all the widgets and div i am defining some classes and id. For those id and classes
i am defining the styling in <style> tag in the same page. Then the changes have been
applied to the view page.
Now my question is can i give these styling in site.css and can i use those for all the
pages and remove the <style> tag in every page.

2. I am using kendo ui widgets. For each of the widget(listview,grid) i am defining an css
file. I am including the css file in every page where i required. But i want to style
like in one page i want list view background color as grey and in another page i want
the listview background color as light orange. Can i able to give the coloring in the
same css file or i include another css file
Hope you guys understand my questions. I am waiting for the reply

Regards,
Srinivas

推荐答案





1:为了保持文本框的一致性,你必须在site.css和div中写css

元素css put那个css在site.css中。因此在site.css中定义css是有益的,因为在每个页面中你不需要再次编写css,你可以重用那个css,只需定义css

url在顶部/底部页面。



2:在第二种情况下,您只需通过!important覆盖背景颜色属性。


1: For consistent look of textboxes you have to write that css in site.css & also for div
element css put that css in site.css.Therefore defined css in site.css in beneificial because in each page you need not write css again you may reuse that css by just defined css
url at top/bottom of the page.

2: In second case you just override background color property by giving "!important".


这篇关于如何防止html页面中的样式并将其包含在asp.net mvc3的site.css页面中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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