-1

当您最小化浏览器或最大化时,如何防止整个网站调整大小,网站大小调整与您的调整大小成正比。如何防止这种情况发生?没有重新组织一切?即使您调整大小或最大化,我也需要站点长度保持不变

请帮忙。谢谢你。

这是我到目前为止所做的:标记:

<div id="table">

<div class="tabs" id="content1">   
   <div class="tab">
       <input type="radio" id="tab-1" name="tab-group-1" checked>
       <label for="tab-1">Home</label>
       <div class="content">
       <p></p>  

           <!-- <div id="contentheader"></div> -->

            <div id="caption">
                <p> Title Goes Here</p>
                        </div>

            <div id="nextcontent">
                <p>Words go Here</p>
                        </div>

       </div> <!--end of content tag -->



   </div><!--end of content tab tag for TAB1 -->

   <div class="tab">
       <input type="radio" id="tab-2" name="tab-group-1">
       <label for="tab-2">About Us</label>

       <div class="content">
           <p>Stuff for Tab Two</p>


           <img src="http://placekitten.com/200/100">
       </div>
   </div>

   <div class="tab">
       <input type="radio" id="tab-3" name="tab-group-1">
       <label for="tab-3">Forum</label>

       <div class="content">
           <p>Stuff for Tab Three</p>


       </div>
   </div>

    <div class="tab">
       <input type="radio" id="tab-4" name="tab-group-1">
       <label for="tab-4">Gallery</label>

       <div class="content">
           <p>Stuff for Tab Four</p>

           <img src="http://placedog.com/200/100">
       </div>
   </div>

   <div class="tab">
       <input type="radio" id="tab-5" name="tab-group-1">
       <label for="tab-5">Forum</label>

       <div class="content">
           <p>Stuff for Tab Five</p>

           <img src="http://placedog.com/200/100">
       </div>
   </div>


   <div class="tab">
       <input type="radio" id="tab-6" name="tab-group-1">
       <label for="tab-6">Sign up</label>

       <div class="content">
           <p>Stuff for Tab Six</p>

           <img src="http://placedog.com/200/100">
       </div>
           </div>
           </div><!--*end of table tag -->
     <div id="footer">
       &copy; All rights reserved 2013
</div>

javascript代码:

*
{      margin: 0px;   }

#table
{
        font-size:100%;
        min-height: 80%;
        /* height: autopx; */
        min-width: 100%;
        /*background: #aac6e9;  */
         /*background color of the whole layout*/
}


.tabs {
  position: relative;  
  min-height: 80%; /* adjust height of the body */
  min-width: 80%;

  margin: 100px 50px 0px 50px;  /* top, right, bottom, left */



}

.tab  
{
  float: left; /* this is responsible for tabs to align left */


}
.tab label {
  background:#202d00; /*bg color of all menu bar item */
  padding: 10px 40px; /* menu bar item height width */
  color:#FFF;
  border: 1px solid #ccc;
  margin-left: -1px;
  position: relative;
  left: 1px;
  top: -29px;
  -webkit-transition: background-color .17s linear;
  font-weight:bold;


}
.tab [type=radio]
{
  display: none;  



}
.content {
  position: absolute;
  top: -1px;
  left: 0;
  background: white;
  right: 0;
  bottom: 0;
  padding: 0px; /* former 20 space between the menu bar and content text */
  border: 1px solid #ccc;
  -webkit-transition: opacity .6s linear;
  opacity: 0;
  color:#396; /*Text color of Title Goes Here*/
  font-weight:bold;
  font-size:36px;
  background-color:#f8fed2; /*bg color of the content body holder text */





        /*width:100%;
        height:92%;
        */


}
[type=radio]:checked ~ label {
  background: #c5de10; /*bg color of active menu bar item */
  border-bottom: 0px solid white;
  z-index: 2;
  color: #202d00;


}
[type=radio]:checked ~ label ~ .content {
  z-index: 1;
  opacity: 1;
}

#footer
{
        /*margin-top:10%;*/
        height: 20px;
        width:100%;
        text-align:center;

}



/*#contentheader
{
        background-image:url('1.jpg');
        width:100%;
        height: 18%;

} */

#content1
{
        width:80%; /*adust the width of content body*/
        height:80%;
        /*border: 3px solid red; */
        margin-left:auto;
    margin-right:auto;
        border: thin outset;
        background-color: #f8fed2;



}

#nextcontent
{
        color: black;
        font-size:16px;
        margin-left:20px;
        margin-right:20px;
        margin0bottom:2px;
        margin-top:10px;


}

#caption
{
        margin-left:10px;
        margin-right:10px;
        margin0bottom:0px;
        margin-top:10px;       
}

你也可以在这个小提琴中尝试一下:

http://jsfiddle.net/blackknights/2tmqW/embedded/result/

4

2 回答 2

0

只需在周围的 div 或 body 上设置一个宽度。像这样...

body {
    width: 960px;
}

您也可以通过像这样定义来设置下限min-width......

body {
    min-width: 960px;
}
于 2013-08-20T07:12:14.523 回答
0

您可以使用 CSS 中的媒体查询轻松实现此目的。您可以通过 MDN 阅读它们:https ://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Media_queries

或者,研究响应式 Web 开发技术。再一次,Mozilla 有一些关于这个主题的有用文章和阅读材料:
https ://developer.mozilla.org/en-US/docs/Web_Development/Responsive_Web_design

于 2013-08-20T07:10:00.963 回答