random text with html+css only (without PHP, javascript, java or any other language)

Posted on 2008-11-07
Medium Priority
Last Modified: 2012-05-05
it is possible just with HTML + CSS to make such thing?
Lets say i give text "aaa", "bbb", "ccc".
And it should one time write "aaa", another time "ccc', and so on random. :)
This should be done with CSS + HTML only.
Is that possible? :)
Question by:fikitifikitifak

Accepted Solution

ccpjc earned 1000 total points
ID: 22905495
No it isn't
LVL 82

Assisted Solution

hielo earned 1000 total points
ID: 22905545
>>This should be done with CSS + HTML only. Is that possible? :)
No. Neither of them are able "manipulate" elements. You need to use scripting for that.

Author Comment

ID: 22905547
hm, will wait for more answers, maybe someone knows :D
and if not possible, maybe with css3 will be possible?
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 82

Expert Comment

ID: 22905587
>>hm, will wait for more answers,
In the mean time, I suggest you rething your strategy :)
LVL 82

Expert Comment

ID: 22905594
I meant:
.. rethink ...
LVL 30

Expert Comment

by:Mark Steggles
ID: 22907229
Not possible

Expert Comment

ID: 22907361
not possible without scripting i think you should use javascript
LVL 43

Expert Comment

by:David S.
ID: 22907649
You would have to use JavaScript or a server-side language, e.g. PHP, to do that.

Expert Comment

ID: 34010201
Why "just" HTML and CSS?  With only a little Javascript you can do it, and I can't imagine a situation where Javascripting is not possible while CSS3 is.  Modern browsers are capable of JS, and yes, theoretically someone might switch it off but no, practically no one will.

So, are you SURE you need a solution without even Javascript?
HTML and CSS3 are not for that.  If you could get just one random number somehow, you could position a very long random string with CSS to only show a (random) part of it, which would look like "wow, it's another text every time" - but obviously it's not. If you can find a calculated value in CSS3 that represents milliseconds (I'm not aware of anything like that) then maybe, MAYBE, after p*ssing some blood, you could achieve the desired effect.  Worth it? :) Probably not.

So how'bout a good <script> ... </script> tag in body, which makes it a breeze to do it?

Expert Comment

ID: 35941018
I think the original poster maybe does not realize that javascript code can be placed inside html, so that he can get his desired result easily.

Here's some code, try pasting it into your html.

<script language="JavaScript">
var r_text = new Array ();
r_text[0] = "All the leaves are brown";
r_text[1] = "And the sky is grey";
r_text[2] = "I've been for a walk";
r_text[3] = "On a winter's day";
r_text[4] = "I'd be safe and warm";
r_text[5] = "If I was in L.A.";
r_text[6] = "California dreaming, On such a winter's day";
var i = Math.floor(7*Math.random())



Open in new window

However, if you are trying to do something fancy on a site like facebook.com which disables javascript, then you can forget it.
The javascript is disabled so that people can't hack your account... its a good thing.
Forget about random text with just html and css, it can't be done.
LVL 70

Expert Comment

by:Jason C. Levine
ID: 37343930
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question