I have a simple paragraph within a sample website I am attempting to create. However, whenever I put in a large amount of text in the paragraph, instead of going to a new line it waits until it hits the body's margin limit, despite the fact I have specified a certain width. CSS:
*{
margin:0px;
padding:0px;
}
h1{
font: bold 20px Arial;
}
h2{
font: bold 14px Arial;
}
header, section, footer, aside, nav, hgroup, article{
display:block;
}
body{
text-align:center;
}
#body-wrapper{
border: 1px solid black;
width:1000px;
margin: 20px auto;
text-align: left;
}
#top-heading{
background-color: blue;
padding: 20px;
}
#nav-bar{
background-color: green;
color: white;
font: bold 14px Arial;
}
#nav-bar ul{list-style-type:none;}
#nav-bar li{
display:inline-block;
padding: 7px;
}
#main-content{
float:left;
width:660px;
margin:30px;
background-color:#E8E8E8;
box-shadow: 5px 5px 5px #888888;
margin-bottom:100px;
border-radius:15px;
left:20px;
}
#side-content{
float:left;
width:220px;
margin: 20px 0px;
padding:30px;
}
#bottom-info{
clear:both;
text-align:center;
padding:10px;
border-top: 1px solid black;
}
article{
padding:25px;
}
hrgoup p{
width:200px;
}
HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>AJC inc.</title>
<link rel="stylesheet" href="main.css">
<script src="javascript.js"></script>
</head>
<body onLoad="browserCheck();">
<header id="top-heading"><h1>Temporary header</h1>
</header>
<div id="body-wrapper">
<nav id="nav-bar">
<ul>
<li>Stuff</li>
<li>Mo stuff</li>
<li>Pizza</li>
</ul>
</nav>
<section id="main-content">
<article>
<hgroup>
<h1>Header 1</h1>
<h2>Sub header</h2>
<p>Info goes here</p>
</hgroup>
</article>
<article>
<hgroup>
<h1>Header 2</h1>
<h2>Sub header 2</h2>
<p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
</hgroup>
</article>
</section>
<aside id="side-content">
</aside>
<footer id="bottom-info">
<p>Copyright 2014 AJC</p>
</footer>
</div>
</body>
</html>