2 replies [Last post]
ollieo
ollieo's picture
Offline
newbie
Sydney
Last seen: 8 years 51 weeks ago
Sydney
Timezone: GMT+10
Joined: 2012-06-19
Posts: 2
Points: 3

Hi Everybody,

I have been trying to figure this out for a couple of hours and need some advise.

All I want is for the "article_section" to auto adjust its width when the "side_bar" is not displayed. Please check my code below.

I am sure their is a very simple explanation however I am lost.

Thans very much

Ollie

ollieo
ollieo's picture
Offline
newbie
Sydney
Last seen: 8 years 51 weeks ago
Sydney
Timezone: GMT+10
Joined: 2012-06-19
Posts: 2
Points: 3

<div id="main-content"

<div id="main-content" style="width: 980px; margin: 0 auto;">
 
    <div class="side-bar" style="width: 200px; margin-left: 20px;">
    </div>
 
    <div class="article-section">
    </div>
 
 
</div>

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 1 week 5 days ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5343
Points: 2964

Not sure what other style you

Not sure what other style you have applied.
You could try the :only-child selector.

#main-content:only-child{ 
  width:auto;
}