/    Sign up×
Community /Pin to ProfileBookmark

newbie question about div

I am very new to web devel so forgive me if this is a really simple question.

I would like to have two div’s side by side left and right. I want the right div to have an auto width and a max-width like 300px. the left div has a min width of 600px. How would I have the left div expand to fill the space of the right div when the right div is less than 300px?

Here is my html & CSS but its not working the right div is showing under the left div.

[CODE]<div id=”wrap”>
<div id=”left”>
</div>
<div id=”right”>
</div>
</div>

div#wrap{
background-color: #FFFFFF;
margin-bottom: 50px;
margin-left: auto;
margin-right: auto;
padding: 5px;
width: 900px;

div#left {
float: left;
height: auto;
margin-left: 15px;
min-width: 600px;
width: auto;
}
div#right {
background-color: #CCCCCC;
float: right;
height: auto;
margin: 0 15px 15px 0;
width: auto;
max-width: 300px;

[/CODE]

to post a comment
HTML

1 Comments(s)

Copy linkTweet thisAlerts:
@MrSnowDropApr 08.2011 — You only have to close braces in CSS section:

[CODE]
div#wrap{
background-color: #FFF;
margin-bottom: 50px; margin-left: auto;
margin-right: auto; padding: 5px; width: 900px;
[COLOR="Red"]}[/COLOR]

div#left {
float: left; height: auto;
margin-left: 15px;
min-width: 600px; width: auto;
[COLOR="red"]}[/COLOR]

div#right {
background-color: #CCC;
float: right; height: auto;
margin: 0 15px 15px 0;
width: auto; max-width: 300px;
[COLOR="red"]}[/COLOR]
[/CODE]
×

Success!

Help @caesar_gdi spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...