There are two ways to do this. You can include it at the top of the HTML file in the <head> section. Or you can have a separate CSS file, which is the norm, and link it in the head file.
Your CSS file will look like this:
File name: style.css and save it in the same folder as the HTML file.
body{
margin:auto;
display:block;
}
div{
border:1px dashed red;
}
#box{
margin:auto;
width: 1100px;
height: 500px;
}
#LeftColumn{
margin-top: 50px;
margin-left: 20px;
width:40%;
float:left;
}
#RightColumn{
margin-top: 50px;
margin-right: 20px;
width:40%;
height:200px;
float:Right;
}
.BoxData{
text-align:right;
font-weight:bold;
margin-top:20px;
}
.BoxTitles{
width:73%;
color:#B18904;
text-align:left;
border-bottom:2px solid #B18904;
}
Then in the <head> section link in the css file like this:
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
If storing the css in the head of the file then it would look like this:
<head>
<style>
body{
margin:auto;
display:block;
}
div{
border:1px dashed red;
}
#box{
margin:auto;
width: 1100px;
height: 500px;
}
#LeftColumn{
margin-top: 50px;
margin-left: 20px;
width:40%;
float:left;
}
#RightColumn{
margin-top: 50px;
margin-right: 20px;
width:40%;
height:200px;
float:Right;
}
.BoxData{
text-align:right;
font-weight:bold;
margin-top:20px;
}
.BoxTitles{
width:73%;
color:#B18904;
text-align:left;
border-bottom:2px solid #B18904;
}
</style>
</head>
More on external stylesheets:
CSS How to[
^]