| | |||||
| ||||||||
| Web Design Discussion Discussion of web design techniques, advice, browser issues, software, design firms. |
![]() | NamePros Design Contests | Forum Sponsorship |
| Join in on the FUN! You can start an affordable design contest and pick from entries talented members submit or you can enter a design contest for a chance to win CASH PRIZES! What are you waiting for? Get started in the fun TODAY! - Banners, Logos, Mascots, and MORE! (Please READ the design Contest section rules Prior to starting or entering a contest) | ||
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Senior Member Join Date: Dec 2004 Location: UK
Posts: 1,893
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Tabless Design Im trying to get into tableless desgin (by using css) How can i make 2 css align next to each other instead of going down one line? Heres the code i have: <div class="contentboxleft"><div class="contentright">a</div></div> <div class="contentboxright"><div class="contentleft">a</div></div> ????: NamePros.com http://www.namepros.com/web-design-discussion/208766-tabless-design.html It currently displays as: - - But i want it to display like: - - Any one know? Thanks, Darren Ive done this now using the float element. Blonde moment ![]() Thanks, Darren |
| |
| | #3 (permalink) |
| Account Closed Join Date: May 2005 Location: Whitewater, WI
Posts: 3,710
![]() ![]() ![]() ![]() ![]() ![]() ![]() | Code: css file
#container
{
width:300px;
}
#contentboxleft
{
float:left;
width:150px;
}
#contextboxright
{
float:right;
width:150px;
} Code: html file
<div id="container">
<div id="contentboxleft">
woot, left
</div>
<div id="contentboxright">
woot, right
</div>
</div> |
| |
| | #4 (permalink) |
| NamePros Member Join Date: Mar 2006 Location: (US) Missouri
Posts: 70
![]() | float is not always the best rout to go, there are allot of problems you might run into later on in your project (but then again you might not, it all depends on what you are trying to achieve in the end). Here is another option you might find useful, if not for this particular task I know it will help you later. keep the html code you already have and create a new css rule as follows: div { display: inline; } and remove the 'float' from the rest of your css rules. * when working with floats and inline displays you will find this handy too: clear: both; clear: left; clear: right; however, you will need to learn why and where that rule will go yourself (if I told you you wouldn't learn any thing). |
| |
| | #7 (permalink) |
| Account Closed Join Date: May 2005 Location: Whitewater, WI
Posts: 3,710
![]() ![]() ![]() ![]() ![]() ![]() ![]() | Inline can work but is confusing. I've never had a problem with the floats and I use them all the time. Just make sure that the two fill the container in width. If it is even 1px too big it will return. |
| |