It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
avatar
AndrewC: I'm just having some CSS trouble (and I know next to nothing about CSS) because some elements share the same CSS id but different properties, so the header looks good but the forum is way too big.
avatar
Wishbone: Is there no way for you to override their class definitions, and control them that way?
That's what I'm working on so far, but it's going slow as I'm getting familiar with CSS at the same time I'm trying to fix said CSS.

My knowledge of CSS is solidly but slowly approaching 1 right now, which means to say I know almost nothing about it.
Almost forgot, css3 added some positional selectors that did come in handy.

In particular, I used this one to make the colors alternate with table rows:

table tr:nth-child(2n){
/*define lighter background*/
}

table tr:nth-child(2n+1){
/*define darker background*/
}

Basically, it will increment n a bunch of times and style all the elements that match appropriately.

Previously, I had to use scripting to achieve this so I personally found it to be a rather nice addition.
Post edited March 03, 2012 by Magnitus
avatar
Wishbone: Is there no way for you to override their class definitions, and control them that way?
avatar
AndrewC: That's what I'm working on so far, but it's going slow as I'm getting familiar with CSS at the same time I'm trying to fix said CSS.

My knowledge of CSS is solidly but slowly approaching 1 right now, which means to say I know almost nothing about it.
I haven't been following this thread, but when you say "CSS id", do you mean <something id="blah" ... >?

The "id" attribute is supposed to be used only once on a page. For multiple items you'd use the "class" attribute. Things can also have more than one class, which may help with handling the different properties you said were having trouble with.

Also, overriding CSS properties is easy. If you define styles for one class or id more than once, each definition will override the definitions above it. For the overall page the order goes linked CSS < embedded css < "style" attribute of individual element.

avatar
Magnitus: Almost forgot, css3 added some positional selectors that did come in handy.
Make sure to test on every single browser you can get your hands on (yes, even Internet Explorer) if you try to do fancy CSS3 stuff. There is not a single browser that implements the entire standardized spec for CSS3, and even when they try they throw in vendor-specific bulls*** like "-moz-border-radius".
Post edited March 03, 2012 by Aaron86
avatar
Aaron86: ...
Problem is that I don't have a single CSS file to handle it, I have two, one for the forum and one that handles the header which is part of the main blog css file. I'll look into combining them. Anyway, I think this is going to be done tomorrow as now I either need a break or I need to work on fixing the cross-posting problems I was having (when a new blog post is made a forum thread should be made as well).
avatar
AndrewC: That's what I'm working on so far, but it's going slow as I'm getting familiar with CSS at the same time I'm trying to fix said CSS.

My knowledge of CSS is solidly but slowly approaching 1 right now, which means to say I know almost nothing about it.
avatar
Aaron86: I haven't been following this thread, but when you say "CSS id", do you mean <something id="blah" ... >?

The "id" attribute is supposed to be used only once on a page. For multiple items you'd use the "class" attribute. Things can also have more than one class, which may help with handling the different properties you said were having trouble with.

Also, overriding CSS properties is easy. If you define styles for one class or id more than once, each definition will override the definitions above it. For the overall page the order goes linked CSS < embedded css < "style" attribute of individual element.
You can use classes, ids or attributes as well as the relationship to a parent.

Ex:

You can define a whole bunch of new classes for your main menu which would clutter your html, of you can do something like this:

<div id="Main_menu">
...
</div>

And then in your css selectors, you can style all the descendants of your main menu div tag using something like this:

div#Main_menu SomeTag{
/*Styling*/
}

This makes for fewer one-time classes.

avatar
Magnitus: Almost forgot, css3 added some positional selectors that did come in handy.
avatar
Aaron86: Make sure to test on every single browser you can get your hands on (yes, even Internet Explorer) if you try to do fancy CSS3 stuff. There is not a single browser that implements the entire standardized spec for CSS3, and even when they try they throw in vendor-specific bulls*** like "-moz-border-radius".
Yeah, I do my tests on recents version of IE, Firefox, Chrome, Opera and Safari.
Post edited March 03, 2012 by Magnitus
avatar
AndrewC: Problem is that I don't have a single CSS file to handle it, I have two, one for the forum and one that handles the header which is part of the main blog css file. I'll look into combining them.
You don't necessarily need to combine them. In what order are they linked to from the web pages? If a page links to the main CSS first then the forum CSS second, the forum CSS will override any conflicting styles defined in the main CSS. That's where the "cascading" part of "cascading style sheets" comes from.

Edit: Example:

