/    Sign up×
Community /Pin to ProfileBookmark

Dynamic Div Width

Hi all, I have 5 div’s within a container div and i want them all to be the same size, so i have specified that they are 20% width each. This is perfect. But 1 or 2 of these div elements could be set to invisible by my aspx code, so how can i get the div elements to automatically resize there width if 1 or 2 of the divs are not visible???

Here is my code at the moment

<div class=’container’>
<div class=’item’><img src=’path’ /></div>
<div class=’item’><img src=’path’ /></div>
<div class=’item’><img src=’path’ /></div>
<div class=’item’><img src=’path’ /></div>
<div class=’item’><img src=’path’ /></div>
</div>

css code is

.container { float:left;width:100%}
.item { float:left;width:20% }

Thanks in advance!

to post a comment
HTML

0Be the first to comment 😎

×

Success!

Help @NemisisJedi 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...