css - 括号的 HTML/CSS 部分

标签 css html

<分区>

我正在开发一个杯子系统,我想得到一些关于支架部分的建议。理想的结果应该是这样的:

Brackets

http://www.partyplanning101.com.php5-7.dfw1-1.websitetestlink.com/wp-content/uploads/2009/02/tornament_board.gif

我想使用 div 结合 CSS 而非表格来构建页面。我应该如何最佳地做到这一点?你们有这方面的 sample 吗?

我只是寻求有关 HTML/CSS 部分的帮助,没有别的。

最佳答案

这看起来很有趣,所以我开始开发,现在必须回去工作,所以这就是我的进展。基础知识已经为你安排好了,所以你可以从这里完成我想,虽然我可能也会在空闲时间完成它,稍后再发布

http://jsfiddle.net/AcuPp/

更新:

完成 - http://jsfiddle.net/AcuPp/3/

CSS

#container { 
    width: 800px; 
    height: 600px; 
    float: left; 
}

section { 
    width: 130px; 
    height: 520px; 
    float: left;
}

section > div { 
    width: 100px; 
    height: 20px; 
    border: 1px solid #000; 
    margin: 10px 0; 
    background: #73789F; 
    color: white; 
    padding: 10px 10px 10px 20px;
}

section > div:nth-child(2n) { 
    margin-bottom: 40px;
}

.connecter { 
    width: 30px; 
    height: 520px; 
    float: left; 
}

.line { 
    width: 30px; 
    height: 520px; 
    float: left; 
}

.connecter div { 
    border: 1px solid #000; 
    border-left: none; 
    height: 50px; 
    width: 100%; 
    margin: 80px 0 0 1px;
}

.connecter div:first-child { 
    margin: 32px 0 0 1px; 
}

.line div { 
    border-top: 1px solid #000; 
    margin: 133px 0 0 1px; 
}

.line div:first-child { 
    margin-top: 55px; 
}

#quarterFinals > div { 
    margin-top: 91px; 
}

#quarterFinals > div:first-child { 
    margin-top: 37px; 
}

#conn2 div { 
    margin-top: 133px; 
    height: 133px;
}

#conn2 div:first-child { 
    margin-top: 57px; 
}

#line2 div { 
    margin-top: 270px; 
}

#line2 div:first-child { 
    margin-top: 125px; 
}
#semiFinals > div { 
    margin-top: 230px; 
}
#semiFinals > div:first-child { 
    margin-top: 105px; 
}
#conn3 div { 
    margin-top: 125px; 
    height: 270px;
}

#line3 div { 
    margin-top: 270px; 
}

#final > div { 
    margin-top: 250px; 
}

HTML

<article id="container">

<section>
    <div>Player 1</div>
    <div>Player 2</div>
    <div>Player 3</div>
    <div>Player 4</div>
    <div>Player 5</div>
    <div>Player 6</div>
    <div>Player 7</div>
    <div>Player 8</div>
</section>

<div class="connecter">
    <div></div>
    <div></div>
    <div></div>
    <div></div>
</div>

<div class="line">
    <div>
    </div><div>
    </div><div>
    </div><div>
    </div>
</div>

<section id="quarterFinals">
    <div></div>
    <div></div>
    <div></div>
    <div></div>
</section>

<div class="connecter" id="conn2">
    <div></div>
    <div></div>
</div>

<div class="line" id="line2">
    <div></div>
    <div></div>
</div>

<section id="semiFinals">
    <div></div>
    <div></div>
</section>

<div class="connecter" id="conn3">
    <div></div>
</div>

<div class="line" id="line3">
    <div></div>
</div>

<section id="final">
    <div></div>
</section>

</article>

​

关于css - 括号的 HTML/CSS 部分,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12815682/

相关文章:

html - 如何调整博客上的社交媒体按钮大小并使其响应?

css - 是否可以使用 CSS 圆 Angular 并仍然通过验证?

html - 创建跨浏览器页面,图像相对放置在两行表格上

html - 将内联样式移动到外部 css

javascript - 计时器运行到零后禁用点击计数器功能并发出警报 "game over"

php - 无需刷新即可更改网页上文本的最佳方法

html - 三列可变宽度 CSS 页面布局,中心列展开

javascript - 如何在加载网页的地方更改div样式?

javascript - FancyBox 3.3.5 选项不适用

html - 居中这个CSS下拉菜单?