简体   繁体   English

HTML-放大/缩小时,我的内容变得混乱

[英]HTML - My content becomes messed up when I zoom in/out

http://pastebin.com/1Yz1aF1S HTML/CSS http://pastebin.com/1Yz1aF1S HTML / CSS

HTML code is in home.html CSS code is in stylesheet.css HTML代码位于home.html CSS代码位于stylesheet.css中

Whenever I zoom in our out my content moves around rather awkwardly and breaks my page a bit. 每当我放大内容时,我的内容就会很尴尬地移动,并稍微破坏我的页面。 Was wondering how i could fix this issue and work to avoid this issue in the future? 想知道我如何解决此问题并在将来避免发生此问题吗? Images of the site can be found here! 该网站的图片可以在这里找到! http://imgur.com/a/MbZkk http://imgur.com/a/MbZkk

Still new to HTML and only just started learning it properly in University but I've been immensely enjoying it and am thinking about pursuing it as a career! 对HTML来说仍然是新手,只是刚刚开始在大学里正确地学习它,但是我一直非常喜欢它,并正在考虑将其作为职业!

The page "breaking" looks to be the result of using float left and float right elements next to each other. 页面“ breaking”看起来是使用左浮动元素和右浮动元素彼此相邻的结果。 If their is insufficient room, your right hand panel breaks to the next line but is still floated right. 如果它们的空间不足,则右面板会跳到下一行,但仍会向右浮动。

You can achieve a non responsive layout that keeps both panels next to each other and locates the right hand panel flush with the right margin if there is room, but produces horizontal scroll bars if not, you can use table layout. 您可以实现一种无响应的布局,该布局可以使两个面板彼此相邻,并且如果有空间,则使右侧面板与右边距齐平,但是如果没有空间,则产生水平滚动条,则可以使用表格布局。 A demonstration without using <TABLE> tags: 不使用<TABLE>标记的演示:

CSS 的CSS

#panels
{   border: thin solid green; /* to see */
    min-width: 100%;
    display:table;
}
#leftPanel
{    border: thin solid red; /* to see */
     min-width: 40em;
     display: table-cell; 
}
#rightPanelContainer
{   display: table-cell;
    text-align: right; /* right justify */
}
#rightPanel
{   display:inline-block; /* allow panel to be justified */
    border: thin solid blue; /* to see */
    min-width: 20em;
    text-align: left;
}

HTML 的HTML

<div id="panels">
    <div id="leftPanel">
          Left Panel
    </div>
    <div id="rightPanelContainer">
         <div id="rightPanel">
              Right Panel
         </div>
    </div>
</div>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM