我是新的编程,我试图让这4行文本是4个单独的行,而不是1单行,有人可以解释我的代码有什么问题吗?谢谢你!
<div class="row">
<div clas="col">
<p>Hello</p>
</div>
<div class=col"
<p>Hello</p>
</div>
div clas="col">
<p>Hello</p>
</div>
<div class=col"
<p>Hello</p>
</div>
</div>
尝试在CSS中使用Flex属性
https://css-tricks.com/snippets/css/a-guide-to-flexbox/
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.row{
display: flex;
flex-direction: row | row-reverse | column | column-reverse;
}
</style>
</head>
<body>
<div class="row">
<div class="col">
<p>Hello</p>
</div>
<div class=col">
<p>Hello</p>
</div>
<div clas="col">
<p>Hello</p>
</div>
<div class=col">
<p>Hello</p>
</div>
</div>
</body>