我对Visual Studio 2010有一个非常奇怪的问题.当我将渐变的CSS属性添加到我的样式表时,Visual Studio将在经过一些调试后删除它.
我添加到样式表的代码示例:
.button
{
/* Firefox */
background-image: -moz-linear-gradient(top, #fff, #efefef);
/* Chrome, Safari */
background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #fff),color-stop(1, #efefef));
/* Modern Browsers*/
background-image: linear-gradient(top, #fff, #efefef);
/* IE */
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#ffffff', EndColorStr='#efefef');
}
Run Code Online (Sandbox Code Playgroud)
有时当我开始调试时,Visual Studio编辑CSS:
.button
{
/* Firefox */
background-image: linear-gradient(top, #fff, #efefef);
/* Chrome, Safari */
/* Modern Browsers*/
}
Run Code Online (Sandbox Code Playgroud)
所以Visual Studio似乎删除了一些它不知道的属性.这真的很烦人.知道如何阻止它吗?
这不是CSS评论的问题.它也没有评论.
更新
它似乎通过保存包含css文件的文件来实现.当我编辑我的主版面并保存它时,Visual Studio将删除我在链接的css文件中提到的这个属性.
它不是 CSS3问题,因为它不会触及我的border-radius类和id.所以也许它是过滤属性.但是我希望停止Visual Studio在没有权限的情况下在css文件中更改我的东西.
更新27. 2014年6月
Visual Studio 2013中解决了问题 https://connect.microsoft.com/VisualStudio/feedback/details/782677/visual-studio-is-deleting-css
我遇到了一些问题,将Material UI添加到我的React项目中,该项目使用Typescript编程.
根据教程,我首先添加react-tab-event-plugin.
import injectTapEventPlugin from 'react-tap-event-plugin';
// Needed for onTouchTap
// Can go away when react 1.0 release
// Check this repo:
// https://github.com/zilverline/react-tap-event-plugin
injectTapEventPlugin();
Run Code Online (Sandbox Code Playgroud)
这样做,我得到一个关于缺少默认导出的错误.
ERROR in ./src/index.tsx
(4,8): error TS1192: Module ''react-tap-event-plugin'' has no default export.
Run Code Online (Sandbox Code Playgroud)
添加材质UI
import getMuiTheme from 'material-ui/styles/getMuiTheme';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
Run Code Online (Sandbox Code Playgroud)
引发以下构建错误
ERROR in ./src/containers/index.tsx
(8,25): error TS2307: Cannot find module 'material-ui/styles/getMuiTheme'.
ERROR in ./src/containers/index.tsx
(9,30): error TS2307: Cannot find module 'material-ui/styles/MuiThemeProvider'.
Run Code Online (Sandbox Code Playgroud)
我的Webpack配置非常简单,并且在我添加打字时,每个React npm模块都可以使用,直到现在.
var cssnext = require('postcss-cssnext')
var postcssImport = require('postcss-import')
var …Run Code Online (Sandbox Code Playgroud)我有一个响应式网页设计与SVG徽标/图像,其容器是动态的.所有主流浏览器似乎都支持SVG非常好.
我的SVG是动态的,所以如果我扩展我的浏览器窗口,SVG也会这样做.在Chrome和IE9中,它就像一个魅力.在Firefox中,SVG在某些尺寸上很模糊.但是当它超过最初的SVG大小时,我不能说它一直模糊.在我扩大浏览器窗口时,似乎并没有正确地重新渲染.
这有时是什么样子(看看它的全貌看看差异):

也许我用错误的方法来嵌入它.这就是我的CSS和HTML的样子:
<div id="logo"></div>
Run Code Online (Sandbox Code Playgroud)
CSS:
#logo {
background-image: url('http://dl.dropbox.com/u/569168/jess.svg');
height: 22em;
background-repeat: no-repeat;
-webkit-background-size: 100%;
-moz-background-size: 100%;
-o-background-size: 100%;
background-size: 100%;
}
Run Code Online (Sandbox Code Playgroud)
如果你想查看它,可以使用CSS中的链接获取SVG.它是用Adobe Illustrator制作的.
知道怎么解决这个问题吗?
当我使用ClickOnce部署和安装应用程序时,如何设置开始菜单快捷方式的图标?
平台:Visual Studio 2010 Professional Beta 1
听起来很奇怪但是使用Javascript(例如AJAX)发布内容而不使用表单的情况如何(可以从表面读取多个内容).
我应该在哪里放置csrf_token模板标签?我已经添加了AJAX修复程序:https: //docs.djangoproject.com/en/dev/ref/contrib/csrf/#ajax
...但我得到"CSRF验证失败.请求中止." 404错误.
我使用Fill从SQL获取数据到Dataset.它只是一个包含两列的表(CategoryId(int)和CategoryName(varchar)).
当我在填充方法后查看我的数据集时,CategoryId列似乎是正确的.但在CategoryName中我有一个System.Data.StrongTypingExceptio n.
这意味着什么?
有任何想法吗?
我尝试将我的Outlook 2010加载项添加到TabAppointment选项卡.当我将它添加到TabCalendar时它完全有效,但如果你点击日历中的约会,将显示另一个选项卡,我猜这个选项卡是TabAppointment.当然,我的插件应该在那里.用户不必首先更改选项卡以使用它.
控件/选项卡的OfficeId列表.列表可以在这里下载.
应该放置加载项的选项卡
每次选择日历项时,我的加载项都应该可见.因此,正如我所写,TabCalendar工作,但它放在开始标签中.
当我选择TabAppointment时,有人知道为什么我的按钮组在那里不可见?这是错误的标签吗?或者是否无法在此处添加加载项?
当使用带有 styleUrl 和单独样式表文件的 Angular 组件时,每个 CSS 选择器都将在输出中限定于它的组件。
现在假设我想定义一个规则,当一篇文章后面跟着另一个特定组件时,后面的组件需要一个 margin-top。在这种情况下,当文章卡片后跟文章组元素时。
标记将是这样的:
<article-group
[topArticlesOnly]="true"
[articles]="homepage.top | slice:0:6">
</article-group>
<article-card
*ngFor="let article of homepage.top | slice:0:6"
[article]="article">
</article-card>
Run Code Online (Sandbox Code Playgroud)
两者都将包含一个具有特定类的 div,您将在以下示例中看到。
我试过这样的事情:
[article-card] + [article-group] {
margin-top: 20px;
}
article-card + article-group {
margin-top: 20px;
}
Run Code Online (Sandbox Code Playgroud)
像这样:
.article-card + .article-group {
margin-top: 20px;
}
Run Code Online (Sandbox Code Playgroud)
但是两者都不起作用,因为当 Angular 编译它时,标记的浏览器输出将是这样的:
<div _ngcontent-c3="">
<article-card _ngcontent-c3="" _nghost-c4="" ng-reflect-article="[object Object]" ng-reflect-show-image-only="true">
<article _ngcontent-c4="" class="article-card article-card--top-article article-card--image-only" ng-reflect-klass="article-card"
ng-reflect-ng-class="[object Object]">
</article>
</article-card>
<article-group _ngcontent-c3="" _nghost-c5="" ng-reflect-articles="[object Object],[object Object" ng-reflect-top-articles-only="true">
<div _ngcontent-c5="" …Run Code Online (Sandbox Code Playgroud) 我来自Web开发和WinForms到WPF,也许我还没有得到这个概念.我可以在app.xaml中为我的应用程序定义一般样式.例如,我为此文件中的所有功能区控件定义了样式.
然后我尝试了Microsoft Blend并遇到了ResourceDictionary,它是我从WinForms知道的资源文件.resx的某种方式.
但是我认为不可能将这两个概念混合在一起.例如,以下xaml代码将无法工作,因为ResourceDictionary必须是唯一的子代.
<Application x:Class="Wpf.MyApplication.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ribbon="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"
StartupUri="MyMainWindow.xaml">
<Application.Resources>
<!-- Resources scoped at the Application level should be defined here. -->
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Styles/RibbonStyle.xaml"/>
</ResourceDictionary.MergedDictionaries>
<BitmapImage x:Key="IconDokumentNeu" >Images/NewDocument_32x32.png</BitmapImage>
<SolidColorBrush x:Key="LightGrayBrushKey">WhiteSmoke</SolidColorBrush>
</ResourceDictionary>
<Style TargetType="{x:Type ribbon:RibbonWindow}">
<Setter Property="Icon" Value="../time2_32.png" />
<Setter Property="TextOptions.TextFormattingMode" Value="Display" />
</Style>
</Application.Resources>
</Application>
Run Code Online (Sandbox Code Playgroud)
看来我并没有真正得到这个概念.也许你可以帮助我,为什么这是不可能的,以及我如何使用ResourceDictionary旁边的一般样式.
是否可以使用另一个程序集的布局?我将我的应用程序分成不同的层,并有一个单独的 UI 层,其中包含供设计人员编辑的主布局。
有可能吗,我的参考资料是什么样的?
@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_Layout.cshtml";
}
Run Code Online (Sandbox Code Playgroud) 我为ToggleButton创建了一个ContentTemplate和Style,它看起来就像你从微软的WebMatrix那里知道的那样.
但是,并不总是可以单击,也不会显示悬停效果.我发现当我将鼠标悬停在图标或按钮文本上时,会出现点击/悬停区域.


一旦盘旋,可以用鼠标回到右边,悬停不会消失(应该如此).
这是代码的重要部分:
<StackPanel.Resources>
<Style TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource NavigationButton}" />
</StackPanel.Resources>
<ToggleButton x:Name="_btn_Buchungen" Click="_btn_Buchungen_Click">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Image Source="{StaticResource Buchungen}" Width="16" Height="16" />
<TextBlock Text="Buchungen" />
</StackPanel>
</ToggleButton>
Run Code Online (Sandbox Code Playgroud)
ControlTemplate和样式:
<Style TargetType="{x:Type ToggleButton}" x:Key="NavigationButton">
<Setter Property="Background" Value="{x:Null}" />
<Setter Property="Height" Value="35" />
<Setter Property="BorderBrush" Value="{x:Null}" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Border Name="OuterBorder" BorderThickness="0,1,0,0" >
<Border Name="InnerBorder" BorderThickness="0,1,0,1" >
<ContentPresenter HorizontalAlignment="Left" VerticalAlignment="Center"/>
</Border>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Style" TargetName="InnerBorder" Value="{StaticResource ButtonInnerBHover}" /> …Run Code Online (Sandbox Code Playgroud) 我刚开始潜入WPF.我注意到的第一件事,我真正讨厌的是丑陋的渲染.
我不知道为什么但是例如边界或线条有时变得难看.看一下截图.底线是丑陋的.不像中心线那样清脆.
有什么建议让这更好吗?

在网格中为UIElement设置列跨度非常容易.
Grid.SetColumnSpan(extBorder, gridFormular.ColumnDefinitions.Count());
Run Code Online (Sandbox Code Playgroud)
但阅读元素的ColumnSpan是什么意思?怎么做?
c# ×5
wpf ×4
css ×2
html ×2
javascript ×2
styles ×2
windows ×2
xaml ×2
.net ×1
ado.net ×1
ajax ×1
angular ×1
asp.net-mvc ×1
clickonce ×1
columnspan ×1
controls ×1
csrf ×1
css3 ×1
dataadapter ×1
dataset ×1
debugging ×1
deployment ×1
django ×1
firefox ×1
grid ×1
html5 ×1
jquery ×1
material-ui ×1
outlook-2010 ×1
razor ×1
reactjs ×1
ribbon ×1
sql ×1
svg ×1
typescript ×1
viewbag ×1