小编Par*_*een的帖子

如何使用Flexbox在Bootstrap 4中将导航栏居中

Well, I want to achieve this thing: https://i.imgur.com/BDM7JvD.jpg using the Bootstrap 4 Navbar.

How can I centralize the nav-links/items in the middle of the viewport using the flexbox or .mr-auto etc utilities. I am trying to avoid a CSS based positioning approach because it may look off on different devices. But sure if a CSS approach promises to be at the same centralized position then why not!

NOTE: some ppl might say to use the justify utilities, the problem is …

html css twitter-bootstrap bootstrap-4

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

当它不是基址或索引寄存器时,为什么CX在16位汇编中使用'[]'?

每当我尝试这样做时,在DOSBox下使用MASM 6.15:

mov al, [cx]
Run Code Online (Sandbox Code Playgroud)

要么

mov al, [cx + bx]
Run Code Online (Sandbox Code Playgroud)

要么

mov al, [cx + 4]
Run Code Online (Sandbox Code Playgroud)

我收到错误:'只允许基本或索引注册'

但话说回来,让我说我有一个数组var1.如果我做:

.model small
.stack 4096

.data
 var1 BYTE 1, 2, 3, 4, 5, 6, 7, 8, 9

.code
main proc
mov ax, @data
mov ds, ax

mov cx, 5
mov al, [var1 + cx]

mov ah, 4Ch
int 21h
main endp
end main
Run Code Online (Sandbox Code Playgroud)

它工作得很好.为什么不给出与上面相同的错误?CX不是基址或索引寄存器.

[]运算符的整个工作本质是什么?

x86 assembly dos masm x86-16

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

如何在Bootstrap中将导航项居中?

如果我想根据Bootstrap 4中浏览器窗口的大小将导航项(链接)放在导航栏中,该怎么办?请看一下代码:

<nav class="navbar navbar-toggleable-md navbar-light bg-faded">
    <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
    </button>
    <a class="navbar-brand" href="#">Navbar</a>
    <div class="collapse navbar-collapse" id="navbarNavAltMarkup">
        <div class="navbar-nav">
            <a class="nav-item nav-link active" href="#">Home <span class="sr-only">(current)</span></a>
            <a class="nav-item nav-link" href="#">Features</a>
            <a class="nav-item nav-link" href="#">Pricing</a>
            <a class="nav-item nav-link disabled" href="#">Disabled</a>
        </div>
    </div>
</nav>
Run Code Online (Sandbox Code Playgroud)

现在,我想根据浏览器的宽度将div的中心设置为“ navbar-nav”。我尝试过的一件事是给它mr-auto和ml-auto使其确实居中,但不完全准确。实际上,它根据宽度“浏览器窗口宽度-徽标宽度”将其居中。我希望它恰好位于屏幕中间。

我也尝试过将位置更改为绝对位置,但是同样,在折叠模式下,这种布局也会变得混乱。

html css twitter-bootstrap bootstrap-4

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

标签 统计

bootstrap-4 ×2

css ×2

html ×2

twitter-bootstrap ×2

assembly ×1

dos ×1

masm ×1

x86 ×1

x86-16 ×1