小编ech*_*ang的帖子

HTML/CSS 如何在绝对 DIV 中居中 DIV

我有一个我无法解决的问题。我试图将这个黑框放在具有绝对位置的红框内。我尝试将黑匣子调整到相对位置,但我觉得我错过了一些东西。

最终,我试图制作顶部标题。

这是一个图像header-image.jpg

帮助?

body.esc-layout {
    min-width: 960px;
    margin: 0 auto;    
}
.promo-bar {
    display: block;        
}
.promo-bar .customer-care-wrapper {
    float: left;
    max-width: 50%;
}
.promo-bar .customer-care {
    font-size: 11px;
    color: #000;
    margin-left: 15px;
    display: block;
}
.promo-bar {
    width: 100%;
    min-height: 32px;
    position: relative;
    height: auto;
    overflow: visible;
    z-index: 5;
    background-color: #EEE;
    overflow: hidden;
  }
.promo-bar .service-message-wrapper {
    padding-top: 2px;
    max-width: 50%;
    margin: 0 auto;
    position: relative;
   
    
}

.service-message-wrapper .service-banner{
    position: absolute;
    left: 0px;
    right: 0px;
    text-align: center; …
Run Code Online (Sandbox Code Playgroud)

html css

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

如何在三个div之间切换?可能使用 jquery 解决方案?

我正在尝试在页面中创建一个部分,您可以在不同的部分之间切换。我是 jquery / javascript 的新手... =(

当我切换三个不同的部分时,我希望颜色 div 的位置保持不变。

更好地解释:

点击订阅(id="subScription") --> 会出现红框(id="firstBlock") ////

单击当前问题(id="inStore") --> 会出现蓝色框 (id="secondBlock") ////

点击 Digital Edition("onLine") --> 会出现绿色框 (id=thirdBlock") ////

这是我的代码片段:

.line {
    background: none repeat scroll 0 0 #E5E5E5;
    height: 1px;
    position: relative;
    top:10px;
    z-index: 0;
    margin: 0 80px;
}

.midSection .sectionHeader {
    width: 230px;
    margin-bottom: 18px;
}

.sectionHeader{
    background: none repeat scroll 0 0 #ffffff;
    font-size: 20px;
    line-height: 21px;
    margin: 0 auto;
    position: relative;
    text-align: center;
    text-transform: uppercase;
}

.menuLine{
    position: relative; …
Run Code Online (Sandbox Code Playgroud)

html javascript css jquery

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

标签 统计

css ×2

html ×2

javascript ×1

jquery ×1