/* Element will have red text and blue background */
.my_cool_class {
color: red;
background-color: blue;
}

/* Element will have green background now, but still have red text */
.my_cool_class {
background-color: green;
}
Post edited March 03, 2012 by Aaron86
I'll be the cool guy, and try to do this in DirectX on Windows 8. Considering my almost non-existing knowledge of C++, and so far, basic knowledge of DirectX / WinRT, I hope it won't be a massive failure. :D
Ahem ... I just tried to post my solution to the first exercise, but I seem to have killed the forum with my attempt to preview my post ...

Edit: forum is up again, posted my solution there. :)
Post edited March 03, 2012 by Psyringe
Erm ... trying to upload my avatar seems to have killed the site again ... the avatar _is_ larger than the maximum size noted on the page, but usually forums just auto-reduce it, so I didn't think it would cause problems ...
avatar
Magnitus: Almost forgot, css3 added some positional selectors that did come in handy.

In particular, I used this one to make the colors alternate with table rows:

table tr:nth-child(2n){
/*define lighter background*/
}

table tr:nth-child(2n+1){
/*define darker background*/
}

Basically, it will increment n a bunch of times and style all the elements that match appropriately.

Previously, I had to use scripting to achieve this so I personally found it to be a rather nice addition.
I think that doesn't work in IE8, so be warned.
avatar
Magnitus: Almost forgot, css3 added some positional selectors that did come in handy.

In particular, I used this one to make the colors alternate with table rows:

table tr:nth-child(2n){
/*define lighter background*/
}

table tr:nth-child(2n+1){
/*define darker background*/
}

Basically, it will increment n a bunch of times and style all the elements that match appropriately.

Previously, I had to use scripting to achieve this so I personally found it to be a rather nice addition.
avatar
orcishgamer: I think that doesn't work in IE8, so be warned.
IE8 doesn't support a bucketload of new things.

For example, it doesn't even support canvas or audio tags:

http://www.caniuse.com/#feat=canvas
http://www.caniuse.com/#feat=audio

Given that I want to do some animation and sound without using plugins (I want it to run on native browser technologies out of the box), not to mention render some of the art dynamically to save on artist fees, something's gotta give.

At this point, IE9 is supported on Vista and up and those that use Windows XP can get Chrome, Firefox, Opera, etc.

So the question becomes, who do I penalize? All users or the shrinking minority who insists on using dated browsers despite more recent alternatives been freely available?
Post edited March 04, 2012 by Magnitus
avatar
Magnitus: So the question becomes, who do I penalize? All users or the shrinking minority who insists on using dated browsers despite more recent alternatives been freely available?
That depends on who your audience is. I don't like having to support old versions of IE but such is life, a large portion of my userbase uses IE as their primary browser and they don't upgrade it to the latest and greatest.

caniuse is a great site, btw.

Also, if you haven't looked into Modernizr you can get some of this stuff kind of included in browsers that don't support it. It's a really great tool: http://www.modernizr.com/
avatar
orcishgamer: That depends on who your audience is. I don't like having to support old versions of IE but such is life, a large portion of my userbase uses IE as their primary browser and they don't upgrade it to the latest and greatest.
Web game. The main problem is that I want a bit of animation and sound (and later, if budget allows, a lot more... down the road, I'm really aiming for a desktop game feel on your browser).

Dynamically manipulating the DOM and using animated gifs will only get you so far.

The real alternatives here are html5 or Flash.

I'm not ruling out eventual Flash support, but atm, I'm a one man operation, I don't know squat about Flash, I much prefer native browser technologies over proprietary plugins, my time is limited and my priority is to get something out there.

And really, it's not like I'm not giving everyone a perfectly viable, free option (get yourself a modern browser) so I don't feel too bad about it.


avatar
orcishgamer: caniuse is a great site, btw.
Yeah, I found it in an html5 book I've read. Sadly, it might have been the best part of the book.

avatar
orcishgamer: Also, if you haven't looked into Modernizr you can get some of this stuff kind of included in browsers that don't support it. It's a really great tool: http://www.modernizr.com/
Yeah, that's good for feature detection.

I haven't implemented that part yet (mostly because I need to get some old browser to test it on), but I'll use it to show people with older browser a flat 'update your browser' message.

It's more courteous than to silently allow them to access a web site that has tons of features that just won't work on their browser.
I gotta say, this project was an awesome idea. It's great fun to be messing with C++ again, and it's great that so many of us are participating :-)
Even though my exam week ended, I still have one exam to go next week and I've started studying for it. Sadly that leaves much less time for C++.