how do you inline div/block elements properly?

This is a discussion on "how do you inline div/block elements properly?" within the Web Page Design section. This forum, and the thread "how do you inline div/block elements properly? are both part of the Design Your Website category.


 Subscribe in a reader

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

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Mar 1st, 2007, 22:58
New Member
Join Date: Mar 2007
Location: uk
Age: 99
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
how do you inline div/block elements properly?

Hello, I've included a screenshot of my problem..

I've been trying set inline a number of div element blocks, so they line up horizontally. Whats the best method/solution to this?

I've tried clear:both, display:inline, display:inline-block - to no success..

As you can see I'm trying to line up the green boxes horizontally:


Heres my code: (Green boxes are the last two divs)

div#welcome-box{
position:relative;
display:block;
background-color:#A0A0A4;
border-width:medium;
border-style:solid;
border-color:#FF0000;
width:70%;
height:120px;
}
div.welcome-box-msg{
display:block;
width:100%;
height:20px;
background-color:#FFFFFF;
}

div#welcome-box-my-stats{
float:left;
height:100px;
background-color:#A0A0A4;
border-width:medium;
border-style:solid;
border-color:#00FF00;
width:50%;
clear:both;
}

div#welcome-box-my-inbox{
position:relative;
float:right;
right:0px;
left:auto;
top:0px;
height:100px;
bottom: auto;
background-color:#A0A0A4;
border-width:medium;
border-style:solid;
border-color:#00FF00;
width:50%;
clear:both;
}


thx in advance
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Mar 1st, 2007, 23:30
New Member
Join Date: Mar 2007
Location: uk
Age: 99
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how do you inline div/block elements properly?

ok the problem was that 50% + 50% did not equal to the 100% width content??? dont ask me why...

so i changed one to 49.9% instead and it fit.. strange
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Mar 2nd, 2007, 02:03
Elite Veteran
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how do you inline div/block elements properly?

It's because of the border
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
div, elements, inline, properly

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
Inline elements and padding Kropotkin Web Page Design 2 Sep 6th, 2007 09:12
Overriding display:inline-block gazzou Web Page Design 0 Aug 27th, 2007 12:03
Inline div Echilon Web Page Design 0 Feb 3rd, 2006 16:06
display inline ???? hessodreamy Web Page Design 3 Oct 8th, 2005 05:51
XHTML Block Element in an Inline Element gohankid77 Web Page Design 6 Jul 27th, 2004 10:15


All times are GMT. The time now is 20:31.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization 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