Web Design

  • righteous_trespasser
  • Scuffle
  • Genius
  • User avatar
  • Posts: 6230
  • Loc: South-Africa

Post 3+ Months Ago

webdevelopment wrote:
How we css code in other languages?

What do you mean by that? Do you want to use another language in your css file? If so, you can't.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Carl
  • Beginner
  • Beginner
  • User avatar
  • Posts: 50

Post 3+ Months Ago

You can use other languages in a CSS file but only if the resulting code produces an actual CSS file. For example, you can put PHP code in a CSS file to generate dynamic style sheets. But the end result is a CSS file.

For this to work, you will need to add .css to the list of files that PHP will process (e.g., AddType application/x-httpd-php .php .css) in an .htaccess file or store the styles in .php files and include them that way.

index.php
Code: [ Select ]
<html>
<head>
<title>Page title</title>

<?php require_once "styles.css.php";?>

</head>

<body>

Page layout goes here

</body>
</html>
  1. <html>
  2. <head>
  3. <title>Page title</title>
  4. <?php require_once "styles.css.php";?>
  5. </head>
  6. <body>
  7. Page layout goes here
  8. </body>
  9. </html>


styles.css.php
Code: [ Select ]
<style type="text/css">
body {
  color: <?php echo $bodyColor;?>
  background: <?php echo $bodyBGStyle;?>
}

.someStyle {
  font-family: <?php echo $fontFamily;?>
}
</style>
  1. <style type="text/css">
  2. body {
  3.   color: <?php echo $bodyColor;?>
  4.   background: <?php echo $bodyBGStyle;?>
  5. }
  6. .someStyle {
  7.   font-family: <?php echo $fontFamily;?>
  8. }
  9. </style>
  • righteous_trespasser
  • Scuffle
  • Genius
  • User avatar
  • Posts: 6230
  • Loc: South-Africa

Post 3+ Months Ago

Nice Carl, I thought "webdevelopment" meant spoken languge. Nice one.
  • Carl
  • Beginner
  • Beginner
  • User avatar
  • Posts: 50

Post 3+ Months Ago

I don't even know if I answered the question that was asked. ;)

If by "other languages" the OP means spoken languages, then yeah, it can't be done. You're stuck with English. But if they're talking about integrating scripting languages like PHP or JSP, then it can definitely be done in several different ways.
  • Gofigure
  • Novice
  • Novice
  • Gofigure
  • Posts: 17

Post 3+ Months Ago

Yea im not sure i follow either like spanish or chinese? Or do you mean code like .Asp .php ?

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 65 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.