jjzjj

Positioning

全部标签

html - 居中 div 旁边的 DIV

body{background:rgba(0,0,0,0.8);font-family:sans-serif;font-size:11px;color:#e0e0e0;}#wrapper{}#login{margin-left:auto;margin-right:auto;margin-top:50px;background:rgba(0,0,0,0.9);width:360px;padding:20px;position:relative;-webkit-border-radius:15px;border-radius:15px;}#registercontainer{positio

html - 居中 div 旁边的 DIV

body{background:rgba(0,0,0,0.8);font-family:sans-serif;font-size:11px;color:#e0e0e0;}#wrapper{}#login{margin-left:auto;margin-right:auto;margin-top:50px;background:rgba(0,0,0,0.9);width:360px;padding:20px;position:relative;-webkit-border-radius:15px;border-radius:15px;}#registercontainer{positio

html - 如何使 <span> 与 &lt;input type ="text"> 的高度相同

我试图将一个元素放在一个元素的左侧,但我似乎无法使它们具有相同的高度并彼此对齐。跨度似乎总是高一点。有人有什么想法吗?Spark*编辑:HTML部分Username:CSSspan.box{position:absolute;width:100px;margin-left:20px;border:1px;padding:2px;height:16px;}input.name{width:115px;height:14px;} 最佳答案 如果您想在同一行中垂直对齐元素,您可能不需要使它们具有相同的高度-只需为它们提供相同的vertic

html - 如何使 <span> 与 &lt;input type ="text"> 的高度相同

我试图将一个元素放在一个元素的左侧,但我似乎无法使它们具有相同的高度并彼此对齐。跨度似乎总是高一点。有人有什么想法吗?Spark*编辑:HTML部分Username:CSSspan.box{position:absolute;width:100px;margin-left:20px;border:1px;padding:2px;height:16px;}input.name{width:115px;height:14px;} 最佳答案 如果您想在同一行中垂直对齐元素,您可能不需要使它们具有相同的高度-只需为它们提供相同的vertic

html - Div 在固定时消失

我的html是这样的-;thisistheheaderhome我的CSS是这样的:.hdr-lnks{position:fixed;}为什么当我设置position:fixed时,div会消失? 最佳答案 您可能必须声明要在页面上的哪个位置修复它。例如,如果您希望它固定在页面的左上角,您的代码可能如下所示:HTMLthisistheheaderhomeCSS.hdr-lnks{position:fixed;top:0;left:0;}Here'sajsFiddlethatillustratesit.

html - Div 在固定时消失

我的html是这样的-;thisistheheaderhome我的CSS是这样的:.hdr-lnks{position:fixed;}为什么当我设置position:fixed时,div会消失? 最佳答案 您可能必须声明要在页面上的哪个位置修复它。例如,如果您希望它固定在页面的左上角,您的代码可能如下所示:HTMLthisistheheaderhomeCSS.hdr-lnks{position:fixed;top:0;left:0;}Here'sajsFiddlethatillustratesit.

html - 没有边距或填充 - 但 div 元素之间仍有空间

这个问题在这里已经有了答案:Howtoremovethespacebetweeninline/inline-blockelements?(41个回答)Display:Inlineblock-Whatisthatspace?[duplicate](5个答案)关闭8年前。这不是第一次让我感到困惑。#wrap{width:400px;height:200px;background:red;margin:0px0px0px0px;padding:0px0px0px0px;}.content{width:100px;height:200px;display:inline-block;backgr

html - 没有边距或填充 - 但 div 元素之间仍有空间

这个问题在这里已经有了答案:Howtoremovethespacebetweeninline/inline-blockelements?(41个回答)Display:Inlineblock-Whatisthatspace?[duplicate](5个答案)关闭8年前。这不是第一次让我感到困惑。#wrap{width:400px;height:200px;background:red;margin:0px0px0px0px;padding:0px0px0px0px;}.content{width:100px;height:200px;display:inline-block;backgr

html - 如何将 wrapper-div 而不是内容居中

我希望我的页面始终在浏览器中居中而不影响内容(就像align-text:center;那样)。我想让我的wrapper-div居中。我该怎么做?简化现有页面:MusicHeavenSiteAdmin整个fiddle:http://jsfiddle.net/EndQb/ 最佳答案 #wrapper{width:...margin:0auto;}无需设置文本对齐 关于html-如何将wrapper-div而不是内容居中,我们在StackOverflow上找到一个类似的问题:

html - 如何将 wrapper-div 而不是内容居中

我希望我的页面始终在浏览器中居中而不影响内容(就像align-text:center;那样)。我想让我的wrapper-div居中。我该怎么做?简化现有页面:MusicHeavenSiteAdmin整个fiddle:http://jsfiddle.net/EndQb/ 最佳答案 #wrapper{width:...margin:0auto;}无需设置文本对齐 关于html-如何将wrapper-div而不是内容居中,我们在StackOverflow上找到一个类似的问题: