How to use different fonts in same name - html

I'm having some problems in using fonts
i need to use "Raleway Thin" and "Raleway" font for my webpage and both names are Raleway.
when i type font-family:"raleway Thin","sans sherif"; it does nothing.
what is the best solution for this?
here is the font

Raleway Thin is the 100 weight of the "Raleway" font. Select the normal weight and 100 weight from google fonts, use "Raleway" as the font name wherever you want to use it, and use font-weight: 100; where you want to use "thin". You can also assign the font weight to a class, like .thin, and use the class wherever you want to use the thin font.
h1,h2,.thin {
font-family: Raleway,sans-serif;
}
h2,.thin {
font-weight: 100;
}
<link href="https://fonts.googleapis.com/css?family=Raleway:100,400" rel="stylesheet">
<h1>raleway</h1>
<h2>raleway thin</h2>
<h3 class="thin">also raleway thin</h3>

This is the best way use google font:
body {
font-family: 'Raleway', sans-serif;
font-weight: 400;/* Normal Font */
}
h1{
font-weight: 100;/* Thin Font */
}
h2{
font-weight: 200;/* Extra Light Font */
}
h3{
font-weight: 300;/* Light Font */
}
h4{
font-weight: 500;/* Medium Font */
}
h5{
font-weight: 600;/* Semi Bold Font */
}
h6{
font-weight: 700;/* Bold Font */
}
<link href="https://fonts.googleapis.com/css?family=Raleway:100,200,300,400,500,600,700,800,900" rel="stylesheet">
<h1>test</h1>
<h2>test</h2>
<h3>test</h3>
<h4>test</h4>
<h5>test</h5>
<h6>test</h6>
you can used like that 800,900.

#import url('https://fonts.googleapis.com/css?family=Raleway:100,600');
*{
font-size:30px;
}
.thin{
font-family:Raleway;
font-weight:100;
}
.bold{
font-family:Raleway;
font-weight:600;
}
<div>
<span class="thin">Hello</span>
<span class="bold">World!</span>
</div>
JSFIDDLE

Related

change the font style of text as other text

in above image you can see text "acceptable".
i want to change this font as text "contact us" font which is present below.
we are using
font-family: 'Roboto Condensed', sans-serif;
but it didt worked for us.
Well according to your code, you just have to change the font-size of p tag and you are done. To check the changes try to add Contact us next to acceptable and then you will see both are same. Happy to help :)
Use <span class="red">text</span> and some basic CSS like .red { color: red; }
lOOK AT THIS EXAMPLE
HTML
<span class="red">acceptable</span>
</p>
CSS
p {color: black;
font-size: 13px;
line-height: 26px;
text-align: justify;
}
.red { color: red;
font-family: 'Roboto Condensed', sans-serif; }

basic css font-weight property not working

My html:
<div id="unsurpassed">
<p>
<span>FIRE </span>| Unsurpassed Efficacy
</p>
</div>
My CSS:
#unsurpassed {
margin-top: 20px;
font-size: 32px;
font-family: "Myriad Pro";
}
#unsurpassed p {
color: #77787B;
font-weight: 300;
}
#unsurpassed span {
color: #1D74B6;
font-weight: 400;
}
I want the phrase "| Unsurpassed Efficacy" to have a much lighter weight that "FIRE" currently that isn't happening, not really sure why.
Try using normal and bold for font-weight instead of numbers.
Demo: http://jsfiddle.net/8rHbv/2/
CSS:
#unsurpassed {
margin-top: 20px;
font-size: 32px;
font-family:"Myriad Pro";
}
#unsurpassed p {
color: #77787B;
font-weight: normal;
}
#unsurpassed span {
color: #1D74B6;
font-weight: bold;
}
Use bolder or bold value along with 300 or 400 value and check this work perfect...
#unsurpassed {
margin-top: 20px;
font-size: 32px;
font-family: "Myriad Pro";
}
#unsurpassed p {
color: #77787B;
font-weight: bolder !important;
}
#unsurpassed span {
color: #1D74B6;
font-weight: 400;
}
Also use important word.
Check this DEMO jsFiddle
Do you have all the font weights installed on your computer?
Try add important! after your css code here:
#unsurpassed {
margin-top: 20px;
font-size: 32px;
font-family: "Myriad Pro";
}
#unsurpassed p {
color: #77787B;
font-weight: 300;
}
#unsurpassed p span {
color: #1D74B6;
font-weight: 900 !important;
}
Take a look at this jsFiddle: http://jsfiddle.net/GeUj3/1/
What you are using is valid CSS and should work if the system contains both regular and light typeface of Myriad Pro. Most computers do not contain either of them; this is a different topic, but may affect the analysis of this problem, since you might be looking at the rendering in some other font (the browser’s fallback font) if Myriad Pro is not available.
I cannot test the exact code since my system lacks Myriad Pro, but testing with DejaVu Sans instead, with no other change to the code, on Win 7, I noticed that IE 11 shows “| Unsurpassed Efficacy” in DejaVu Sans Light but Chrome and Firefox use DejaVu Sans (regular) instead, even though developer tools show that the CSS rules are being applied. You may have encountered a similar browser problem.
In general, typefaces lighter than normal (400) often work poorly even in modern browsers. A workaround is to use a light typeface as if it were a font family, with normal font-weight. This works on the browsers tested for DejaVu Sans.
So the following may work in your situation: in the rule for #unsurpassed p, replace font-weight: 300 by font-family: "Myriad Pro Light".
You are visually not going to notice a difference between font-weight 300 and 400
You can do something like this
#unsurpassed {
margin-top: 20px;
font-size: 32px;
font-family: "Myriad Pro";
}
#unsurpassed p span {
color: #1D74B6;
font-weight:bold;
}
#unsurpassed p {
color: #77787B;
}
You can check the different font weights here
Its because your not putting the class IDs in your html, if you don't then the CSS does not know what to do.. and you cant conflict the class id elements.
<div class="unsurpassed">
<p>
<span class="unsurpassed span">FIRE </span><span class="unsurpassed p">| Unsurpassed Efficacy<span>
</p>
</div>
Remember that css class elements are global, so label were you want the css to work in the proper place and don't have then conflict.

