Bekijk de onderstaande video om te zien hoe je onze site als een web app op je startscherm installeert.
Opmerking: Deze functie is mogelijk niet beschikbaar in sommige browsers.
neeBedoel je iets alsCode:<link rel="stylesheet" type="text/css" href="url.css >
Dit lijkt mij knap lastig aangezien de css bestanden op de server staan en JavaScript client side draait.
Het is wel mogelijk om css properties van elementen welke in de reeds getoonde pagina zitten te wijzigen mbv JavaScript.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>php style switcher</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<?php
if($_GET[css] == '2'){
echo'
<style>
#switcher{width:100%; height:100%; background: #000fff;}
</style>
';
}else{
echo'
<style>
#switcher{width:100%; height:100%; background: #fff000;}
</style>
';
}
?>
</head>
<body>
<div id = "switcher">
<p>
Dit is testtext <br />
<a href = "?css=1"> Css 1</a><br />
<a href = "?css=2"> Css 2</a>
</p>
</div>
</body>
</html>
<link rel="stylesheet" type="text/css" href="url.css >
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>php style switcher</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<script>
function changeBackground(color) {
document.body.style.background = color;
}
</script>
</head>
<body>
<div id = "switcher">
<p>
Selecteer uw achtergrondkleur: <br />
<ul>
<li><a href = "javascript:changeBackground('red');">Rood</a><br /></li>
<li><a href = "javascript:changeBackground('yellow');">Geel</a><br /></li>
<li><a href = "javascript:changeBackground('green');">Groen</a><br /></li>
</ul>
</p>
</div>
</body>
</html>
okee kan iemand me trouwens een PM sturen om mij op afstand te helpen graag want ik kom er niet uit...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>php style switcher</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<?php
if($_GET[css] == '2'){
echo'
<link rel="stylesheet" type="text/css" href="1.css >
';
}else{
echo'
<link rel="stylesheet" type="text/css" href="2.css >
';
}
?>
</head>
<body>
<div id = "switcher">
<p>
Dit is testtext <br />
<a href = "?css=1"> Css 1</a><br />
<a href = "?css=2"> Css 2</a>
</p>
</div>
</body>
</html>
We gebruiken essentiële cookies om deze site te laten werken, en optionele cookies om de ervaring te verbeteren.