Html 如何使DIV的所有内容显示在一行上?

Html 如何使DIV的所有内容显示在一行上?,html,css,asp.net-mvc,razor,Html,Css,Asp.net Mvc,Razor,我有以下资料: <ul class="right"> <li> <div class="hdr_msg">Welcome Visitor!</div> @Html.ActionLink("Login", "Login", "Users", null, new { title = "Login",

我有以下资料:

        <ul class="right">
            <li>
                <div class="hdr_msg">Welcome Visitor!</div>
                @Html.ActionLink("Login", "Login", "Users", null, new {
                    title = "Login", 
                    rel = "nofollow" 
                })<div class="hdr_msg"> or </div>
                @Html.ActionLink("Register", "Register", "Users", null, new {
                    title = "Register your ID", 
                    rel = "nofollow" 
                })
            </li>
        </ul>
  • 欢迎参观! @ActionLink(“登录”,“登录”,“用户”,空,新{ title=“登录”, rel=“nofollow” })或 @ActionLink(“注册”、“注册”、“用户”),空,新{ title=“注册您的ID”, rel=“nofollow” })
这将生成以下源代码:

        <ul class="right">
            <li style="float: left">
                <div class="hdr_msg">Welcome Visitor!</div>

                <a href="/Users/Login" rel="nofollow" title="Login">Login</a><div class="hdr_msg"> or </div>
                <a href="/Users/Register" rel="nofollow" title="Register your ID">Register</a>
            </li>
        </ul>
  • 欢迎参观! 或
我的问题是,我希望所有的细节都显示在一行上。我想在一行上看到“欢迎访客!登录或注册”,但现在所有内容都是垂直流动的。

您可以使用
而不是

您可以使用
而不是


我会用
包装整个文本。不要只使用一个
在登录和注册之间插入

以下是我的建议:

    <ul class="right">
        <li>
            <span class="hdr_msg">Welcome Visitor!
            @Html.ActionLink("Login", "Login", "Users", null, new {
                title = "Login", 
                rel = "nofollow" 
            }) or 
            @Html.ActionLink("Register", "Register", "Users", null, new {
                title = "Register your ID", 
                rel = "nofollow" 
            })
            </span>
        </li>
    </ul>
  • 欢迎参观! @ActionLink(“登录”,“登录”,“用户”,空,新{ title=“登录”, rel=“nofollow” })或 @ActionLink(“注册”、“注册”、“用户”),空,新{ title=“注册您的ID”, rel=“nofollow” })

我会把整篇文章包装起来。不要只使用一个
在登录和注册之间插入

以下是我的建议:

    <ul class="right">
        <li>
            <span class="hdr_msg">Welcome Visitor!
            @Html.ActionLink("Login", "Login", "Users", null, new {
                title = "Login", 
                rel = "nofollow" 
            }) or 
            @Html.ActionLink("Register", "Register", "Users", null, new {
                title = "Register your ID", 
                rel = "nofollow" 
            })
            </span>
        </li>
    </ul>
  • 欢迎参观! @ActionLink(“登录”,“登录”,“用户”,空,新{ title=“登录”, rel=“nofollow” })或 @ActionLink(“注册”、“注册”、“用户”),空,新{ title=“注册您的ID”, rel=“nofollow” })
    <ul class="right">
        <li>
            <span class="hdr_msg">Welcome Visitor!
            @Html.ActionLink("Login", "Login", "Users", null, new {
                title = "Login", 
                rel = "nofollow" 
            }) or 
            @Html.ActionLink("Register", "Register", "Users", null, new {
                title = "Register your ID", 
                rel = "nofollow" 
            })
            </span>
        </li>
    </ul>