Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

垂直居中效果不一致 #4

Open
linjiaqin12138 opened this issue Oct 23, 2021 · 1 comment
Open

垂直居中效果不一致 #4

linjiaqin12138 opened this issue Oct 23, 2021 · 1 comment

Comments

@linjiaqin12138
Copy link

第二章“垂直居中”的第四个小节“单个块级元素”的第三点“使用flex实现”中

#parent{
    display: flex;
    align-items: center;
}

//或

#parent{display: flex;}
.son{align-self: center;}

效果如下
image

#parent{
    display: flex;
    flex-direction: column;
    justify-content: center;
}

效果如下
image
效果不一致,后者才是正确的

@linjiaqin12138
Copy link
Author

Edge浏览器

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant