Banner

Sponsor

Login


Welcome Back!
Guest
Guest

Register

Lost your password?

84 users online



CSS Positioning

CSS Positioning

Currently viewing this thread: 1 (0 members and 1 guests)


darkobjects

darkobjects

Status: Offline!

CSS Positioning

i am making a layout for the admin part of my cms, and i ran into a problem with the positioning of a block. i want my links to be on the left of the content and still with in the outside border. I have tried absolute postion, which is in the picture, and i've tried relative position, which puts the links below the content.
Here is the html file

Code:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Admin Section</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="styles/style.css" type='text/css' rel='stylesheet' media="screen" title="Admin" />
<script langauage="javascript" src="../styles/global/functions.js" type="text/javascript"></script>
</head>

<body>
<div id='wrapper'>
<div id='intro'>
<div id='header'>

<h1><a href='index.php'>Evic Administration</a></h1>
</div>
<div id='location'>
<h1>Location</h1>
<span> » <strong>Home</strong></span>
</div>
</div>

<div id='content'>

<div class='block'>
<h1>Stats</h1>
<div class='section-table'>
<span class='section-tab section-header' style='width:40%;min-width:20px;'>Section:</span>
<span class='section-tab section-header' style='width:40%;min-width:20px;'>Latest:</span>
<span class='section-tab section-header' style='width:18%;min-width:10px;'>Count:</span>
<div class='clear'> </div>
<span class='section-tab' style='width:40%;min-width:20px;'><strong>Users</strong></span>
<span class='section-tab' style='width:40%;min-width:20px;'>demo</span>

<span class='section-tab' style='width:18%;min-width:10px;'>3</span>
</div>
</div>
</div>
<div id='navigation'>
<div id='nav'>
<h1>Navigation</h1>
<ul>
<li><a href="index.php">Home</a></li>

<li><a href='?sect=system'>System</a></li>
<li><a href='?sect=plugins'>Plugins</a></li>
<li><a href='?sect=content'>Content</a></li>
<li><a href='?sect=users'>Users</a></li>
<li class='active'><a>Templates</a></li>
<li><a href='?sect=layouts'>Layouts</a></li>
</ul>
</div>
</div>

<div id='footer'>
<span>
Footer, this admin is not well written
</span>
</div>
</div>
</body>
</html>


the css file

Code:


/* CSS Document */
input, select{
background:#efefef;
height:15px;
font-size:10px;
color:#000000;
border:1px solid #808080;
}
input[type="file"]{
height:17px;
}
input[type="submit"]{
border:#808080 solid 1px;
font-size:10px;
height:16px;
font-weight:normal;
}
textarea{
background:#efefef;
background:#efefef;
height:100px;
width:300px;
font-size:10px;
color:#000000;
border:1px solid #808080;
}
body{
background:#efefef;
}
#wrapper{
position:relative;
bottom:0px;
height:100%;
width:760px;
background:#ffffff;
margin:0px auto;
/*margin-top:-30px;*/
border:1px solid #000000;
font-size:10px;
}
/* intro holds the header and the location bar ie Home >> BLah */
#intro{
margin-top:0px;
width:inherit;
height:110px;
background:url("imgs/header_stretch.jpg") repeat-x 0px 0;
}
#intro #header{
width:180px;
height:95px;
margin-top:0px;
margin-left:0px;
background:url("imgs/header_left.jpg") no-repeat 0;
}
#intro #header h1{
display:none;
}
#intro #location{
position:absolute;
top:94px;
width:inherit;
height:15px;
background:#000000;
font-size:10px;
font-weight:bold;
color:#ffffff;
padding:0px;
}
#intro #location h1{
margin:0px;
padding:0px;
float:left;
font-size:10px;
font-weight:bold;
}
#intro #location span a{
font-weight:bold;
color:#ffffff;
text-decoration:none;
}
#intro #location span{
float:left;
margin-left:0px;
}

