Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
Aber natürlich. Hier ist eine Seite zu dem Thema: <input type="color">Kann ich ihn in CSS irgenwie ansprechen und dann verschönern?
p,
label {
font: 1rem 'Fira Sans', sans-serif;
}
input {
margin: .4rem;
}
/* ^- war schon */
/* Neu von mir: */
input[type=color] {
border: 2px solid red;
}
<!DOCTYPE html>
<html>
<head>
<script>
function aendereFarbe(c1,c2) {
var cv1 = document.getElementById(c1).value;
var cv2 = document.getElementById(c2).value;
document.querySelectorAll("h2").forEach(function(h2) {
h2.style.color = cv1;
});
}
</script>
</head>
<body>
<h2>Überschriften</h2>
<h2>test</h2>
Wähle Farbe Button : <input type="color" name="color1" id="color1"><br /><br />
Wähle Farbe Text : <input type="color" name="color2" id="color2"><br /><br />
<input type="button" onClick="aendereFarbe('color1','color2')"/>
</body>
</html>
<script>
function aendereFarbe(c1,c2) {
var cv1 = document.getElementById(c1).value;
var cv2 = document.getElementById(c2).value;
document.getElementsByTagName("h2")[0].style.color = cv2;
document.getElementsByTagName("input")[2].style.color = cv1;
};
</script>
<h2>Überschriften</h2>
<h2>test</h2>
Wähle Farbe Button : <input type="color" name="color1" id="color1"><br /><br />
Wähle Farbe Text : <input type="color" name="color2" id="color2"><br /><br />
<input type="button" id="einfarben" value="texte einfärben"/>
<script>
but=document.getElementById('einfarben');
but.addEventListener('click',function(){
but.style.color=document.getElementById('color1').value;
col=document.getElementById('color2').value;
document.getElementsByTagName("h2")[0].style.color=col;
});
</script>
<!DOCTYPE html>
<html>
<head>
<script>
but=document.getElementById('einfarben');
but.addEventListener('click',function(){
but.style.color=document.getElementById('color1').value;
col=document.getElementById('color2').value;
document.getElementsByTagName("h2")[0].style.color=col;
});
</script>
</head>
<body>
<h2>Überschriften</h2>
<h2>test</h2>
Wähle Farbe Button : <input type="color" name="color1" id="color1"><br /><br />
Wähle Farbe Text : <input type="color" name="color2" id="color2"><br /><br />
<input type="button" id="einfarben" value="texte einfärben"/>
</body>
</html>
<!DOCTYPE html>
<html>
<head></head>
<body>
<h2>Überschriften</h2>
<h2>test</h2>
<p>Beispiel: Vorschau </p>
<p>Das ist der Rest Text</p>
Wähle Farbe Überschriften : <input type="color" name="color1" id="color1"><br /><br />
Wähle Farbe Text : <input type="color" name="color2" id="color2"><br /><br />
<input type="button" onClick="aendereFarbe('color1','color2')"/>
<script>
function aendereFarbe(c1,c2) {
var cv1 = document.getElementById(c1).value;
var cv2 = document.getElementById(c2).value;
document.querySelectorAll("h2").forEach(function(h2) {
h2.style.color = cv1;
});
document.querySelectorAll("p").forEach(function(p) {
p.style.color = cv2;
});
}
</script>
</body>
</html>