How can I make my span properly aligned as I toggle another element?

In this [jsfiddle][1], I am trying to create a DIV that expands and collapses as you click its title. The title is positioned on the top border, almost like a legend tag of a fieldform. I would like for the top border of the DIV to remain when the box is collapsed. If you check out my jsfiddle, you'll see it functions pretty well. However, the border of my container box must be turned off in order to achieve this effect. As a result, the contents of my title shift to the left. They are shifting the same amount of pixels that the left border of the outer DIV was in width. I've tried a few things to compensate for the shift because I would like for the text to remain in the same position while the top border remains in its original position as well, but no luck so far. Does anyone have any ideas? [1]: http://jsfiddle.net/ZRWBA/

以上就是How can I make my span properly aligned as I toggle another element?的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