What is the CSS that must be created to match (exactly) the style given in the text properties in Photoshop ?
Photoshop has four basic text properties:
font-family. The CSS for this is font-family: name;
?
font-size. The CSS for this is font-family: 0px;
?
But how can we set the style for the 2 and 3 properties ?
Here is what the options for those properties are:
You aren't going to match them exactly.
2.) Different combos of font-style, font-weight, and letter-spacing will recreate many of the options.
4.) Aliasing varies across browsers and doesn't have a "standard." That being said, font-smoothing and especially text-shadow will get you pretty close. This answer has some good examples.
Example Fiddle
Related
I'm sure that css code is correct. But Firefox cannot understand and display it.
Here is case 1 within css:
.fa-circle:before {
content: "\f111"
}
and here is another case:
.fa-group:before,
.fa-users:before {
content: "\f0c0"
}
Can you tell me how to fix it? Thank you!
Sounds to me like your pseudo-element's containers (the i and span elements) are having their font properties overridden by something else.
In Firefox's element inspector you should see the following inherited styles:
Importantly the font-family property should not have a line through it - if it does, it means the font being used isn't Font Awesome. If that is the case you'll instead see:
If this is the case, the font being used isn't Font Awesome and the requested character code doesn't exist in the other font's character set.
When working with CSS, i'm able to set all properties of font in one declaration like font: italic bold 24px "verdana"; instead of writing font-style:italic; font-weight:bold; font-size:24px; font-family:"verdana";
Similarly i tried to set text properties (text-align, text-indent, text-transform, text-decoration, etc) in one declaration but i did not get the effects.
What I want to know is...
Is it possible to set these kind of properties in one declaration like text:underline justify capitalize 20px;?
if possible...,
-what properties can I set?
-What is the order of the properties that i should specify?
-what are the required properties?
Although font is a known abbreviation for an aggregate collection of properties, there does not appear to be any equivalent to let you specify all text properties together.
This is not possible and neither efficient to look back on. But what you can do is make an extra stylesheet.css and add "standard" classes in there like a class: text1
Which you will fill in with:
text-align: justify;
text-decoration: underline;
etc.
so you just have basic classes which add alot of css you dont need to make an extra stylesheet but it would keep everything orderd from custom css to standard classes you made on your own and you can use em for sites in the future.
I need to set the font to "strong", but can't work out how to do this with CSS? I tried
font-weight: 'Strong';
And I also tried it without the marks and it didn't work either. I'd like to set it to strong and not just bold as I've heard it helps disabled people while they are browsing your website (but that may be rubbish?!)
You probably mean:
font-weight: bold;
There is no strong weight, try bold (which is usually the default browser style for a <strong> element.
more about font-weight at MDN
I just solved this exact problem based off the post I read here. Bold is not what you want as bold is not the equivalent of strong.
For me using a polymer custom component.
Strong = font-weight: 400
Bold starts at font-weight: 500 or greater.
Looking into it a bit further reveals that this is dependant on browser version and display and sometimes things don't get rendered how you want.
More details can be found at the MDN link posted above by steveax and Ryan
bold is the only way. You're confusing the accessibility aspect with the HTML tags <b> and <strong>, which have a bold style by default.
<b> versus <strong> has less to do with accessibility, too, and more to do with semantics and the separation of styles from content. After all, you can style all <b> tags to be non-bold, and that’s just confusing.
font-weight:bold; is the equivalent of 'strong' font. You can also try
font-weight:900; (using numeric values).
strong is a html tag. css is for visual.
Image below displays the result for:
div.test { background: #00F; font-size: 50px; line-height: 50px; color: #FFF; margin: 50px 0; font-family: Wiesbaden; }
One using Wiesbaden (which is font-face) and the other without.font-face font seem to ignore the line-height property.
Is it font-face issue or the font?
The property line-height only specifies the vertical distance between the start of one line and the start of the next. If you typed out something that took up two lines, the start of the 2nd line should be in the same vertical position using either font.
It seems like that's just how your font looks at 'font-size: 50px'. If you wanted to, you could increase the font-size while keeping line-height: 50px to correct it.
In short, it's not an issue with either. They're behaving exactly how they should be. See your blue background? That's your line-height. Line-height doesn't affect the font itself, but rather the spacing of the lines of the text.
Some fonts are different sizes even when set to the same font-size. It's the way the glyphs are rendered. If you want your text larger, increase the font size. If you want fallbacks to be the same size, you can use similarly-sized fonts (look up "font stack generators" for help on this), or check out the CSS3 font-size-adjust property (do note that it is CSS3, so you'll want to double-check support of it).
I had a similar issue, but I used a Cufon script instead of fontface to avoid browsers issues. To solve my line-height issue I changed the doctype from transitional to strict. Try that.
The following fiddle illustrates the differences between 4 fonts (3 being very common fonts found on Macs, PCs, etc). One is a Google-font. Regardless, 4 fonts - four different results. If a design is going to rely heavily on a 'non-standard' font, be sure the fallbacks don't blow the whole thing up.
Pay particular attention to the differences in:
the top spacing between the capital Q and its parent's border
the various heights of the Xx (especially, the lower-case vs capital)
descender of the lower-case G (some actually come out of their
parent)
_http://jsfiddle.net/suK2U/
I tried this and it works perfectly!! just play with percentage until you find the needed result.
Apply this on your #font-face:
ascent-override: 90%;
Hope it helps!
More info:
https://developer.mozilla.org/en-US/docs/Web/CSS/#font-face/ascent-override
After referring these two links (font properties and text properties), I have a doubt.
What is font? and what is text?
http://www.w3schools.com/CSS/css_reference.asp#font
http://www.w3schools.com/CSS/css_reference.asp#text
For example both color, font-size describes typography but why they placed in two different categories?
I'm missing some thing basically. What is it? Thanks for any help in advance.
Font is purely for control of Font related attributes whereas Text controls things that go beyond just the Font (such as alignment, etc).
Font is somehow like properties of the text, like :
Font-size:15px;
Font-Family: Sans Serif;
Font-Color: Red;
Text are the one that you will print on the browser,
Font is the CSS Property.
For more info refer this link : CSS Text & Font Properties
Font is how the letters look like. Text is where to place them...