Quick Search
Sunbelthost Hosting - Colocation and Dedicated Servers

Threads: 21,763
Posts: 83,205
Members: 24,315
Newest member: joemccue

Web Hosting


 
  #1  
Old 11 Aug 2009, 01:30 PM
Alexancho Alexancho is offline
Established Member
 
Join Date: Aug 2009
Posts: 14
CSS positioning problems

I am creating a website using CSS. It must be something like this:
http://webdesign-gold.awardspace.biz/model_1.html
A picture of a header(fuchsia) is made from many small fragments. The same with a navigation bar(green). To perform this task i used absolute positioning for these fragments. So, actually i need everything in this website to be positioned absolutely. But i can't. Everything is moving instead of the picture. Something obviously wrong with the positioning:
http://webdesign-gold.awardspace.biz...e1/index1.html
I uploaded only a few fragments of a pictures, hope it doesn't create problems for understanding. Could you help me to understand what is wrong?

HTML:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Webmaster2008_first example</title>
<meta http-equiv="Content-Type" content="text/html; charset=ANSI" />
<link rel="stylesheet" href="styles.css" type="text/css" />
</head>

<body>

<div id="container">
<div id="header">

<!-- Definition of a cod for building the top part of the header -->

<div id="index_01">
<img src="images/index_01.jpg"/>
</div>
<div id="index_02">
<img src="images/index_02.jpg"/>
</div>
<div id="index_03">
<img src="images/index_03.jpg"/>
</div>
<div id="index_04">
<img src="images/index_04.jpg"/>
</div>
<div id="index_05">
<img src="images/index_05.jpg"/>
</div>
<div id="index_06">
<img src="images/index_06.jpg"/>
</div>
<div id="index_07">
<img src="images/index_07.jpg"/>
</div>
<!-- End of a cod for building the top part of the header -->

<!-- Definition of cod for building the middle part of the header -->

<div id="index_08">
<img src="images/index_08.jpg"/>
</div>
<div id="index_09">
<img src="images/index_09.jpg"/>
</div>
<div id="index_10">
<img src="images/index_10.jpg"/>
</div>
<div id="index_11">
<img src="images/index_11.jpg"/>
</div>
<div id="index_12">
<img src="images/index_12.jpg"/>
</div>
<div id="index_13">
<img src="images/index_13.jpg"/>
</div>
<div id="index_14">
<img src="images/index_14.jpg"/>
</div>
<div id="index_15">
<img src="images/index_15.jpg"/>
</div>
<div id="index_16">
<img src="images/index_16.jpg"/>
</div>
<div id="index_17">
<img src="images/index_17.jpg"/>
</div>
<div id="index_18">
<img src="images/index_18.jpg"/>
</div>
<div id="index_19">
<img src="images/index_19.jpg"/>
</div>
<!-- The picture of the header is created -->

<!-- blue stripe -->
<div id="index_21">
<img src="images/index_21.jpg" width="770" height="10" />
</div>
<!-- end of blue stripe -->

</div> <!-- end #header -->

<!-- Hotel search and Special offer -->

<div id="index_23">
<img src="images/index_23.jpg" width="616" height="95" />
</div>
<div id="index_27">
<img src="images/index_27.jpg" width="245" height="27" />
</div>
<div id="index_24">
<img src="images/index_24.jpg"/>
</div>
<div id="index_25">
<img src="images/index_25.jpg"/>
</div>
<div id="index_26">
<img src="images/index_26.jpg"/>

</div>
<div id="index_28">
<img src="images/index_28.jpg"/>
</div>
<div id="index_29">
<img src="images/index_29.jpg"/>
</div>

<div id="content">
<div id="content_left">
<img src="images/index_31.jpg" alt="airplane" />

<div class="box">
<img src="images/index_34.jpg" align="middle">
<p class="left_box"> <b>fonte lactis ubertim manante:</b> atque aundante opis egentissimum et illoa dhuc uno
alimento vitam ucentemon sortem non pati. sed blante tole ran tur haec, non quia .
<br />
<span class="readmore"><a href="#" target="_blank">read more>></a></span> </p>
</div>

