CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 21st, 2003, 09:50 AM
vaaaska vaaaska is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 178 vaaaska User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 1 h 38 m 4 sec
Reputation Power: 5
CSS layout problem...

this is killing me...i can't make this work...

the problem is everything shifts to the left margin at x=0px;y=0px...it should be centering itself on the page...what am i doing wrong?

in the stylesheet...

#alles {
position: relative;
width: 751px;
height: auto;
margin: 0px auto;
z-index: 1;
}
#topbox {
float: left;
position: relative;
width: 308px;
height: 36px;
top: 0px;
left: 40px;
text-align: left;
z-index: 1;
background-color: #000000;
}
#randadv {
float: right;
position: relative;
width: 388px;
height: 30px;
text-align: right;
z-index: 1;
padding-top: 3px;
}
#featuredthings {
position: absolute;
width: 358px;
left:393px;
top:36px;
height: 120px;
text-align: left;
background-color: #f3f3f3;
z-index: 1;
}
#limg {
position: absolute;
width: 40px;
left:0px;
top:171px;
height:auto;
text-align: left;
z-index: 1;
}
#blog {
position: absolute;
width: 325px;
left:40px;
top:171px;
height:104px;
text-align: left;
z-index: 1;
}

then it's called up like this...

<div id="alles">

<div id="topbox"></div>
<div id="randadv"><span class="topdate">Today is the best day you've ever had
today</span></div>

<div id="featuredthings"><span class="featured">Featured_things</span></div>

<div id="limg"><img src="imgs/3a.jpg" width="33" height="33"></div>

<div id="blog">Blog stuff here</div>

</div>

thanks for any advice...v

Reply With Quote
  #2  
Old December 29th, 2003, 09:16 AM
OCB OCB is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: Lyon, France
Posts: 49 OCB User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
My first post.. yeaaayyy

1. Certain browsers require that the body tag has text-align:center set within the stylesheet before centering any child content assigned a margin:auto

2. Floated divs don't need to have an explicit position:relative set within the stylesheet so these rules can be removed (if nothing else, it cuts a few bytes from the css filesize!)

Hope that fixes the problem..

Cha'mone,
OCB

Reply With Quote
  #3  
Old December 29th, 2003, 10:58 AM
dotcommakers's Avatar
dotcommakers dotcommakers is offline
Freelance Webdesigner
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 38 dotcommakers User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 33 m 29 sec
Reputation Power: 5
well i think it's better

well i think it's better if you use tables for ur design.

Reply With Quote
  #4  
Old December 29th, 2003, 12:13 PM
stinkoman's Avatar
stinkoman stinkoman is offline
what's your moniker?
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Highland Park, NJ
Posts: 201 stinkoman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via AIM to stinkoman
Re: well i think it's better

Quote:
Originally posted by dotcommakers
well i think it's better if you use tables for ur design.


Bah!! Tables are evil
__________________
new jersey web design

Reply With Quote
  #5  
Old December 29th, 2003, 02:12 PM
crymson crymson is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 7 crymson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Well I can only speak from my experience but it's not too easy to use div's in this fashion to make a page that will display well in any browser - it can be done, but like dotcommakers tables are just better for layout control, simply cos they are designed to create a structure where cells (i.e td) are grouped and follow a set of rules for width/height. Div's don't do this by default, so you're just making more work for yourself for no reason.

Reply With Quote
  #6  
Old December 29th, 2003, 02:17 PM
stinkoman's Avatar
stinkoman stinkoman is offline
what's your moniker?
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Highland Park, NJ
Posts: 201 stinkoman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via AIM to stinkoman
actually, tables aren't designed to make layouts. the height attribute isn't even supported: run a table site in validator.w3.org

css isn't any more difficult, it's just a different skill to learn. csszengarden.com has some great examples of layouts that can be done with stylesheets

Reply With Quote
  #7  
Old December 29th, 2003, 02:20 PM
crymson crymson is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 7 crymson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Erm, try www.crymsonspyder.com/newcs in validator.w3.org (though don't go finding any errors on the pages, cos it's not 100% tested yet lol).

Height isn't supported in HTML, but that's cos you're supposed to do all the size/colour etc. stuff with css for all objects, divs, tables everything.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > CSS layout problem...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway