NameSilo

CSS in mozilla

SpaceshipSpaceship
Watch

TWM

Web Marketing SpecialistEstablished Member
Impact
9
Why wont my CSS work in mozilla. This is what i have... its in a linked stylesheet... should i not have it linked?

p { margin-left: .2cm; margin-right: .5; margin-top: 0; font-family: verdana; color: #333333; font-weight: normal; font-size: 11px}

p a:link {color: #0033CC; text-decoration: none}
p a:visited {color: #0033CC; text-decoration: none}
p a:hover {color: #ff9900; text-decoration: none}
p a:active {color: #0033CC; text-decoration: none}


The link stuff works, but the text isnt verdana and isnt the right size... whats wrong???
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Unstoppable Domains โ€” AI StorefrontUnstoppable Domains โ€” AI Storefront
Make sure you have semicolon after each statement - on the sample you showed font-size :11px is missing semicolon.

p { margin-left: .2cm; margin-right: .5cm; margin-top: 0; font-family: verdana; color: #cc3300; font-weight: normal; font-size: 11px;}

p a:link {color: #0033CC; text-decoration: none;}
p a:visited {color: #0033CC; text-decoration: none;}
p a:hover {color: #ff9900; text-decoration: none;}
p a:active {color: #0033CC; text-decoration: none;}
 
0
•••
Right, I can't see precisely what is the problem, mozzy does accept linked style sheets ( - if some of the styles work, you know it is getting to the style sheet okay)

but try giving Verdana a capital like I've done for my site and giving mozzy a second choice as well like I've done below - you can specify the font family in the body tag styles so that you don't have to repeat it for other tags.

font-family:Verdana, sans-serif;


If that doesn't work, perhaps it's your settings on Moz that are over riding the style sheet? Remember that different browsers may render the size a bit differently.
 
0
•••
Check that your page's HTML doesn't contain any font settings that would override your stylesheet...

PS I thought the semicolons in CSS were dividers (and therefore not needed at the end of a line). Of course, it's entirely possible that my statement is wrong, and I'm talking through my fundament. Any CSS gurus care to give a definitive comment? :|
 
Last edited:
0
•••
As far as I remember about learning CSS, semi-colons are not required after the last item. However, it seems good and sensible practice to do so (as it solves the problem of forgetting to sort it if you add another property. I always do it, though I am not exactly a CSS guru (I'm just fascinated by the unexplored possibilities with it and enjoy using it).
 
0
•••
Your CSS is valid, and my copy of FireFox (a fairly new nightly build) recognizes it and properly sets the font. You might want to run your CSS through the validator at w3.org and fix up the concerns it has (it will flag things like not declaring a general font type along with your font face)โ€”this never hurts. You could also upload it somewhere and check from another computer, to verify if the problem is on your end or not.

And yeah, the semicolon at the end is not required and Iโ€™m not aware of any browsers that choke when handling it. It is definitely good practice to include it though, as it reduces the chances of accidentally adding to the rule and causing an error youโ€™ll be stuck digging for.

Edit: Looking at it again, I did catch one error. You included โ€˜margin-right: .5;โ€™, which is invalid. You must always include a unit type (e.g. em, px) when the value is anything but 0 (zero). I would also like to personally suggest sticking to px or em, not inches or centimeters. Only use the later two when preparing a style sheet for print.
 
Last edited by a moderator:
0
•••
Dynadot โ€” .com TransferDynadot โ€” .com Transfer
Appraise.net
Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomainEasy โ€” Zero Commission
DomDB
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back