Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

Hallo!

Ich gestalte ein Tabelle z.B. 2x 3 Felder

<style type="text/css"><!--

#tabProg{

border-collapse: separate;}

#tabProg td.tdA10{

width: 55;

height: 20;

text-align: center;

font-size: 14;

font-weight: normal;}

#tabProg td.tdA11{

width: 55;

height: 20;

text-align: center;

font-size: 12;

font-weight: bold;}

#tabProg tr.trA td{

background-color: #cccccc;

border-spacing: 1;

padding: 2px 5px 2px 5px;}

#tabProg tr.trB td{

background-color: #999999;

border-spacing: 1;

padding: 2px 5px 2px 5px;}

</style>

somit kann ich dann immer abwechselnd oder nach wunsch meine Tabelle wechselweise hell- oder dunkel-grau machen. Immer Zeilenweise.

<table id="tabProg" align="center">

<tr class="trA">

<td class="tdA10">zA</td>

<td class="tdA11">zB</td>

<td class="tdA11">zB</td>

</tr>

<tr class="trA">

<td class="tdA10">zA</td>

<td class="tdA11">zB</td>

<td class="tdA11">zB</td>

</tr>

</table>

Nun möchte ich ein einzelnes Feld die Hintergrundfarbe anders machen.

Geht das über Class irgendwie?

Also ich könnte natürlich in der Class für td die Backgroundfarben immer angeben, jedoch müßte ich dann ja für jede geänderte Zelle dann immer welche mit allen Hintergrundfarben angeben.

So muß ich es nur für die Zeile. Jedoch scheint sich der Wert der Backgroundfarbe nicht überschreiben zu lassen.....

Oder wie muß ich das hier anstellen?

Lieben Dank!;)

Ulli.

Du kannst das z.B. so angeben:


...

<td class="tdA11" style="background-color: #ff0000;">zB</td>

...

oder auch so:

...

#tabProg tr.trB > #NewCol { background-color: transparent; }  

...

<td class="tdA11" id="newCol">zB</td> 

...

Wobei eine id immer nur einmal vorkommen darf im Dokument.

Mehr hab ich nicht probiert, aber es kommt immer darauf an, welche Angabe spezifischer ist. Die spezifischste wird dann genommen.

Siehe dazu:

CSS 4 You - The Finest in Stylesheets: Workshop CSS: Teil 6 - Kaskaden

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.