Soldato
link to site would be great, at least the code.
Hit a rock 2day.
Ive been trying to make a side bar with links to different parts of my website. But I cant seem to get the side bar to go on the left handle side and look detached from the content bit.
Ive been following Jeffery Way's video on floating and simple lay out but it just doesnt want to work for me
.container {
width: 960px
margin: auto
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Title goes here</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<div class="header">
<h1>Header goes here</h1>
</div>
<div class="nav">
<ul>
<li>Links</li>
<li>Links</li>
<li>Links</li>
<li>Links</li>
<li>Links</li>
</ul>
</div>
<div class="content">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
<div class="footer">
<p>Footer goes here</p>
</div>
</div>
</body>
</html>
h1, ul, li, p {
margin: 0;
padding-top: 0;
padding-bottom: 0;
}
.container {
width:960px;
margin: auto;
background-color: #666;
}
.header {
background-color: red;
height: 100px;
}
.nav {
background-color: green;
width: 20%;
float: left;
}
.content {
background-color: blue;
}
.content p {
margin-left: 20%;
}
.footer {
background-color: yellow;
height: 100px;
clear: both;
}
<html>
<head>
<title>CF</title>
<link rel="stylesheet" href="css/Quick.css"/>
</head>
<body>
<div class="container">
<div class="header">
<h1> Cystic Fibrosis </h1>
</div>
<ul class="lsidebar">
<li><a href="Cystic Fibrosis Website.html">What is CF?</a></li>
<li><a href="Lungs Cystic Fibrosis.html">Which Organs are affected?</a></li>
<li><a href="#">Anoxeria in CF</a></li
><li><a href="Contact Me.html">Contact Me</a></li>
</ul>
<div class="wrap">
<h2> About CF</h2>
<p>
<strong>Cystic Fibrosis</strong> is a <em>disease.</em>
</p>
<dl>
<h3><dt>Organs affected in CF</dt></h3>
<ul><li><a href="Lungs Cystic Fibrosis.html"">Lungs</a></li></dt>
<li>Testes</li>
</ul>
</dl>
<blockquote>
<p>
"Hello, how have you got on?"
</p>
</blockquote>
<p> Visit the <a href="http://www.cftrust.org.uk/aboutcf/whatiscf/" target=_blank"> CF trust website. </a>.</p>
<img src="Images/New Human Body.jpg" alt"Image of the Human Body"/>
</div>
</div>
</div>
</body>
</html>
body {
background:#66FFB3;
}
.container {
width: 800px;
margin: auto;
background:#EEE;
}
.wrap {
width:400px
margin-left: auto;
background:#FFF;
}
.lsidebar{
padding-left:0px;
list-style:none;
border-bottom:none;
float:left;
width:203px;
height: 600px;
}
ul.lsidebar li{
float:left;
}
ul.lsidebar a{
width:12em;
display:block;
border:none;
padding:5px;
margin-right:10px;
background-color:#234f32;
text-decoration:none;
color: #0F6;
text-align:center;
}
ul.lsidebar a:hover{
width:12em;
display:block;
border:none;
padding:5px;
margin-right:5px;
background-color:#92cc47;
color:#4FFFA7;
text-decoration:none;
text-align:center;
}
a{
color: red;text-decoration: none;
font-family: Tahoma, Geneva, sans-serif;
}
h1 {
font-family: Tahoma, Geneva, sans-serif;
text-align:center
}
h2,h3, h4 {
font-family:Tahoma, Geneva, sans-serif;
padding-left: 20px;
}
p {
font-family: Tahoma, Geneva, sans-serif;
padding-left: 20px;
}
Now onto my next problem..... how to i get it to sych the sidebar in with the header so there is no gap.
how do i code for my side bar to carry on going down?
i cant seem to move my text in the wrapper away from the sidebar...ive tried text indent and padding left but neither have been successful
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>CF</title>
<link rel="stylesheet" href="style.css"/>
</head>
<body>
<div class="container">
<div class="header">
<h1> Cystic Fibrosis </h1>
</div>
<div class="lsidebar">
<ul>
<li><a href="Cystic Fibrosis Website.html">What is CF?</a></li>
<li><a href="Lungs Cystic Fibrosis.html">Which Organs are affected?</a></li>
<li><a href="#">Anoxeria in CF</a></li>
<li><a href="Contact Me.html">Contact Me</a></li>
</ul>
</div>
<div class="content">
<h2> About CF</h2>
<p>
<strong>Cystic Fibrosis</strong> is a <em>disease.</em>
</p>
<h3>Organs affected in CF</h3>
<ul>
<li><a href="Lungs Cystic Fibrosis.html">Lungs</a></li>
<li>Testes</li>
</ul>
<blockquote>
"Hello, how have you got on?"
</blockquote>
<p>Visit the <a href="http://www.cftrust.org.uk/aboutcf/whatiscf/">CF trust website.</a></p>
<img src="Images/New Human Body.jpg" alt="Image of the Human Body"/>
</div>
</div>
</body>
</html>
body {
background:#66FFB3;
font-family: Tahoma, Geneva, sans-serif; /* will apply the font-family to all elemens within the body*/
}
a{
color: red;text-decoration: none;
}
h1 {
text-align:center;
}
h2,h3, h4 {
padding-top:0;
margin-top:0;
}
.container {
width: 800px;
margin: auto;
background:#EEE;
}
.header {
height: 50px;
background-color: pink;
}
.header h1{
margin:0;
}
.content {
background:#666;
margin-left:203px; /* Content area starts 203px from the container wall*/
padding:10px; /* Sets the padding around the content area*/
height:600px;
}
.lsidebar{
background: #CCC;
list-style:none;
float:left;
width:203px;
height: 620px; /* header (50px) + content (600px) + content padding (20px [10px top and bottom]) = 620px*/
}
.lsidebar a{
background-color:#234f32;
text-decoration:none;
color: #0F6;
text-align:center;
}
.lsidebar a:hover{
background-color:#92cc47;
color:#4FFFA7;
text-decoration:none;
text-align:center;
}
.content img{
padding-left:200 (or whatever)px;
}