Jump to content
MakeWebGames

[FAQ] CSS Basics


hamster01

Recommended Posts

Frequently Asked Questions

Everyone now and again, you will get a person asking how to do this or that.

No problem, but why don't we make a thread so that there isn't millions of threads for each question.

Here is a list of how to do commonly asked things to a MCCodes game.

What is a style sheet(aka CSS)?

Read about it here.

http://en.wikipedia.org/wiki/Style_shee ... lopment%29

How do I change the background color of my game?

Add the following to your style sheet.

body {
 background: #000;
}

 

How do I change the color of the text?

Add the following to your style sheet.

body {
 color: #000;
}

 

How do I change the color of the links?

Add the following to your style sheet.

a:link {
 color: #000;
}

 

How do I let the color of a link change when the cursor moves over it.

Add the following to your style sheet.

a:hover {
 color: #000;
}

 

How do I change the appearance of buttons and text boxes?

Add the following to your style sheet.

input {
 background: #FFF;
 color: #000;
 border: solid;
 border-width: 1px;
 border-color: #000;
}

 

How do I change the background color or text color of tables?

Add the following to your style sheet.

table {
 background: #FFF;
 color: #000;
}

 

How do I put a border around my game?

Add the following to your style sheet.

body {
 border: solid;
 border-width: 1px;
 border-color: #000;
}

 

How do I put a border around images on my game?

Add the following to your style sheet.

img {
 border: solid;
 border-width: 1px;
 border-color: #000;
}

 

Thats all I can think of right now.

If you would like to know anything else, please make a post and I will add it.

Link to comment
Share on other sites

Re: F.A.Q.

How to change backgrounds and text when in hospital and jail?

<?php
if ($ir['hospital'] >= 1) {
echo '<style type="text"css">
body {
 background: #FFF;
 color: #FF0000;
}</style>'; 
} 
else if ($ir['jail'] >= 1) {
echo '<style type="text"css">
body {
 background: #333;
 color: #FFF;
}</style>'; }
?>

 

2. Javascript.

function add_code(code,id) {
var element = document.getElementById(id);
element.value += code; }
Link to comment
Share on other sites

  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...