Tech Support Forum banner
Status
Not open for further replies.

Discrepancy in treatments of CSS

1K views 11 replies 4 participants last post by  brent.charlebois 
#1 ·
If I create a class, say .test, in a stylesheet with a rule p {color:red; }, then in a paragraph with that class I place some text, the style rule doesn't apply. But if I use in-line styling within the p tag it works ok.
Is there some CSS rule I've missed here? :confused:
 
#4 ·
On closer inspection, I don't seem to be able to use ANY font-related css (font-family, font-size etc.) in internal styling, when it's in a class.
They work fine with in-line styling, but that's a bit tedious (and risky for errors). Could it be related to the (free) website I'm using, maybe not allowing certain parts of CSS?
 
#7 · (Edited)
Stop The Press!
I just found the problem!
The text that I gave the class to was in a <p> element that was styled. I needed the class to be p.myclass and not just .myclass.
Not sure yet if this applies when <p> is not styled.
Thanks for the help. It's nice to know I can come here for advice.
:flowers:
 
#11 ·
That may work, but only because the web browser has been built to allow for common errors. However, CSS standards say that quotes are needed. The same goes for most other cases. In the command line on *NIX systems, file paths with spaces either need the spaces escaped with a backwards slash, or have the entire path quoted. It's to do with the way the parser delimits command line arguments. On command line "cd /path to/some/file" would be treated as two arguments "/path" and "to/some/file". So either "cd /path\ to/some/file" or "cd '/path to/some/file' is required. Same goes for many other languages and environments.
 
Status
Not open for further replies.
You have insufficient privileges to reply here.
Top