Sidebar with border : Siderbar « CSS Controls « HTML / CSS






Sidebar with border

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Margins, Padding, Borders, and Backgrounds</title>
<style type="text/css">
/* reset styles */
html, body, h1, h2, h3, h4, h5, h6, p, ol, ul, li, pre, code, address, variable, form, fieldset, blockquote {
 padding: 0;
 margin: 0;
 font-size: 100%;
 font-weight: normal;
}
/* end reset styles */

html {
  background-color: #FDF8AB;
} 

body {
  background-color: #FFF;
  border: 3px solid #85A110;
  width: 760px;
  margin-top: 20px;
  margin-left: auto;
  margin-right: auto;
  padding: 15px;
}

h1 {
  font-size: 44px;
  font-family: Georgia, "Times New Roman", Times, serif;
  letter-spacing: 1px;
  color: #85A110;
  text-transform: uppercase;
  background-color: #E2EBB4;
  padding: 5px 15px 2px 15px;
  margin: 0 -15px 20px -15px;
}
h2 {
  font-size: 24px ;
  font-family: "Arial Narrow", Arial, Helvetica, sans-serif;
  color: #F96B18;
  border-top: 2px dotted #8DA516;
  border-bottom: 2px dotted #8DA516;
   padding-top: 5px;
  padding-bottom: 5px;
  margin: 15px 0 5px 0;
  overflow: hidden;
  zoom: 1;
}

.sidebar {
  width: 30%;
  float: right;
  margin: 10px;
  background-color: #FAEBC7;
  padding: 10px 20px;
  border: 1px dotted #FC6512;
  border-top: 20px solid #FC6512;
}

.sidebar h2 {
  border: none;
  margin-top: 0;
  padding: 0;
}

* html .sidebar {
 display: inline;
}


</style>
</head>

<body id="article">
  <h1>Heading</h1>
  <p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. </p>
<div class="sidebar">  
  <h2>NOTE</h2>
<p class="note">Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est.</p>
</div>
  <h2>Heading 2</h2>
  <p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores.</p>
<h2>Not Me!</h2>
<p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. </p>
  <h2>Me Neither!</h2>
  <p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam.</p>
  <p>Copyright 2010, The Lorem Ipsum Corporation</p>

</body>
</html>

   
  








Related examples in the same category

1.siderbar float right
2.Content floats left, side bar floats right
3.Sidebar with absolute position
4.Inner left and right bar
5.Sidebar with float left
6.Side bar contains list
7.side bar 2
8.Link bar with dotted line
9.Latest news sidebar
10.Sidebar with link and text
11.Sidebar with read more link
12.Text paragraph with sidebar
13.Div Sidebar padding: 0 38px 45px 29px;
14.Div Sidebar width: 328px;
15.Div Sidebar float: left;
16.Div based sidebar
17.Sidebar column
18.Sidebar with read more link 3
19.Layout for sidebar and article
20.Navigation sidebar
21.Two columns with sidebar
22.position: absolute; Sidebar
23.Sidebar Link list
24.Sidebar with right border
25.Links inside sidebar
26.Sidebar title
27.Sidebar with read more
28.Sidebar with around corner
29.Login form inside sidebar
30.Shading sidebar title
31.Using border to add boundary to the sidebar item
32.Sidebar with two columns
33.With link sidebar on both sides
34.Site news inside sidebar
35.Sidebar floating right
36.Sidebar Links with mouse hover effect
37.Using H4 as the sidebar section title
38.Sidebar li a:hover background:#94CC29;
39.Link side bar
40.Two column links and text
41.Two column right link bar