Jump to content
Sign in to follow this  
Uridium

CSS cheating

Recommended Posts

this is for those who have many styles of style sheets in their game...

Themes are always nice to have but if the CSS was large in style.css and you wanted to make more then usually youd need to add more CSS files with nearly the same data as style.css so heres a way to cheat..

always have style.css as your main stylesheet.. and to add more simple do this create a new css and add

 

@import "style.css" ;

body {
background: #d6d8cb url(images/Halloween3.jpg) repeat top center fixed; 




}
A:link {text-decoration: none; color: #000000; font-size: 28;}
A:visited {text-decoration: none; color: #000000; font-size: 28;}
A:active {text-decoration: none; color: #000000; font-size: 28;}
A:hover {text-decoration: underline; color: #bdebde; font-size: 28;}

 

The @import will auto select style.css as its main source but you can now add new elements to the newly created css whilst still keepig data from the style.css

Share this post


Link to post
Share on other sites

Just some tips

* will effect all elements.

[css]

* {

color: #000;

}

[/css]

_ /9 *

Will effect IE only

[css]

.blah {

color: #000; /*All*/

color: #FFF\9; /*IE8 < */

*color: #999; /* IE7 < */

_color: #CCC; /* IE6 */

[/css]

Conditional statements is probably better but hey at least you know.

http://net.tutsplus.com/tutorials/html-css-techniques/quick-tip-how-to-target-ie6-ie7-and-ie8-uniquely-with-4-characters/ - IE Selectors

http://net.tutsplus.com/tutorials/html-css-techniques/the-30-css-selectors-you-must-memorize/ - 30 CSS selectors you must memorize.

Share this post


Link to post
Share on other sites

This isn't much of "cheating", it's just using a different method to link more as one css stylesheet.

As second remark, you're doing it wrong :o

always have style.css as your main stylesheet..

you need to link your newly created css stylesheet, because else, you'll always end up with only the css of the style.css file. The css import will import the css of the file into the other css section. Saying that the import will take the specified file as main source isn't right either, it just imports the css of that file into the requesting file.

as 3rd note, the last 4 lines could be done in less letters, which results in again smaller files.

A {text-decoration: none; color: #000; font-size: 28;}
A:hover {text-decoration: underline; color: #bdebde;}

I'm not saying you have to do it like that, but that will result in a shorter file again, and that seems to be your main concern with this topic.

Oh v4 browsers will not care about the import and just ingore it, but that doesn't matter anymore since we're long pas that era.

Share this post


Link to post
Share on other sites

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.

Sign in to follow this  

×
×
  • Create New...