<p> &nbsp; </p>

<div class="box">
<img src="images/index_34.jpg" align="middle">
<p class="left_box"> <b>fonte lactis ubertim manante:</b> atque aundante opis egentissimum et illoa dhuc uno
alimento vitam ucentemon sortem non pati. sed blante tole ran tur haec, non quia
.<br />
<span class="readmore"><a href="#" target="_blank">read more>></a></span> </p>
</div>

<p> &nbsp; </p>

<div class="box">
<img src="images/index_34.jpg" align="middle">
<p class="left_box"> <b>fonte lactis ubertim manante:</b> atque aundante opis egentissimum et illoa dhuc uno
alimento vitam ucentemon sortem non pati. sed blante tole ran tur haec, non quia
.<br />
<span class="readmore"><a href="#" target="_blank">read more>></a></span> </p>
</div>


</div> <!-- end #content_left -->
<div id="content_right">

</div> <!-- end #content_right -->

<br class="clearfloat" />
</div> <!-- end #content -->

<div id="menu_bottom">
</div> <!-- end #menu_bottom -->

<div id="footer">
</div> <!-- end #footer -->
</div> <!-- end #container -->

</body>
</html>
CSS:

Code:
body{
margin: 0;
padding: 0;
background-image:url('images/main_bg.jpg');
background-repeat:repeat;
}

a:link, a:visited { color: blue; text-decoration: none; font-weight: bold;}
a:active, a:hover { color: blue; text-decoration: underline;}

#container {
width: 770px;
margin: 0 auto;
padding: 0;
border-left: 0px
border-right: 0px
background-color: AliceBlue;
text-align: left;
}

#header {
background-color: fuchsia;
}

/* pictures of a header. */

#index_01 {
position: absolute;
left: 200px;
top: 0 px;
}
#index_02 {
position: absolute;
left: 323px;
top: 0 px;
}
#index_03 {
position: absolute;
left: 402px;
top: 0 px;
}
#index_04 {
position: absolute;
left: 509px;
top: 0 px;
}
#index_05 {
position: absolute;
left: 616px;
top: 0 px;
}
#index_06 {
position: absolute;
left: 728px;
top: 0 px;
}
#index_07 {
position: absolute;
left: 847px;
top: 0 px;
}
#index_08 {
position: absolute;
left: 200px;
top: 29px;
}
#index_09 {
position: absolute;
left: 261px;
top: 29px;
}
#index_10 {
position: absolute;
left: 323px;
top: 29px;
}
#index_11 {
position: absolute;
left: 389px;
top: 29px;
}
#index_12 {
position: absolute;
left: 524px;
top: 29px;
}
#index_13 {
position: absolute;
left: 823px;
top: 29px;
}
#index_14 {
position: absolute;
left: 893px;
top: 29px;
}
#index_15 {
position: absolute;
left: 524px;
top: 58px;
}
#index_16 {
position: absolute;
left: 524px;
top: 133px;
}
#index_17 {
position: absolute;
left: 752px;
top: 133px;
}
#index_18 {
position: absolute;
left: 752px;
top: 185px;
}
#index_19 {
position: absolute;
left: 752px;
top: 204px;
}
/* end of pictures of a header */
/* blue stripe */
#index_21 {
position: absolute;
left: 200px;
top: 220px;
}


/* Hotel search and Special offer */

#index_23 {
position: absolute;
left: 200px;
top: 235px;
}
#index_24 {
position: absolute;
left: 616px;
top: 235px;
}
#index_25 {
position: absolute;
left: 690px;
top: 235px;
}
#index_26 {
position: absolute;
left: 845px;
top: 235px;
}
#index_27 {
position: absolute;
left: 200px;
top: 330px;
}

#index_28 {
position: absolute;
left: 445px;
top: 330px;
}
#index_29 {
position: absolute;
left: 544px;
top: 330px;
}

/* End of Hotel search and Special offer */

#index_31 {
position: absolute;
left: 200px;
top: 357px;
}

/* content */

#content {
width: 770px;
padding: 0px;
top:357px
background-color: Gainsboro; /* gray */
}

/* content_left */

