Div alignment to center on zoom in & out

旧街凉风 提交于 2020-01-23 23:25:46

问题


I have site http://www.d1210091-6206.cp.blacknight.com/site/home/ having alignement issue for zoom in & out for the particular section (News & fb ) div id footerwrapper on the page. All other are aligned centerly on zoom in & out.

I am sending you the screen shot also. http://screencast.com/t/e95jEwR6dki


回答1:


I check your code, if you touch the file style.css, the style for the element #footer, and if you don't use

float: left; margin-left: 210px; width: 600px

Erase it, the div#footer will be centered. But at all the facebook section, you will find it with a little crop on the top. You can leave some margin or padding for that.

In a temporary Backup old shool method, you can use the tag (not recommended if you want to change the styles more freely), with two columns and width specified width for each one.

Greetings




回答2:


You have to delete "margin-left: 210px" from #footer. It overwrites the "margin: 0 auto;" from .container-12 class.




回答3:


I would suggest use of bootstrap, like this it was helpful to me..

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 text-left" style="border:1px dashed red; ">
  I will be at left

</div>

<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 text-center" style="border:1px dashed blue;">
  I will be at center

</div>

<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 text-right" style="border:1px dashed green;">
  I will be at right

</div>


来源:https://stackoverflow.com/questions/10298959/div-alignment-to-center-on-zoom-in-out

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!