登录 | 注册 | FAQ
Anonymous

how to make the rest of the divs slide when one is clicked

+ 发表回复

2 篇帖子 分页: 1 / 1


how to make the rest of the divs slide when one is clicked

Dayve » 周二 10月 28, 2014 9:31 am

I have four divs and those four divs have an anchored link to another page of my website. I am trying to get to have box2, box3 and box4 slide to the right of the screen when box1 is click thus allowing me to show the content on the center of the page. The same should apply to box2, box3 or box4 should they be clicked.
Which is the best way to do this? Can this be done with CSS3?

Thanks

<html>
<head>
</head>
<body>
<div id="box1">
<a href="#">link1</a>
</div>
<div id="box2">
<a href="#">link2</a>
</div>
<div id="box3">
<a href="#">link3</a>
</div>
<div id="box4">
<a href="#">link4</a>
</div>
</body>
</html>

CSS


#box1, #box2, #box3, #box4
{
display:block;
width:200px;
height:auto;
margin-left: auto;
margin-right: auto;
}
头像

Dayve

  • 帖子: 2
  • 注册: 周日 3月 23, 2014 1:03 pm

Re: how to make the rest of the divs slide when one is click

XainPro » 周六 11月 01, 2014 12:40 pm

I have not tries it with css3 but there is a property of content
http://www.w3schools.com/cssref/pr_gen_content.asp

check this out maybe this would help but i think this work is best done with Jquery.
头像

XainPro

  • 帖子: 3933
  • 注册: 周五 2月 17, 2012 8:10 pm


+ 发表回复

分页: 1 / 1