/* Content is the blocks of the page */
#content{
position:relative;
height:auto;
/*margin-top:110px;*/
left:190px;
height:auto;
width:570px;
}
#content div.block{
}
#content div.block h1{
color:#F66804;
border-bottom:#cccccc solid 1px;
font-size:13px;
}
#navigation{
height:100%;
position:absolute;
top:100px;
}
#navigation #nav{
margin-top:0px;
width:125px;
border-left:60px solid #DFDFDF;
border-right:1px solid #DFDFDF;
padding:0px;
}
#navigation #nav h1{
font-size:13px;
padding-left:9px;
font-weight:bold;
color:#000000;
}
#navigation #nav ul{
/*list-style-image:url('link_image.jpg');*/
padding-left:4px;
padding-right:6px;
/*margin-left:15px;*/
}
#navigation #nav ul li{
border-bottom:1px dashed #cccccc;
display:block;
padding:5px 0px 5px 25px;
}
#navigation #nav ul li a{
color:#696969;
text-decoration:none;
font-size:11px;
font-weight:bold;
}
#footer{
position:relative;
clear:both;
width:inherit;
background:#000000;
color:#ffffff;
}
.table-list{
padding:1px;
margin-top:2px;
color:#000000;
}
.table-list .tr{
clear:both;
height:1px;
}
.table-list .th{
font-size:10px;
float:left;
padding-left:2px;
height:18px;
background:#CECECE !important;/*#24424A*/
border:1px solid #C5C5C5 !important;/*1D363D*//*#182d30*/
font-weight:bold;
}
.table-list .td{
font-size:10px;
float:left;
background:#DBDBDB;/*30535A*/
border:1px solid #D7D7D7;/*2D4D53*/
padding-left:2px;
height:18px;
}
.table-list .td-odd{
background:#CECECE !important;
}
.section-blank{
/*background:#9A9A9A;
border:1px solid #828282;*/
margin-top:1px;
margin-bottom:1px;
padding:2px;
font-weight:bold;
color:#000000;
font-size:13px;
width:100%;
}
.clear{
height:1px;
clear:both;
}


Thank you for your help

Attachments:

problem.jpg problem.jpg (Download) 93.94 Kb, 57 views

___________________


What was I talking about?

http://hosted.oxyscripts.com/sigs/sigs.php?id=13
-proud user of FIREBIRD

Tsukmar

Tsukmar

Student
Status: Offline!

can't you just have the part where the content is normally, and float:left the div with the links in it?

Code:


<style>
#links{float:left;width:200px;border-right:1px solid #000;}
</style>
<div id='content'>
content
<div id='links'>
links
</div>
</div>

___________________

how do you weigh human life?

darkobjects

darkobjects

Status: Offline!

I changed the code a bit to float and everything, and i got it working, thank you very much Grin
NOTE below is only the edited part

Code:


/* Content is the blocks of the page */
#content{
margin-top:0px;
position:relative;
height:auto;
float:left;
/*margin-top:110px;*/
left:190px;
height:auto;
width:570px;
}
#content div.block{
}
#content div.block h1{
color:#F66804;
border-bottom:#cccccc solid 1px;
font-size:13px;
}
#navigation{
margin-top:0px;
margin-left:-570px;
height:100%;
float:left;
top:100px;
}
#navigation #nav{
margin-top:0px;
width:125px;
border-left:60px solid #DFDFDF;
border-right:1px solid #DFDFDF;
padding:0px;
}
#navigation #nav h1{
font-size:13px;
padding-left:9px;
font-weight:bold;
color:#000000;
}
#navigation #nav ul{
/*list-style-image:url('link_image.jpg');*/
padding-left:4px;
padding-right:6px;
/*margin-left:15px;*/
}
#navigation #nav ul li{
border-bottom:1px dashed #cccccc;
display:block;
padding:5px 0px 5px 25px;
}
#navigation #nav ul li a{
color:#696969;
text-decoration:none;
font-size:11px;
font-weight:bold;
}

