不能让align-self在flexbox容器中工作
16lz
2021-01-22
My code is below.
我的代码如下。
/* Global */
* {
box-sizing: border-box;
font-family: 'Ubuntu', sans-serif;
}
/* Container */
#container {
width: 100vw;
height: 100vh;
display: flex;
flex-direction: column;
}
/* About Me */
.about-me {
width: 100vw;
height: 50vh;
background-color: #9b59b6;
}
.my-information {
text-align: center;
align-self: flex-end;
}
/* Blog Posts */
.blog-posts {
width: 100vw;
height: 50vh;
background-color: #3498db;
}
/* Media Query (Desktop And Bigger) */
@media (min-width: 1100px) {
/* Container */
#container {
flex-direction: row;
}
/* About Me */
.about-me {
height: 100vh;
}
/* Blog Posts */
.blog-posts {
height: 100vh;
}
}
<!DOCTYPE html>
<html>
<head>
<!-- Meta -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Title -->
<title>Saad Al-Sabbagh</title>
<!-- CSS -->
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Ubuntu">
<link rel="stylesheet" href="css/main.css">
</head>
<body>
<!-- Container -->
<div id="container">
<div class="about-me">
<div class="my-information">
<h1>A person</h1>
<p>Front-End Web Developer, Blogger and an author on
<a href="#">SitePoint</a>.</p>
</div>
</div>
<div class="blog-posts">
</div>
</div>
</body>
</html>
更多相关文章
- HTML5用户身份认证源代码:注册、登录、会话保持的解决方案
- 将PHP代码添加到.html文件
- 如何让你的前端代码更像HTML5(用语义元素构造html5)
- 如何在CSS中单独定位此HTML代码?
- QQ、MSN、淘包旺旺、Skype常设对话的html链接代码
- 10段实用的HTML5代码
- 用JavaScript实现两种功能:1、切换全选/全不选文字;2、根据选中个
- HTML5+学习笔记2-------边看代码边研究貌似还是有点问题...还在
- PHP代码在不需要时在Javascript中自动运行[重复]