0

I'm trying to override the width associated with 'container' in a css file only when 'myclass' is organized as below. I'm looking to make the container width 95% when when myclass is present.

<div class="main-section container">
  <div class="content-section">
    <div>
      <div class="myclass otherclass">
      </div>
    </div>
  <div>
</div>

.container {
  margin-right: auto;
  margin-left: auto;
  padding-left: 15px;
  padding-right: 15px;
}
@media (min-width: 768px) {
  .container {
    width: 750px;
  }
}
@media (min-width: 992px) {
  .container {
    width: 970px;
  }
}
@media (min-width: 1200px) {
  .container {
    width: 1170px;
  }
}
rtaft
  • 1,449
  • 12
  • 27
  • 1
    Look here: http://stackoverflow.com/questions/45004/complex-css-selector-for-parent-of-active-child – VikingBlooded Apr 18 '16 at 19:41
  • According to this [answer](http://stackoverflow.com/questions/1014861/is-there-a-css-parent-selector/1014958#answer-1014958), the CSS Selectors 4 Working Draft contains a parent selector but as of 2015, it's not implemented in any browser. – War10ck Apr 18 '16 at 19:53

0 Answers0