Jump to content

font family -green color


Recommended Posts

I use dreamweaver to edit css files and sth has caught my attention.Whenever i choose a font-family in a selector, one of the fonts appear in Green color and in quotes.Why that?Thanks

Link to post
Share on other sites
The one in green and in quotation, is the default font for all browser for that selector and if any browser don't support that FONT, then they may choose to use the second one.
I thought so too.But when i erased the font in green(and in quotation) from the font family declaration of a selector the font appearing in that element DID NOT changeHere is an example:font-family: Georgia, "Times New Roman", Times, serif;According to you the browser will prioritize "Times New Roman" and if this is not found in the user's computer he will put another font,Georgia or Times-i do not know in what turn he will go on choosing.Nonetheless, the browser displays Georgia and NOT "Times New Roman" .Can you explain that?
Link to post
Share on other sites

The quotes are required around font names that have spaces in them. I am guessing that the green color is how Dreamweaver styles strings (syntax highlighting). If you do something like this:background: url("images/imageA.jpg");it will probably turn the "images/imageA.jpg" green as well.

Link to post
Share on other sites
The quotes are required around font names that have spaces in them. I am guessing that the green color is how Dreamweaver styles strings (syntax highlighting). If you do something like this:background: url("images/imageA.jpg");it will probably turn the "images/imageA.jpg" green as well.
Now it makes sense.Thanks.
Link to post
Share on other sites

By the way.Is the Georgia font present in the vast majority of the pc's today?Should i put it as a first option in the font-family property in the css?What do you think;

Link to post
Share on other sites
By the way.Is the Georgia font present in the vast majority of the pc's today?Should i put it as a first option in the font-family property in the css?What do you think;
The font you would like to use, set it first, then set a back up. your syntax should be as followed if you want the Times New Roman as your default page font, and Georgia as your fall back in case Times New Roman isnt available, which is installed with Windows.body {font-family: "Times New Roman", Georgia, Times, serif;}Its a "Cascade" effect. The first font will be used. If it should fail or is not present, the next font should load. Most quality editors turn certain elements different colors to help you "organize" your workflow. Some times in Dreamweaver, it doesnt all ad the quotes, all you have to do is add quotes around the first font, and the image path to turn it green. I would recommend double quotes, though single quotes can be used, but stick with one or the other, single or double.
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...