css div

This is a discussion on "css div" within the Web Page Design section. This forum, and the thread "css div 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 May 15th, 2006, 18:52
New Member
Join Date: Apr 2005
Location: Bristol, PA
Age: 57
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
css div

Hello,

I am new at css, however I am trying very hard to learn. It is a great tool!

My navigation is a div id and my center paragraph is a div id. I would like to place my navigation on the left side of my screen margin-top: 10px;

and place my center paragraph on the right side of the screen margin-top: 10px; However it is not letting me do it.

How do I place both div id's equal height?

Thank you
Faygirl

Last edited by faygirl; May 15th, 2006 at 18:54.
Reply With Quote

  #2 (permalink)  
Old May 15th, 2006, 20:53
Junior Member
Join Date: May 2006
Location: UK
Age: 35
Posts: 24
Thanks: 0
Thanked 1 Time in 1 Post
Re: css div

Unless I'm misunderstanding what you're trying to do, you should just be able to float both <div>s - one to the left, and one to the right.

For the nav div, e.g.:

Code: Select all
#nav {float: left; margin-top: 10px; }
For the paragraph, e.g.:

Code: Select all
#para {float: right; margin-top: 10px
Reply With Quote
  #3 (permalink)  
Old May 15th, 2006, 22:15
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Skype™ to ukgeoff
Re: css div

If you want to keep the width fluid, just float the left navigation. Then give the right-hand div a margin-left slightly larger that the width of the navigation without specifiying a width and it should just move up into whatever space there is.

Assuming nav has width of 150px and has top margin of 10px, then code style for right-hand div would be something like;

div#right {
margin: 10px 0 0 160px;
}

Leaves 10px gap between navigation and right-hand div.

Edited left value of margin, had it at 130 and meant it to be 160.

Last edited by ukgeoff; May 16th, 2006 at 09:39.
Reply With Quote
  #4 (permalink)  
Old May 16th, 2006, 03:41
New Member
Join Date: Apr 2005
Location: Bristol, PA
Age: 57
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Re: css div

Thank you so much. I started to use float, however I thought it was for images with wrap around text.

Faygirl
Reply With Quote
Reply

Tags
css, div

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


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


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