动态右窗格样式问题
Dynamic right pane styling issue
我有右边的子菜单作为窗格。当点击2链接在第一个div, 2div必须显示。当点击第二(或任何元素)元素从第二div第三div必须显示我尝试了这样的东西(截至目前所有div都是display:block
)
<html>
<head>
<style>
</style>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<style>
.my_class {
height:200px;
width:100px;
border:1px solid;
float:left;
position:absolute;
}
</style>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-xs-2">
<div class="my_class">
<ul>
<li><a href="#">1</a></li>
<li><a href="#">2</a></li>
<li><a href="#">3</a></li>
<li><a href="#">4</a></li>
</ul>
</div>
<div class="my_class">
<p><a href="#">Something2</a></p>
<p><a href="#">Something2</a></p>
<p><a href="#">Something2</a></p>
<p><a href="#">Something2</a></p>
<p><a href="#">Something2</a></p>
</div>
<div class="my_class">
<p><a href="#">Something2-1</a></p>
<p><a href="#">Something2-1</a></p>
<p><a href="#">Something2-1</a></p>
<p><a href="#">Something2-1</a></p>
<p><a href="#">Something2-1</a></p>
</div>
<div class="my_class">
<p><a href="#">Something2-1-1</a></p>
<p><a href="#">Something2-1-1</a></p>
<p><a href="#">Something2-1-1</a></p>
<p><a href="#">Something2-1-1</a></p>
</div>
</div>
</div>
</div>
</body>
</html>
有人能帮我纠正对齐问题吗?子菜单实际上向右移动了4次。
开始:
将class cl-xs-2更改为cl-md-3。
和删除position:absolute; and left:100%;display
<-不需要那些东西。
注意我看到你重复的样式很多高度,宽度等
你可以为所有这些div设置一个类,并使用一个css规则为所有div设置属性。
看看这个,我刚找到它,但它似乎是一个不错的教程。
<html>
<head>
<style>
</style>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-3">
<div style="height:200px;width:100px;border:1px solid;float:left;">
<ul>
<li><a href="#">1</a>
</li>
<li><a href="#">2</a>
</li>
<li><a href="#">3</a>
</li>
<li><a href="#">4</a>
</li>
</ul>
</div>
<div style="height:200px;width:100px;border:1px solid;float:left;">
<p><a href="#">Something2</a>
</p>
<p><a href="#">Something2</a>
</p>
<p><a href="#">Something2</a>
</p>
<p><a href="#">Something2</a>
</p>
<p><a href="#">Something2</a>
</p>
</div>
<div style="height:200px;width100px;border:1px solid;float:left;">
<p><a href="#">Something2-1</a>
</p>
<p><a href="#">Something2-1</a>
</p>
<p><a href="#">Something2-1</a>
</p>
<p><a href="#">Something2-1</a>
</p>
<p><a href="#">Something2-1</a>
</p>
</div>
<div style="height:200px;width100px;border:1px solid;float:left;">
<p><a href="#">Something2-1-1</a>
</p>
<p><a href="#">Something2-1-1</a>
</p>
<p><a href="#">Something2-1-1</a>
</p>
<p><a href="#">Something2-1-1</a>
</p>
</div>
</div>
</div>
</div>
</body>
</html>
相关文章:
- javascript问题正文样式
- 使用Javascript对象为具有两个背景图像的DIV设置样式时出现问题
- 动态生成网格样式问题
- 样式 DOM 上的 $.before() 性能问题
- 显示 CSS 样式表时出现 IE8 问题
- 在弹出式显示和隐藏上遇到样式问题
- asp.net 高度属性的元素样式问题
- Zopim 小部件的样式问题
- 引导响应式导航栏链接对齐和样式问题
- 动态设置复选框标签文本会导致复选框中的样式问题
- 带有文本框的FF Javascript样式问题
- Wordpress巨型菜单小部件与现有模板的移动样式问题
- 手风琴作为页脚样式问题
- 动态右窗格样式问题
- 选择框样式问题
- 在Internet Explorer中设置window.open()的HTML会产生奇怪的样式问题
- jQuery样式问题
- 工具提示样式问题
- jQuery复选框样式问题
- javascript createElement(),样式问题