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.

Javascript Ausgabe mit CSS designen

Empfohlene Antworten

Veröffentlicht

Moin,

ich habe ein kleines JS was einen Countdown darstellt. Wie kann ich diese Ausgabe nun mit einer CSS designen? Einfach ein DIV drum, das funktioniert leider nicht. Geht das überhaupt? Bzw. welche Möglichkeit habe ich sonst das Layout zu steuern?

Grüße

Definier das JS doch einfach im html header bzw. gib dort die Source an und lass die funktion dort wo du es brauchst aufrufen. Auf SelfHtml gibt ganz gute Erklärungen dazu.

Gruß,

DerAzubi

Was soll denn daran nicht funktionieren, ein DIV drum zu schreiben? Ich weiß nicht, worauf du hinaus willst. Du lässt in deinem JS z. B. folgendes ausgeben:


<span id="countdown">Test</span>

und formatierst das dann im CSS über:

span#countdown

{

font-family: Verdana, Arial;

font-size: 12px;

}

und dann wird das auch dementsprechend dargestellt.

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

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.