简体   繁体   English

asp.net 浏览器页面最小化/向下恢复时的页面调整 state

[英]asp.net page adjustment when browser page is minimized/restored down state

I am developing a website using asp.net, So far so good.我正在使用 asp.net 开发一个网站,到目前为止一切顺利。 the functionality does not have much a of a problem but the way the page looks is the problem.该功能没有太大问题,但页面的外观才是问题所在。 When the browser page is in full screen mode all the controls are aligned properly and are at the right place, just as it looked when i designed it on VS 2010. But when the browser is in restored down mode or the screen size is reduced everything on the page looks scattered around.当浏览器页面处于全屏模式时,所有控件都正确对齐并位于正确的位置,就像我在 VS 2010 上设计它时的样子。但是当浏览器处于恢复向下模式或屏幕尺寸缩小时,一切页面上看起来散落一地。 I searched online but found no help This link has the same problem but there seems to be no solution posted.我在网上搜索但没有找到帮助这个链接有同样的问题但是似乎没有发布解决方案。 Please help.请帮忙。

Thank You:)谢谢你:)

may be you would like to consider your css elements to be defined in % not absolute measures, for example i have a div width=100px;可能您想考虑将 css 元素定义为 % 而不是绝对度量,例如我有一个 div width=100px; i would like it to be div width=50%.我希望它是 div width=50%。 this would give an relative size of the screen size rather the fixed ones.这将给出屏幕尺寸的相对尺寸而不是固定尺寸。

also consider the float and do use divs in order to make your page adjust accordingly还要考虑浮动并使用 div 以使您的页面相应调整

While coding a design you need to keep in mind that various users will use various devices with various properties.在对设计进行编码时,您需要记住,不同的用户将使用具有不同属性的不同设备。 This has nothing to do with asp.net, c# nor visual-studio. This is a problem with CSS. You need to learn how to style your website, so that it looks the same all the time, not only when you're looking at it on your computer using a specific monitor resolution.这与 asp.net、c# 或 visual-studio 无关。这是 CSS 的问题。您需要学习如何设计您的网站,以便它始终看起来一样,而不仅仅是当您在您的网站上查看它时使用特定显示器分辨率的计算机。 This is a topic that can't be covered here.这是一个不能在这里涵盖的话题。 There are whole books discussing this "problem" and how to avoid it.整本书都在讨论这个“问题”以及如何避免它。

EDIT, some links which may help:编辑,一些可能有帮助的链接:

http://www.theserverside.com/tip/How-to-design-a-Web-page-that-will-display-properly-across-browsers http://www.theserverside.com/tip/How-to-design-a-Web-page-that-will-display-properly-across-browsers

http://faq.programmerworld.net/web_publishing/a-web-standards-checklist.html http://faq.programmerworld.net/web_publishing/a-web-standards-checklist.html

http://www.jimwestergren.com/common-css-mistakes-and-their-solutions/ http://www.jimwestergren.com/common-css-mistakes-and-their-solutions/

http://www.webreference.com/authoring/style/sheets/index.html http://www.webreference.com/authoring/style/sheets/index.html

Hope it helps.希望能帮助到你。 If you're not experienced, I'd suggest sticking with a fixed-width layout and learn, learn, learn.如果您没有经验,我建议您坚持使用固定宽度的布局并学习、学习、学习。

And last advice - don't forget that there exist various browsers as well, each rendering the page in a slightly different way.最后的建议——不要忘记还有各种浏览器,每种浏览器呈现页面的方式都略有不同。 Don't forget to write your css with that in mind and check for problems often.不要忘记写下您的 css 并经常检查问题。

The problem you are facing is well known as Floating Web Layout.您面临的问题是众所周知的浮动 Web 布局。 Here I am giving an example这里我举个例子

#header
{
    height: 85px; // change like 10%
    width:1000px; // change like 50%
    background-color: White;
    border-bottom:solid 2px #9DACBD;
    margin:10px auto 0px auto;  // change like 10% auto 0% auto
}

By changing to width, height, and margin to percentage (as suggested by @Akash Yadav), you can fix your layout consistent with page resolution.通过将宽度、高度和边距更改为百分比(如@Akash Yadav 所建议的),您可以修复与页面分辨率一致的布局。 Hope it will help you.希望它能帮助你。
* Note: *There are lots of posts on floating web layout. *注意: *浮动web布局上有很多帖子。 Search google for more:).搜索谷歌更多:)。

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

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