Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Liquid With of a DIV?
Old 07-13-2007, 11:48 AM Liquid With of a DIV?
Ultra Talker

Posts: 316
Trades: 0
I have 4 divs on a page that I would like horizontally next to each other.

If their combined width is more than the width of the browser window I would like them to stay next to each other horizontally and the browser become scrollable.

I can do this by putting a wrapper div around them and setting its width to 2200px for example but this isnt ideal.

Can I make them always stay on the horizonal plane without wrapping?

Should I have a wrapper with a liquid width that changes to the size of its contents, if so how?

Thanks.

Code:
<html>
<head>
<title></title>
<style type="text/css">
body {
    font-family: Tahoma, Arial, sans-serif;
    font-size: 11px;
    color: #000000;
    background-color: #ffffff;
    }    

div.wrapper {
    width: 2300px;
}
p {
    margin: 0px;
    padding-left: 5px;
    }


div.img {
      margin: 4px;
     border: 0px solid #bbb;
      height: auto;
      width: auto;
      float: left;
    }
div.img img {
      display: inline;
      margin: 3px;
      border: 1px solid #bbb;
    }
    
div.desc {
      text-align: center;
      font-weight: normal;
      margin: 2px;
    }

div.exp {
    float: left;
      text-align: left;
      font-weight: normal;
      width: 200px;
    height: 620px;
      margin: 2px;
    background-color: #bbb;
    border: 1px solid black;
    }

</style>
</head>
<body>
<div class="wrapper">
<div class="exp">
<strong><p>The Van.dalism Series</strong><br/><br />
All the margin properties in one declaration
This example demonstrates how to set a shorthand 

property for setting all of the margin properties in 

one declaration.</p>
</div>


<div class="img">
<img src="bomb.jpg" alt="VeeDoubleYou" width="339" 

height="620" />
<div class="desc"><strong>VeeDoubleYou</strong></div>
</div>


<div class="img">
<img src="bomb.jpg" alt="Number38" width="339" 
height="620" />
<div class="desc"><strong>VeeDoubleYou</strong></div>
</div>


<div class="img">
<img src="bomb.jpg" alt="NeeNaw" width="339" 

height="620" />
<div class="desc"><strong>VeeDoubleYou</strong></div>
</div>

</div>

</body>
</html>
Joe3000 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-13-2007, 12:50 PM Re: Liquid With of a DIV?
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
You would need to make the whole thing liquid by using percentages for widths rather than fixed widths.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Liquid With of a DIV?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.12079 seconds with 12 queries