#content #content_left {
float: left;
margin-top: 357px;
width: 256px;
background-color: aqua;
position: absolute;
}

#content_left img {
margin-left: 0px;
margin-top: 0px;
padding: 0px;
}

#content_left .box {
float: left;
width: 256px;
}

.box img {
float: left;
margin-right: 0px;
}

.box p.left_box {
font-family: verdana;
font-size: 10px;
color: blue;
margin-left: 18px;
margin-right: 21px;
}

.box p.left_box > b:first-child
{
font-weight:bold
}

.box .readmore {
font-family: verdana;
font-size: 10px;
color: blue;
padding-top:0px;
padding-left:131px;
}

#content #content_right {
float: right;
width: 12em;
}

#footer p {
margin: 0;
padding: 10px 0;
background-color: #DDDDDD;
text-align: center;
font-size: .8em;
}
.clearfloat {
clear: both;
height: 0;
font-size: 1px;
}
Reply With Quote
  #2  
Old 11 Aug 2009, 02:36 PM
Wickham's Avatar
Wickham Wickham is offline
Established Member
 
Join Date: Feb 2006
Location: Salisbury UK
Posts: 3,865
Your second link doesn't work.
__________________
Code downloaded to my PC will be deleted in due course.
WIN XP SP3; IE7, Firefox 3.5, Opera and Safari for Windows; screen resolution usually 1024x768.
IE6 on W98 with 800*600. IE8 RTM on Vista 1440*900.
Reply With Quote
  #3  
Old 11 Aug 2009, 02:45 PM
Corrosive's Avatar
Corrosive Corrosive is offline
Established Member
 
Join Date: Apr 2009
Location: Bristol, U.K.
Posts: 748
Quote:
Originally Posted by Alexancho View Post
So, actually i need everything in this website to be positioned absolutely.
Then you are doomed to failure from the start IMO. Use relative positioning for site structure. Why do you want to position everything absolutely?
__________________
Corrosive
Multi-method cat-skinning a speciality

Bristol Web and Graphic Design / Bristol IT Support / Corrosive Online
Reply With Quote
  #4  
Old 11 Aug 2009, 05:29 PM
smcg's Avatar
smcg smcg is offline
Newbie
 
Join Date: Jul 2009
Location: Dallas
Posts: 9
Quote:
Originally Posted by Corrosive View Post
Then you are doomed to failure from the start IMO. Use relative positioning for site structure. Why do you want to position everything absolutely?
yeah. what he said ^^ ... plus

are you using image slices and tiling to create the overall layout? I think you might be over complicating what you are trying to produce. you have a mock-up of the final product?

http://webdesign-gold.awardspace.biz...e1/index1.html <- good link to project

Last edited by smcg; 11 Aug 2009 at 05:31 PM. Reason: found link to replace the broken one
Reply With Quote
  #5  
Old 12 Aug 2009, 07:25 AM
Seo Stuttgart Seo Stuttgart is offline
New Member: Posts Will Be Moderated
 
Join Date: Aug 2009
Posts: 1
It's good,but you must see this site.


[deleted by mod :: new users aren't allowed links]
Reply With Quote
  #6  
Old 14 Aug 2009, 03:40 PM
Alexancho Alexancho is offline
Established Member
 
Join Date: Aug 2009
Posts: 14
Thank you very much. I think i can't do without absolute positioning in this particular task. I tried using relative positioning, but i think it created more problems that absolute positioning. Anyway I've put things in order and did validation, have found some mistakes and afterward the problem was solved.
Reply With Quote
Reply

Tags
css problems

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with CSS positioning ZekeLL Web Design, HTML Reference and CSS 1 26 May 2008 12:37 PM
Problems Positioning with CSS kirstybandm Web Design, HTML Reference and CSS 0 17 Jan 2006 05:33 AM
Having Problems with CSS Positioning kirstybandm Web Design, HTML Reference and CSS 1 13 Jan 2006 09:28 AM


All times are GMT -5. The time now is 01:22 PM.


 

Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Forums Copyright © 2004-2010, WebDevForums.com. Web design by Miami Web Design. All Rights Reserved.