当我将其调整到最小的宽度和/或使我的网页响应迅速的宽度时,请提供代码的帮助,以显示我的完整网页。

发布于 2025-01-24 19:08:07 字数 873 浏览 4 评论 0原文

我目前正在我的个人网站上工作,但是我很难尝试使我的代码正确工作。

我要发布图片,以显示我在查看的内容我的网站上的宽度最大我的网站最小的宽度,我还将添加链接到我的网站链接到我的github代码

我正在寻找可以指向正确方向的信息/代码,或者帮助我让我的网站响应

在此处的大小>”和“< div>”我想要响应迅速(我不确定这是否应该在这里看的地方,但我确实知道这一切都应该放入 @media仅屏幕和(max宽:1000px){}

body{
    font-family: 'Press Start 2P', cursive;
            margin: 0;
}

.main-area{
    display: flex;
    height: 100%;
    justify-content: space-between;
    align-items: center;
}

I am currently working on my personal website, yet I am having trouble trying to get my code to work correctly.

I am going to post pictures to show what I am looking at My website at the largest width and My website at the smallest width, and I will also add the link to my website and the link to my GitHub code

I am looking for information/code/anything that can point me in the right direction or help me get my website to be responsive to resizing

Here is the css code for my "< body >" and the "< div >" i want responsive (I am not sure if this is where i am supposed to be looking at either but i do know it all should be put in @media only screen and (max-width:1000px){})

body{
    font-family: 'Press Start 2P', cursive;
            margin: 0;
}

.main-area{
    display: flex;
    height: 100%;
    justify-content: space-between;
    align-items: center;
}

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

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

发布评论

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

评论(1

许一世地老天荒 2025-01-31 19:08:07

您要朝正确的方向前进。只需增加一些断点即可。

/* (phones, 600px and down) */
@media only screen and (max-width: 600px) {...}

/* (Large Phones, 768px and down) */
@media only screen and (max-width: 768px) {...}

/* (Tablets, 992px and down) */
@media only screen and (max-width: 992px) {...}

/*  ( laptops and desktops, 1200px and up) */
@media only screen and (min-width: 1200px) {...}

如果不可能,所有这些都至少为移动设备添加一个(最大宽度:768px)和一张平板电脑。

最小宽度表示您首先设计移动设备,然后向上进行较大的屏幕,max Width表示您先设计桌面,然后打破较小的屏幕。

然后在这些断点内添加了元素的规则。

就像您的Main-Araea一样,您可以这样做:

@media only screen and (max-width: 768px) {
    .main{
        height: "auto"
    }
    .main-area{
        display: block;
    }
}

它将使主体区域对移动设备看起来更好。像这种更改的属性一样,所有其他必要的元素并进行调整以使它们看起来更好,例如使图标更大并调整填充等。

You are going in the right direction. Just add a few more breakpoints.

/* (phones, 600px and down) */
@media only screen and (max-width: 600px) {...}

/* (Large Phones, 768px and down) */
@media only screen and (max-width: 768px) {...}

/* (Tablets, 992px and down) */
@media only screen and (max-width: 992px) {...}

/*  ( laptops and desktops, 1200px and up) */
@media only screen and (min-width: 1200px) {...}

if not possible for all of them add at least one for mobile devices (max-width: 768px) and one for tablets.

min-width means you are designing mobile first and then going upwards to larger screens and max-width means you are designing desktop first and then breaking for smaller screens.

Then inside those breakpoints add rules for the elements.

Like for your main-area you can do it something like this:

@media only screen and (max-width: 768px) {
    .main{
        height: "auto"
    }
    .main-area{
        display: block;
    }
}

it will make the main area look nicer for mobile devices. And like this change properties for all other necessary elements and make adjustment to make them look nicer for example making the icons bit larger and adjusting the padding etc.

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