View Single Post
Old 08-22-2019, 07:08 PM   #7
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,830
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by lumpynose View Post
Is there a way to have conditional html? For example, in my css I have the following; is there anything equivalent for html?

PHP Code:
@media amzn-mobi {
...

No. But you can do a bit of cheat You can employ something like:

Code:
@media amzn-mobi {
   .kf7 {
        display: normal;
   }

   .kf8 {
       display: none;
   }
}

@media not amzn-mobi {
   .kf7 {
        display: none;
   }

   .kf8 {
       display: normal;
   }
}
And to employ html code like the following:

Code:
<div class="kf7">
  <blockquote class="MyTable">
    <table class="YourTable" border="1">
      <thead>
        <tr>
          <th>First column</th>

          <th>Second Column</th>
        </tr>
      </thead>

      <tbody>
        <tr>
          <td>Some text here</td>

          <td>And more text here too</td>
        </tr>

        <tr>
          <td>This for ending</td>

          <td>And this too</td>
        </tr>
      </tbody>
    </table>
  </blockquote>
</div>

<div class="kf8">
  <table>
    <thead>
      <tr>
        <th>First column</th>

        <th>Second Column</th>
      </tr>
    </thead>

    <tbody>
      <tr>
        <td>Some text here</td>

        <td>And more text here too</td>
      </tr>

      <tr>
        <td>This for ending</td>

        <td>And this too</td>
      </tr>
    </tbody>
  </table>
</div>
Of that way, you duplicate the html code but the kf8 class won't be displayed on mobi7 and the kf7 class won't be displayed on kf8/KFX.
RbnJrg is offline   Reply With Quote