小编Ker*_*Med的帖子

C# String.Format 可选参数

我想string.Formatoptional parameters

public static void Main(string[] args)
{
    // Your code goes here
    // Console.WriteLine(string.Format("{0} {1}", "a", "b"));
    Console.WriteLine(string.Format("{0} {1}", "a"));
}
Run Code Online (Sandbox Code Playgroud)

例如,参数{1}是可选的并具有默认值

你能帮我做这个吗?

c# parameters string.format optional

5
推荐指数
1
解决办法
9651
查看次数

@Media 打印 css

我的 HTML 页面具有以下结构:

<html>
<head></head>
<body>
<nav>
  ....  navigation menu
</nav>
   <div>
         <div></div>
         <div class="to-print">
           <h2>My div to display in print mode<h2>
           <section>
               <article>....content....</article>
           </section>
         </div>
         <div></div>
   </div>
   <div>
      .... HTML elements
   </div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

如果用户尝试打印页面,我只想打印带有类的 DIV 的内容to-print。我怎样才能做到这一点?

html css media printing

5
推荐指数
2
解决办法
3万
查看次数

标签 统计

c# ×1

css ×1

html ×1

media ×1

optional ×1

parameters ×1

printing ×1

string.format ×1