Good sites for CSS positioning?

This is a discussion on "Good sites for CSS positioning?" within the Web Page Design section. This forum, and the thread "Good sites for CSS positioning? are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Apr 21st, 2007, 02:35
Junior Member
Join Date: Nov 2006
Location: Chicago
Age: 33
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Good sites for CSS positioning?

I think I'll be getting a migraine soon, trying to find a site that really lays down the nitty gritty on CSS positioning.

What I understand:

Every element is a block.

In straight HTML, everything is an inline element or a block element.

Block elements can be understood as having a line break before and after them.

Inline elements do not and will line up side-by-side.

You can alter the inline/block status with the CSS "display" property.

Attempting to apply these principles to CSS makes no bloody sense to me whatsoever.

Let's say I want to make a 3x3 fixed length/width grid of divs within a larger parent div. How do I do this without nailing them down with absoute positioning. What if I want them to stay that way if the parent div expands or if I want to use JS to automatically add columns and rows without assigning every absolute coordinate so the parent div can be moved around without confusion?

Here's another one: How the crap do I get a block to center vertically within a div without setting the display to table which apparently IE has been oblivious of for years now.

Last edited by Pherdnut; Apr 21st, 2007 at 03:05.
Reply With Quote

  #2 (permalink)  
Old Apr 21st, 2007, 04:36
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Good sites for CSS positioning?

For centering, add margin: 0 auto; to the element. You might take a look into floats. I'm not too clear on what you want exactly with the lining up of elements, but these may clear up the subject.

http://css.maxdesign.com.au/floatutorial/
Reply With Quote
  #3 (permalink)  
Old Apr 21st, 2007, 19:53
Junior Member
Join Date: Nov 2006
Location: Chicago
Age: 33
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Good sites for CSS positioning?

Does that center vertically? (up-down)

I guess I was also wondering if there is a way to position elements absolutely using the parent element's coordinates.
Reply With Quote
  #4 (permalink)  
Old Apr 21st, 2007, 20:18
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Good sites for CSS positioning?

Ah, the only way to center something vertically is with positioning. Even margins are odd when it comes to height. A margin of 50% will assume a 50% of the width of the page even though it may be applied to top or bottom margin. Very odd.

Anyway, to get something absolutely positioned inside a div, add position: relative; to the outer div.

Code: Select all
<div class="outer">
  <div class="inner">
    <p>content</p>
  </div>
</div>

<style type="text/css">
  .outer {
    position: relative;
    width: 500px;
    height: 300px;
    background: #333;
  }
  .inner {
    position: absolute;
    left: 100px;
    top: 100px;
    width: 300px;
    height: 100px;
    background: #aaa;
  }
</style>
Reply With Quote
Reply

Tags
div grid positioning

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Selling links on good PR3 and PR 4 sites meet2kunal Link Building and Link Sales 0 Apr 21st, 2008 07:20
Good sites about health for exchanging link jessica Link Building and Link Sales 3 Mar 20th, 2008 14:41
Any good sites to list personal website? Spyros Link Building and Link Sales 6 Nov 16th, 2007 19:53
any good php sites? welshstew Starting Out 5 May 21st, 2007 07:45
link exchange with good web sites. ranosoftseo Link Building and Link Sales 2 Aug 19th, 2006 12:47


All times are GMT. The time now is 16:21.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43