The Grey Labyrinth is a collection of puzzles, riddles, mind games, paradoxes and other intellectually challenging diversions. Related topics: puzzle games, logic puzzles, lateral thinking puzzles, philosophy, mind benders, brain teasers, word problems, conundrums, 3d puzzles, spatial reasoning, intelligence tests, mathematical diversions, paradoxes, physics problems, reasoning, math, science.

   
The Grey Labyrinth Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups    RegisterRegister  
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CSS tags and browsers

 
Reply to topic    The Grey Labyrinth Forum Index -> Science, Art, and Culture
View previous topic :: View next topic  
Author Message
wordcross

<memstat>



PostPosted: Thu Apr 09, 2009 11:26 pm    Post subject: 1 Reply with quote

So recently I was writing code for a pretty straightforward text page which had different lines in different colors. Aside from the standard black text, there was also red, green, and blue text.

So, being that I'm only generally and not very technically versed in CSS, I just went about my business and did what I assumed worked from examples I found on w3schools.com.

Which led me to do this: (square brackets replace <> symbols because i don't know how the message board handles html script)
Quote:
...
[head]
[style type="text/css"]
red {color: #ff0000}
blue {color: #0000ff}
green {color: #008000}
[/style]
[/head]
...

and then using the tags thusly:
Quote:
...
[red]Some text[/red]
[blue]Some other text[/blue]
[green]Some other other text[/green]
...


And this seemed to be perfectly okay when seen in Firefox, Opera, Chrome, and even in Safari. However, IE didn't like that at all and just showed black text. I ended up doing this instead:
Quote:
...
[style type="text/css"]
p.red {color: #ff0000}
p.blue {color: #0000ff}
p.green {color: #008000}
[/style]
...

and then invoking the classes in the [p] tag.

So aside from the fact that Internet Explorer delights in causing hardship for web programmers, is there a reason why making up tags is a bad idea?

Is there some other method of making up stuff that is more elegant than just attributing classes to a pre-existing tag?

Should I give up and leave this to people who aren't hopeless at understanding the nuances of css and html?

(If you're curious this is the page I was coding)
_________________
Has anyone really been far even as decided to use even go want to do look more like?
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger
raekuul
Lives under a bridge & tells stories.



PostPosted: Fri Apr 10, 2009 12:26 am    Post subject: 2 Reply with quote

If you use code tags, you should be able to put anything you need.
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
wordcross

<memstat>



PostPosted: Fri Apr 10, 2009 2:08 am    Post subject: 3 Reply with quote

meaning what? put it where? like i have it now, only with "code" instead of "p" or some other way? I looked up the code tag but it doesn't do anything specifically that relates to this.
_________________
Has anyone really been far even as decided to use even go want to do look more like?
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger
worm
unregistered



PostPosted: Fri Apr 10, 2009 2:59 am    Post subject: 4 Reply with quote

I figured he meant you wouldn't have to switch "[" for "<" if you use the GL's code tag.

the board can handle html code, though. It was kinda fun when it couldn't Revenge most foul!

See:

Quote:

<style type="text/css">
p.red {color: #ff0000}
p.blue {color: #0000ff}
p.green {color: #008000}
</style>
Back to top
View user's profile Send private message AIM Address
wordcross

<memstat>



PostPosted: Fri Apr 10, 2009 3:08 am    Post subject: 5 Reply with quote

yeah, after i left my computer i was thinking about what the code tag does and I thought to myself "Oh hey, he was probably actually making an astute observation that I completely misinterpreted!"

sorry raekuul Embarrassed
_________________
Has anyone really been far even as decided to use even go want to do look more like?
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger
Lepton*
Guest



PostPosted: Fri Apr 10, 2009 9:36 am    Post subject: 6 Reply with quote

You could make each event on your page an instantiation of a css class, with each level denoted as a different subclass (title, place, date, etc). Then, you're a bit more flexible in the future if you want to change how the page looks.

Maybe the trouble is because of <span> tags?

On the other side of things, I think that I've been forced to use a ugly hack in order to get my content boxes to clear properly in Firefox (but it works as one would expect in IE). Site
Back to top
Display posts from previous: by   
Reply to topic    The Grey Labyrinth Forum Index -> Science, Art, and Culture All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Site Design by Wx3