Is it possible to include a font style in a font-family list?

I would like to use the italic variant of a font as a backup font in my font-family list in my CSS file. Is this possible in any way? Something like:
font-family: SuperSlanty, Verdana-Italic;
Just use font-style:italic; as described here.
Check this http://jsfiddle.net/Hd4zq/4/
You can load all the google fonts you need through JS in an array and then change the CSS font properties adding the right font-style (in your case italic) to a specific CSS class you will add to your html elements.
<script type="text/javascript">
google.load('webfont','1');
google.setOnLoadCallback(function() {
WebFont.load({
google: {
families: ['Droid Serif','Tangerine']
}
});
});
</script>
<p class="serif">SERIF</p>
<p class="serifItalic">SERIF ITALIC</p>
<p class="serifBold">SERIF BOLD</p>
<p class="serifBoldItalic">SERIF BOLD ITALIC</p>
<p class="tangerine">Tangerine</p>
.serif{
font-family:'Droid Serif';
font-size:30px;
font-style:normal;
font-weight: 400;
}
.serifItalic{
font-family:'Droid Serif';
font-size:30px;
font-style:italic;
font-weight: 400;
}
.serifBold{
font-family:'Droid Serif';
font-size:30px;
font-style:normal;
font-style:bold;
}
.serifBoldItalic{
font-family:'Droid Serif';
font-size:30px;
font-style:italic;
font-weight: bold;
}
.tangerine{
font-family:'Tangerine';
font-size:30px;
font-style:italic;
font-weight: bold;
}
And yes, you can add one of the font in italic as fallback by adding more than one font in the font-family property like:
.fontwithFallback{
font-family: 'Droid','Tangerine';
}

square bullet list wrong font size with body css

I have a list in my sidemenu, the settings don't seem to read past the css of the .body class in stylesheet -
ul.develop
{
list-style-type:square;
color: #FFF;
margin:0;
padding:0;
margin-top:0.6cm;
}
li.develop
{
font-family: 'Arial', sans-serif;
font-size: 11px;
font-weight: normal;
color:#fff;
}
My body class is -
body {
font-family: 'Arial', sans-serif;
font-size: 12px;
font-weight: normal;
}
The list then is defaulting to body class 12px, if I change body to 11px, the list is fine but I want to keep 12px for actual body of main content of copy on site.
I tried using !important but unsure that is correct?
Thanks
I think you may have .develop on ul not li, try putting your font rules on the ul.develop rule as they will apply to the li's underneath.
ul.develop
{
list-style-type:square;
color: #FFF;
margin:0;
padding:0;
margin-top:0.6cm;
font-family: 'Arial', sans-serif;
font-size: 11px;
font-weight: normal;
}
Put your 'body' related CSS above/ before the other styles. It reads it top down. Hope that works!

Why is this word displayed as uppercase in web page?

Check out this web page: http://www.premierleague.com/en-gb/clubs/profile.overview.html/tottenham
Why is word "Lilywhites" displayed as uppercase in web page?
I believe it is simply the font:
font-family: 'PremierLeagueRegular';
within:
.clubheader ul.stats p
{
font-family: 'PremierLeagueRegular','Lucida Grande','Lucida Sans Unicode';
font-size: 18px;
color: white;
padding: 0;
margin: 4px 0;
}
If you were to remove the 'PrimierLeagueRegular' font from the font-family property, you would notice that it changes away from being an uppercase font.
in
<link rel="stylesheet" href="/etc/designs/premierleague/clubs.css" type="text/css">
find
.clubheader ul.stats {
display:block; float:right;
font-family: 'PremierLeagueRegular','Lucida Grande','Lucida Sans Unicode';
color:#fff;font-size:18px;font-weight:normal;line-height:18px;
width:165px;vertical-align:top;position:absolute;top:0;right:0;
}
PremierLeagueRegular font is the reason