0

I'm in scenario where I can add inline CSS to only one div.

For example:

<div class="main" style="my inline CSS">
  <div class="second">
    <div class="third">
       <div class="column></div>
       <div class="column></div>
       <div class="column></div>
    </div>
  </div>
</div>

I want to apply grid-template-columns: 1fr 2fr 1fr; (note: this can change) to the div third - the div nesting the column divs. As I mentioned I can add inline CSS only to div main.

Using the CSS grid system, is it possible to target the child div?

Note: In this scenario there is no access to the stylesheet - only inline style in the main div.

kukkuz
  • 41,512
  • 6
  • 59
  • 95
CyberJ
  • 1,018
  • 1
  • 11
  • 24

1 Answers1

1

With CSS? Nope.

The style attribute's only scope is one specificity lower than !important for that element. It only accepts attributes, not selectors.

jaasum
  • 548
  • 2
  • 11