How to redirect using CSS

Is there a way to make a web page where you can only change the CSS display on a completely different page when viewed by the user?

+5
source share
7 answers

Does csszengarden.com do what you think?

+2
source

Cascading style sheets only affect the page style. As far as I understand, they do not provide any functions for changing the behavior or layout of the page.

, CSS. . http://csszengarden.com/ , , CSS.

+2

, , , -

+1

: , ? (Live Demo)


: - , . , , <body> . , .
<style type="text/css">
    body div { display: none; }
    body.blue div.blue { display: block; }
    body.red div.red { display: block; }
</style>

<body class="blue">
    <div class="blue">Blue content!</div>
    <div class="red">Red content!</div>
    <div class="blue red">Content for both!</div>
</body>

a >

+1

, . , , , . , CSS , .

CSS /, , - - /.

- Django (www.djangoproject.com), , . ( Django):

{% if request.user.is_staff %} DISPLAY COOL DIV HERE {% else %} NOTHING TO SEE HERE {% endif %}

CSS. CSS .

+1

CSS.

, JavaScript CSS , . , .

<style>
#colorCode1{
    color:blue;
}
<style>

<script language=javascript type="text/javascript">
    function setVisible( setting ){
       var myElement = document.getElementById("colorCode1");
       if(myElement.style.color=="blue"){
            myElement.innerHTML = getPageContentForBlueCode();
       }
       if(myElement.style.color=="red"){
            myElement.innerHTML = getPageContentForRedCode();
       }
     }
</script>

- <div id="colorCode1">. JavaScript , CSS. , ,

+1

css, . ( "" ) , , , ( ). content css.

. .

, content, javascript, , , , iframe.

+1

All Articles