вы можете дать им width:100%
, чтобы они заняли ряд:
* {
box-sizing: border-box;
}
ul {
list-style-type: none;
margin: 0%;
padding: 0%;
overflow: hidden;
background-color:gray;
}
h1 {
font-size: 170%;
}
body {
margin: 0;
font-family: Arial, Helvetica, sans-serif;
background-color: lightsteelblue;
}
/* Create two equal columns that floats next to each other */
.column {
float: left;
width: 100%;
padding: 10px;
height: 300px;
/*
width:50%
margin:25%;
margin-top:0px;
margin-bottom:0px;
*/
}
/* Clear floats after the columns */
.row:after {
content: "";
display: table;
clear: both;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="css/Publikation.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title> Publikation </title>
</head>
<body>
<h1 align="center">Publikation av webbplatser med och utan webbpubliceringssystem</h1>
<ul>
</ul>
<style>
</style>
<div class="row">
<div class="column" style="background-color: #aaa;">
<h2>column1</h2>
</div>
<div class="column" style="background-color: #bbb;">
<h2>column2</h2>
</div>
</div>
</body>
</html>
или вы можете дать им поле, чтобы они занимали как левую, так и правую стороны, чтобы каждый занимал по строке:
* {
box-sizing: border-box;
}
ul {
list-style-type: none;
margin: 0%;
padding: 0%;
overflow: hidden;
background-color:gray;
}
h1 {
font-size: 170%;
}
body {
margin: 0;
font-family: Arial, Helvetica, sans-serif;
background-color: lightsteelblue;
}
/* Create two equal columns that floats next to each other */
.column {
float: left;
padding: 10px;
height: 300px;
width:50%;
margin:25%;
margin-top:0px;
margin-bottom:0px;
}
/* Clear floats after the columns */
.row:after {
content: "";
display: table;
clear: both;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="css/Publikation.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title> Publikation </title>
</head>
<body>
<h1 align="center">Publikation av webbplatser med och utan webbpubliceringssystem</h1>
<ul>
</ul>
<style>
</style>
<div class="row">
<div class="column" style="background-color: #aaa;">
<h2>column1</h2>
</div>
<div class="column" style="background-color: #bbb;">
<h2>column2</h2>
</div>
</div>
</body>
</html>
, если вы решите использовать поля, обратите внимание, что вам необходимо настроить размеры и поля для разных размеров экрана, используя
CSS Правила для носителей