如何让我的 css 适用于屏幕分辨率?

发布于 2024-12-18 09:02:14 字数 1431 浏览 7 评论 0原文

目前,我的 css 将在一种分辨率下工作,然后当我尝试使用不同分辨率的屏幕编辑它时,它会改变它并且看起来不一样。我向其中添加了一个包装 div,但它仍在执行,任何人都可以帮助我看看我做错了什么吗?任何建议将不胜感激!

这是我的 css 的全部内容:

#Wrapper {height: 100%;
width: 90%;
margin-right: auto;
margin-bottom: 1%;
margin-left: auto;}

#Title_Background {background: #3399FF;
position: absolute;
height: 15%;
width: 98%;
top: 0px;
left: 0px;
margin-right: 1%;
margin-left: 1%;
border-radius: 10px;}

#Title h1 {font-family: Arial;
font-size: 24px; 
color: black;
position: relative;
text-align: center;
top: 20px;}

#img1 {position: absolute;
height: 2%;
width: 4%;
top: 22px;
left: 51px;}

#LeftNav {background: #3399FF;
position: absolute;
float: left;
clear: left;
height: 82%;
width: 9%;
top: 16%;
left: 0px;
border-radius: 10px;
margin: 1%;}

#LeftNav p {font-family: Arial;
font-size: 18px;
text-align: center;
padding: 10px;
margin-top: 90px;
margin-right: 1%;
margin-left: 1%;
position: relative;
border: 3px solid #000000;
border-style: outset;}

.Inset p {position: relative;
border: 3px solid #000000;
border-style: inset !important;}

.Content {background: yellow;
position: absolute;
height: 60%;
width: 72%;
top: 250px;
left: 14%;
margin: 0 auto;}

.Content p {font-family: Arial;
font-size: 20px;
top: 200px;
text-align: center;}

#RightNav {background: #3399FF;
position: absolute;
float: right;
clear: right;
height: 82%;
width: 9%;
top: 16%;
right: 0px;
border-radius: 10px;
margin: 1%;}

At the moment my css will work on one resolution and then when I try and edit it with a screen with a different resolution, it changes it and doesn't look the same. I added a wrapper div to it, but its still doing it, can anybody help me see what I'm doing wrong? Any suggestions will be much appreciated!

Here is the whole of my css:

#Wrapper {height: 100%;
width: 90%;
margin-right: auto;
margin-bottom: 1%;
margin-left: auto;}

#Title_Background {background: #3399FF;
position: absolute;
height: 15%;
width: 98%;
top: 0px;
left: 0px;
margin-right: 1%;
margin-left: 1%;
border-radius: 10px;}

#Title h1 {font-family: Arial;
font-size: 24px; 
color: black;
position: relative;
text-align: center;
top: 20px;}

#img1 {position: absolute;
height: 2%;
width: 4%;
top: 22px;
left: 51px;}

#LeftNav {background: #3399FF;
position: absolute;
float: left;
clear: left;
height: 82%;
width: 9%;
top: 16%;
left: 0px;
border-radius: 10px;
margin: 1%;}

#LeftNav p {font-family: Arial;
font-size: 18px;
text-align: center;
padding: 10px;
margin-top: 90px;
margin-right: 1%;
margin-left: 1%;
position: relative;
border: 3px solid #000000;
border-style: outset;}

.Inset p {position: relative;
border: 3px solid #000000;
border-style: inset !important;}

.Content {background: yellow;
position: absolute;
height: 60%;
width: 72%;
top: 250px;
left: 14%;
margin: 0 auto;}

.Content p {font-family: Arial;
font-size: 20px;
top: 200px;
text-align: center;}

#RightNav {background: #3399FF;
position: absolute;
float: right;
clear: right;
height: 82%;
width: 9%;
top: 16%;
right: 0px;
border-radius: 10px;
margin: 1%;}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

作死小能手 2024-12-25 09:02:14

我认为您可能想研究一下“响应式设计”
这是一篇文章:
http://thinkvitamin.com/design/beginners-guide-to-响应式网页设计/
你可以通过谷歌等获得更多信息。

简短摘要:结合使用几种技术,您可以使您的网页支持各种分辨率。

@media 标签可以帮助您定位某些分辨率或范围,并调整大小或更改内容以适应。

I think that you might want to look into "Responsive Design"
Here is an article:
http://thinkvitamin.com/design/beginners-guide-to-responsive-web-design/
and you can get more via google, ect.

Short summary: Using the combination of a few techniques you can make your webpages available to a variety of resolutions.

The @media tag can help you target certain resolutions or ranges, and resize or change things to fit.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文