|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
replacing html code
How could I make <div class="code"> replace HTML code to it's text equivalent? Like, < to <? Is there any CSS way to do it? And if not, how could I possibly go about doing it?
__________________
~ Kaen |
|
#2
|
||||
|
||||
|
Not really sure what you mean but if you type < ; in the source it represents the < character if someone was to view the website they would see the special character and not the character code, subsequently > ; in the source represents the > character.
However, if you want a replacment script you can use PHP's highlight_string function quite easily to echo a piece of code to the browser window, that is, assuming you have access to php...
__________________
The Standards! CSS 2 - CSS 3 - w3c CSS Validator - XHTML 1.1 - HTML 4.01 - w3c (X)HTML Validator - ActionScript Reference Links! Bert's Door and Lock Service | Brandon Erik Bertelsen | TextPattern Last edited by 1beb : June 8th, 2004 at 02:26 AM. |
|
#3
|
||||
|
||||
|
But to answer your original question, CSS controls formatting only, you can't use it like a scripting language.
|
|
#4
|
|||
|
|||
|
Is there any way to trigger php from simply typing <div class=code> ? Because the website that does it, I checked their stylesheet and it didn't have anything special on it. So I'm wondering how they managed to trigger php from people typing the css code.
|
|
#5
|
||||
|
||||
|
Well, you wouldn't see the scripting becuase that's dealt with by the server and displayed as html to the end user.
PHP = Hypertext Preprocessor. Meaning that the script is processed and served as html. If you are looking for a style changing script I'm certain you would be able to find one using any of the scripting languages that you have access to via google. |
|
#6
|
||||
|
||||
|
Here is an example of a highlighting script in php
http://ca3.php.net/manual/en/functi...ight-string.php |
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > replacing html code |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|