Html 如何在Windows8WebView控件中使用CSS?
我有一个关于window的8个应用程序Webview控件的问题,是否仍然可以使用css来管理Webview的外观,我在这里使用它来查看反馈的html数据的返回内容,但正如您所看到的,它已从所有css中剥离,所以是否仍然可以管理Webview的css 更新:这是代码Html 如何在Windows8WebView控件中使用CSS?,html,c#-4.0,windows-8,windows-runtime,winrt-xaml,Html,C# 4.0,Windows 8,Windows Runtime,Winrt Xaml,我有一个关于window的8个应用程序Webview控件的问题,是否仍然可以使用css来管理Webview的外观,我在这里使用它来查看反馈的html数据的返回内容,但正如您所看到的,它已从所有css中剥离,所以是否仍然可以管理Webview的css 更新:这是代码 void ItemListView_SelectionChanged(object sender, SelectionChangedEventArgs e) { // this code
void ItemListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
// this code to populate the web view
// with the content of the selected blog post.
// I'm passing the selected item from the previous items' page
// and then pouplate the web view with the selected item Contents of the feed
if (this.UsingLogicalPageNavigation()) this.InvalidateVisualState();
Selector list = sender as Selector;
FeedItem selectedItem = list.SelectedItem as FeedItem;
if (selectedItem != null)
{
this.contentView.NavigateToString(selectedItem.Contents);
}
else
{
this.contentView.NavigateToString("");
}
}
如果使用NavigateToString进行导航,则可以将css放在导航到的html字符串中。否则-它应该可以正常工作,我们需要您实际操作的更多细节。您可以将样式嵌入html元素中,如。先生,我知道如何在html页面中嵌入css样式,我在问如何将它嵌入到Webview控件?嗯,你的selectedItem。内容是html字符串,对吗?如果你想使用css,你需要在html字符串中嵌入样式。我不相信有单独供应的方法。嗯,我想我明白你的意思了。让我试试,看看我能想出什么,非常感谢你的帮助。