• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Orbital Fan

[web] CSS is pi***ng me off!

9 posts in this topic

Sorry for the rant-ish title. I've just spend the evening fighting with CSS to do what I want it to do. I'm not going to bore you with specifics, but just wanted to get it off my chest, and ask what tools (if any) do you guys/gals use to author CSS.

Coming from a C++ background, HTML and CSS are a bit of a black-art. It's all very "well you want the right-aligned, but on some browsers it might be a bit more to the left".

I spend ages trying to get my HTML page to do what I want in Chrome, gave up, then tried IE and it renders fine!! So WTF is Chrome doing differently?

The "Inspect Element" tool in Chrome is pretty useful, but I'm still struggling A LOT with all this stuff.

HELP!

ps. Any advice on tools or methods to improve my CSS authoring?
0

Share this post


Link to post
Share on other sites
Are you in standards or quirks mode? (Do you have a sane [url=http://www.w3schools.com/tags/tag_doctype.asp]doctype[/url] in your HTML?) In IE, if you bring up the developer tools (F12) does it say Standards or Quirks mode in the toolbar?

Most modern browsers are pretty consistent as long as you are in standards mode. In quirks mode, just about anything goes...
1

Share this post


Link to post
Share on other sites
1. Learn and know common problems with different css implementations. You [i]could[/i] go out and research this up-front, but generally the majority of it will come over time as you run into each individual problem. When you experience a difficulty you should do some searching to see if it's a known issue -- there will usually be known work-arounds as well.

2. Use good editing tools. There generally isn't all that much to a css file visually even when it gets complicated, but you should still be using a well-featured editor you're comfortable with. Features you might want to look for include syntax highlighting, auto-completion, the ability to "collapse" or "fold" sections of the document away, and a good find-and-replace feature.

3. Use good browser tools. The tools in Chrome that you're already aware of are quite good. The FireBug extension for FireFox is another excellent example.
0

Share this post


Link to post
Share on other sites
Thanks for the tips.

I'm using Eclipse which has good auto-completion, etc.

I'll have a look at which mode IE was in when I got home tonight.

Regards.
0

Share this post


Link to post
Share on other sites
If you haven't done so already, try [url="http://validator.w3.org/"]validating[/url] your markup - always start with creating the best markup you possibly can, for example you may have an unclosed div which would screw up the rendering of a page. In most cases IE would be the misbehaving one (if you follow standards and good practice rather than building it for IE) ;)

Chrome tools and Firebug are already mentioned, for "easy CSS" you may try the likes of [url="http://www.skybound.ca/"]Stylizer[/url] - you can download the trial and see if it's good for you.
[i]
[/i][color="#696969"]***[[[And basically, educate yourself for a start - you'll then notice that markup is more than 'copy'n'pasta of some template' - each element has it's purpose, you'll learn about doctypes, microdata, semantics, why it's good for you to have an alt tag even if you're not bothered about accessibility (or why by creating an all-flash website you're hurting yourself). You'd eventually get to know CSS better, the browsers and what to expect out of them, etc etc. Google around, you can check those 2 for some reading: [url="http://htmldog.com/"]htmldog[/url] , [url="http://www.alistapart.com/"]A list apart[/url] . If you get to streamlining your work have a look at [url="http://960.gs/"]960gs[/url] and [url="http://html5boilerplate.com/"]HTML5 boilerplate[/url]. Avoid [url="http://www.w3schools.com/"]w3schools[/url] and [url="http://w3fools.com/"]THIS[/url] is why;)]]][/color][i] [/i]

*** - 99.99999% not relevant as you seem to just want to 'get your site sorted quickly & easily' rather than becoming a top-notch frontend dev.

Hope any of this helps;)
1

Share this post


Link to post
Share on other sites
Basically IE misinterprets the box model, which screws up the site (or w3's misinterpretation, however way you want to look at it). Certain doctypes are supposed to fix it, but I couldn't get it to work. What I did eventually was use a style sheet for IE, and another for everything else.
0

Share this post


Link to post
Share on other sites
I can help out, but you have to let me know what are you trying to accomplish. I can tell you that IE will make it difficult to get things looking right, especially in quirks mode. First thing, add to top of all your documents the following line (before the <html /> tags) : [code]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">[/code]
That will force all IE browsers to render using a strict adherence to the W3 rules, or at least an attempt at strict adherence.

Second, get a really good understanding of the box model and CSS hierarchy, which is probably the most mis-understood part of HTML development. Most people don't realize that you can apply multiple styles to the same HTML element. For example:
[code]<div class="ContentPane FloatingLeft">This is my content</div>[/code]
This HTML applies 2 styles to the DIV, ContentPane and FloatingLeft.

Third, sometimes it helps to force all the HTML elements to a common set of rules so that all styles are set to a common set of features that would be applied in all browsers.

But to really help, some HTML examples would be nice.
0

Share this post


Link to post
Share on other sites
[quote name='Dino' timestamp='1302054799' post='4794853']
I can help out, but you have to let me know what are you trying to accomplish. I can tell you that IE will make it difficult to get things looking right, especially in quirks mode. First thing, add to top of all your documents the following line (before the <html /> tags) : [code]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">[/code]
That will force all IE browsers to render using a strict adherence to the W3 rules, or at least an attempt at strict adherence.

Second, get a really good understanding of the box model and CSS hierarchy, which is probably the most mis-understood part of HTML development. Most people don't realize that you can apply multiple styles to the same HTML element. For example:
[code]<div class="ContentPane FloatingLeft">This is my content</div>[/code]
This HTML applies 2 styles to the DIV, ContentPane and FloatingLeft.

Third, sometimes it helps to force all the HTML elements to a common set of rules so that all styles are set to a common set of features that would be applied in all browsers.

But to really help, some HTML examples would be nice.
[/quote]


Hi, yeah I was going to ask about the DOCTYPE, I do have mine set to:

[code]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">[/code]

as that's what Eclipse automatically put in for me.

I've purchased a book on CSS, which has a whole chapter on the box model. Time to get reading :)

The tip about multiple styles on a DIV is interesting - would never have considered it.

Thanks
0

Share this post


Link to post
Share on other sites
With regards to the Box Model, the AdrianC is partially right in that IE misinterprets the model model rules.

According to the W3C, the rule states that the height of a block element is : Margin + Border + Padding + Content height. Take the following element as an example:
[code]
<div style="margin: 10px 0px; padding: 10px 0px; height: 30px;">
This is a test
</div>
[/code]

According to W3C, the height of this element should be 70 pixels. FireFox and Chrome all show it as 70 pixels. The problem comes with IE 7 and IE 8 Quirks mode. Regardless of how it comes up with the number, it's not W3C compliant and it's quite annoying. On the bright side, IE 8 Standards does handle it properly. And with the DOCTYPE set, you shouldn't worry about Quirks mode. IE7 only has ~5% of the browser share anymore and most of those users are business users so I wouldn't worry too much about the compatibility issue with IE and the box-model.
0

Share this post


Link to post
Share on other sites
[quote name='Dino' timestamp='1302111187' post='4795129']On the bright side, IE 8 Standards does handle it properly.[/quote]Even IE 6 implements the box model [i]mostly[/i] correctly in standards mode (IE 5 is another story, but I think we can forget about that one). IE 6 will occasionally double up padding for no apparent reason, though this seems to be an unrelated bug.
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0