In the CSS div div
, I set the display
property value to inline
and the .nav
classed <div>
in the HTML disappeared. The .nav
classed <div>
appears only if I remove the display: inline;
property.
Here is my code:
* {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
}
div div {
display: inline;
}
.nav {
color: white;
background-color: red;
position: relative;
width: 200px;
}
<body>
<div class="container">
<div class="nav">
<h2>Menu Bar<h2>
<ul><li>Option1</li><li>Option2</li><li>Option3</li></ul>
</div>
<div class="main">
<h1>Site Title</h1>
<p id="dp">Here is the paragraph.<p></div>
</div>
</div>
</body>