小编jas*_*hao的帖子

如何强制元素保持在同一行

嗨,我有一个以下的CSS:

div.container {
 height:20px;
 overflow: hidden;
 margin: 15px 0px;
 padding:5px 10px 5px 10px;
 white-space: nowrap;  
}

div.content{
 width:100%;
 float:left;
 display:inline;
}

div.content a {
 float:left;
 padding: 2px 2px;
 border: 1px solid #cccccc;
 text-align:center;
}

div.content a:hover {
 background-color:#433FC1;
 color:#fff;
 text-decoration:none;
}

span.current_link {
 font-weight: bolder;
 float:left;
 padding: 2px 5px 2px 5px;
 margin: 1px 2px 0 2px;
 text-align:center;
}
Run Code Online (Sandbox Code Playgroud)

这是我的HTML:

<div class="container">
    <div class="content"> 
        Some text      
        <span class="current_link">Current link</span> 
        <a href="#">Link1</a>
        <a href="#">Link2</a>
        <a href="#">Link3</a>
        <a href="#">Link4</a>
        <a href="#">Link5</a>
    </div>
</div> …
Run Code Online (Sandbox Code Playgroud)

html css

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

为什么ob_get_contents不起作用

我有这个代码:

<?php
ob_start();
?>
hi
<?php echo ob_get_contents(); ob_end_clean();
Run Code Online (Sandbox Code Playgroud)

但没有输出.
如果我删除ob_end_clean();输出是hi hi.如果ob_flush()未在应用程序结束时调用,则会再次自动刷新内容.

我需要使用,ob_get_contents()因为我将实现一个简单的缓存机制,将输出保存到文件中.

请帮忙.

谢谢!

php output-buffering

3
推荐指数
1
解决办法
4446
查看次数

添加HTML时,Jekyll不呈现Markdown

我在Markdown文件中有这个降价代码.它具有内联HTML.

---
layout: page
title: About This Website
permalink: /about/
---


This website is built with <i class="fa fa-heart" style="color: #EEAAAA"></i>, 
[Jekyll](https://jekyllrb.com/), [LESS](http://lesscss.org/), 
[Gulp](http://gulpjs.com/), and a series of other [NPM builders](http://gulpjs.com/plugins/).
It is hosted on [Github Pages](https://pages.github.com/).
Run Code Online (Sandbox Code Playgroud)

但是当我用a包裹前面的东西时<div>,降价不会呈现.即使我用开头和关闭<div>标签包裹{% raw %}.

为什么?有没有解决方法?我正在使用Jekyll 3.

markdown jekyll kramdown

2
推荐指数
1
解决办法
1091
查看次数

什么是@"运营商?

我在互联网上搜索这意味着什么:@”包括@个别.

它在这段代码中:

$Win32ShowWindowAsync = Add-Type –memberDefinition @” 
[DllImport("user32.dll")] 
public static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow); 
“@ -name “Win32ShowWindowAsync” -namespace Win32Functions –passThru
Run Code Online (Sandbox Code Playgroud)

我还继续收到上面第一行的错误消息:

White space is not allowed before the string terminator.
Run Code Online (Sandbox Code Playgroud)

我改变",但没有运气.

那么这些符号在Powershell中意味着什么呢?

谢谢

syntax powershell

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

标签 统计

css ×1

html ×1

jekyll ×1

kramdown ×1

markdown ×1

output-buffering ×1

php ×1

powershell ×1

syntax ×1