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.

css ändern

Empfohlene Antworten

hi,

gibt es ne möglichkeit den css import über ein javascript zu ändern,

also so das man per mausklick auf nen link das aussehn der page verändern kann?

mfg

trc

du könntest dem <link> tag eine id geben... zb:

<link id="stylesheet" rel="stylesheet" href="stylesheet.css" type="text/css">

und dann per javascript so draufzugreifen:


document.getElementById("stylesheet").href ="neues-stylesheet.css";

lg,

Matthias

ja also ohne javascript wirst dus ohne neu laden der seite nicht hinbekommen!

falls du keine javascripts verwenden willst kannst dus auch mit einer anderen script sprache machen!

z.b. PHP


if (!isset($_GET["css"])) $_GET["css"] = "";

if ( $_GET["css"] == 1) {
// 1. CSS
$css_src = "1.css";
} else if ($_GET["css"] == 2)
// 2. CSS
$css_src = "2.css";
} else {
// hier ist dann std. CSS
$css_src = "main.css";
}

echo "<link rel='stylesheet' href=' ". $css_src ." ' type='text/css'>";

.
.
.
.



// dann auf deiner hp
echo "<a href='./test.php?css=1'>anderer Style gefällig?</a>";
echo "<a href='./test.php?css=2'>ich hab noch mehr zu bieten </a>";
echo "<a href='./test.php'>oder doch wieder std. style?</a>";



[/PHP]

  • 2 Wochen später...

Das geht auch schöner:



$styles=array('stylea','style1','anderes');
if (!isset($styles[$_GET['css']])) $_GET['css']=0;
echo "<link rel='stylesheet' href='$styles[$_GET['css']].css' type='text/css'>";



Aufruf sonst wie im vorigen...
[/PHP]

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Konto

Navigation

Suchen

Suchen

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.