___________________


What was I talking about?

http://hosted.oxyscripts.com/sigs/sigs.php?id=13
-proud user of FIREBIRD

darkobjects

darkobjects

Status: Offline!

Nevermind, it still goes out of the container Sad

___________________


What was I talking about?

http://hosted.oxyscripts.com/sigs/sigs.php?id=13
-proud user of FIREBIRD

webarnes

webarnes

Neverside Newbie
Status: Offline!

I agree try to float: left. however make sure the nav is in the right place in the document flow.

<ul>
<li><a href="index.php">Home</a></li>

<li><a href='?sect=system'>System</a></li>
<li><a href='?sect=plugins'>Plugins</a></li>
<li><a href='?sect=content'>Content</a></li>
<li><a href='?sect=users'>Users</a></li>
<li class='active'><a>Templates</a></li>
<li><a href='?sect=layouts'>Layouts</a></li>
</ul>

<h1>Stats</h1>
<div class='section-table'>

Another pointer. Since you are moving toward css based design you should start to also think about symantics.
The document should flow:
h1, h2, h3, h4, etc.

here is example:
<h1>My Company Name</h1>
<h2>Tagline or company offering</h2>
<div class="left">
<h3>Nav</h3>
<ul>
<li>Anchor</li>
<li>Anchor</li>
<li>Anchor</li>
<li>Anchor</li>
<li>Anchor</li>
</ul>
<h3>Login</h3>
form stuff
</div>
<div class="right">
<h3>Page Title</h3>
<h4>Page sub title</h4>
<p>Some yada yada content</p>
<blockquote><p>Interesting Item</p></blockquote>
<p>Some yada yada content</p>
<p>Some yada yada content</p>
<dl>
<dt>Next Available Date</dt>
<dd>January 14th 2005</dd>
<dt>Course Length</dt>
<dd>8 Hours</dd>
<dt>Continuing Legal Education credits</dt>
<dd>Yes</dd>
<dt>Course Price</dt>
<dd>$169.00</dd>
</dl>
<p> So on and so forth</p>
</div>

The css may be buggy as well:

input[type="file"]{
height:17px;
}
input[type="submit"]{
border:#808080 solid 1px;
font-size:10px;
height:16px;
font-weight:normal;
}

I have not taken time to look this up but I am unfamiliar with this css formatting technique.
I have seen some new css-3 techniques but nothing like what you have.
William

___________________

http://webarnes.globalwebtech.com/images/zerolarge.gif

darkobjects

darkobjects

Status: Offline!

hello webarnes, i thank you for the help, but i do understand how to make the layout work if i moved where the links lie in the html document. I want to leave the html in the current order because i want to be able to move the layout around by just changing the css, and not having to move the html around everytime. So i tried to base the html setup around the way zen garden does theres.
As for the

Code:


input[type="file"]{
height:17px;
}
input[type="submit"]{
border:#808080 solid 1px;
font-size:10px;
height:16px;
font-weight:normal;
}


i got this from deviantart.com, and it works in firefox so i've just been using it.
thank you for the help, i guess i'm just going to have to keep on trying

___________________


What was I talking about?

http://hosted.oxyscripts.com/sigs/sigs.php?id=13
-proud user of FIREBIRD

Tsukmar

Tsukmar

Student
Status: Offline!

float takes an element out of the flow of the document, in modern css I can almost gurantee that you wont do it without moving the html, it doesnt mean the html has to be very unneat, its just inside the div instead. (maybe someone knows a way around it, but whatever it is it prolly wont be as browser compatable as putting the div in :/)

___________________

how do you weigh human life?

darkobjects

darkobjects

Status: Offline!

alright, thanks for your help guys.

___________________


What was I talking about?

http://hosted.oxyscripts.com/sigs/sigs.php?id=13
-proud user of FIREBIRD

Quick Jump:

Main Navigation


Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach


NeverAPI generated this page in 0.0117 seconds.