Selfmade Font from MyScriptFont.com dont works - html

I've created a own font with http://www.myscriptfont.com/ but this does not appear on my website. My code
#font-face {
font-family: 'MyFontName';
src: url('fonts/MyFontName.otf');
src: url('fonts/MyFontName.ttf');
font-weight: normal;
font-style: normal;
}
MyFontName {
color: #df0000;
font-size: 15px;
font-size: 1.5rem;
font-family: MyFontName;
font-size: 35px;
}
what am I doing wrong?
Thanks a lot for your help!
Greetings from germany

The way you created the class is wrong. May be this cause issue.
Instead of this:
MyFontName {
color: #df0000;
font-size: 15px;
font-size: 1.5rem;
font-family: MyFontName;
font-size: 35px;
}
Use like this:
.CustomClass{
color: #df0000;
font-size: 15px;
font-size: 1.5rem;
font-family: MyFontName;
font-size: 35px;
}
HTML:
<div class="CustomClass">My Sample Text Goes Here</div>

Related

How to make the thinnest font

I have a font in photoshop:
and when I set font-weight: 100 the result is too bold.
Font-size:72px, font-family:"Montseratt"
When I'm changing font-weight from 300 to 400 font also changings (for font-weight: 100, 200, 300 font the same). I guess it means that property works, but how can I make font thinner than value that property can set
you can do this.
you make a typo it's font-family: 'Montserrat', sans-serif; not
font-family:"Montseratt"
body {
font-family: 'Montserrat', sans-serif;
font-size: 50px;
}
.thin {
font-weight: 100;
}
.normal {
font-weight: 400;
}
<link href="https://fonts.googleapis.com/css?family=Montserrat:100,400" rel="stylesheet">
<p class="thin">THIN<p>
<p class="normal">NORMAL</p>
p.normal {
font-weight: normal;
}
p.thick {
font-weight: bold;
}
p.thicker {
font-weight: 900;
}
it may help you

Div moving around on mobile?

I am finishing a project which is mainly a photo viewer with a short video at the beginning. Over the video there is a title, something very simple like so:
<div id="presentacion">
<h1>PARANA</h1>
<h2>PHOTOGRAPHIES DE MAX RUIZ</h2>
</div>
with a css like so:
#presentacion h1{
font-family: Deser;
font-weight: lighter;
padding: 0;
margin: 0;
margin-right: -.2em;
line-height: 1em;
font-size: 7.5em;
letter-spacing: .35em;
color: white;
}
#presentacion h2{
font-family: Deser;
font-weight: lighter;
letter-spacing: .2em;
padding: 0;
margin: 0;
font-size: 1.8em;
color: white;
}
This looks fine on desktop computers:
http://maxruiz-parana.com
For mobile I have a media queries set up with slightly different css, like so:
#presentacion h1{
font-family: Deser;
font-weight: lighter;
padding: 0;
margin: 0;
margin-right: -.2em;
line-height: 1em;
font-size: 9em;
letter-spacing: .35em;
color: white;
}
#presentacion h2{
font-family: Deser;
font-weight: lighter;
letter-spacing: .2em;
padding: 0;
margin: 0;
font-size: 3.5em;
line-height: 1.3em;
color: white;
}
As you can see, the differences are minimal. Now, if you check the same website on a mobile phone, you will see that the title starts at a completely different place and then snaps into place.
Why is this happening? Any ideas appreciated. Thanks
EDIT-------------------------------------------------------------------
I found that eliminating the following declaration:
html {
position: fixed;}
From my media queries section solved the problem of the title moving, but I do want the html to be fixed for mobile. Any ideas appreciated. Thanks

Removing space between h1 and h2

I have stumbled across a problem that I can not seem to solve in any way, maybe I am using divs in a wrong way?
.greeting h1 {
font-family: 'Raleway', sans-serif;
font-weight: lighter;
font-size: 100px;
text-align: center
}
.greeting h2 {
font-family: 'Raleway', sans-serif;
font-weight: lighter;
font-size: 35px;
line-height: 0px;
text-align: center
}
<div class="greeting">
<h1>Hi.</h1>
<h2>Select a group</h2>
</div>
This is the outcome:
I want to decrease the space between my <h1> and <h2>, and I found out that the way to do that was to set line-height in h1 to 0px.
But as I do that my entire page moves up like so:
I want to keep the text at the same position as it was before I change the line-height. I am suspecting that I am using the div class function wrong. This is more of theoretical question.
headings h1 to h6 have margin by default, so you need to reset it, setting: margin:0.
.greeting h1 {
font-family: 'Raleway', sans-serif;
font-weight: lighter;
font-size: 100px;
text-align: center;
margin: 0
}
.greeting h2 {
font-family: 'Raleway', sans-serif;
font-weight: lighter;
font-size: 35px;
text-align: center;
margin: 0
}
<div class="greeting">
<h1>Hi.</h1>
<h2>Select a group</h2>
</div>
HTML heading tags have some default CSS values applied in most browsers. Following are the values of h1 and h2 that are applied to them by default, so you need to override the margin-bottom of h1 and margin-top of h2 if you want to decrease the spacing between your h1 and h2.
h1 {
display: block;
font-size: 2em;
margin-top: 0.67em;
margin-bottom: 0.67em;
margin-left: 0;
margin-right: 0;
font-weight: bold;
}
h2 {
display: block;
font-size: 1.5em;
margin-top: 0.83em;
margin-bottom: 0.83em;
margin-left: 0;
margin-right: 0;
font-weight: bold;
}
.greeting h1 {
font-family: 'Raleway', sans-serif;
font-weight: lighter;
font-size: 100px;
text-align: center;
margin-bottom: 0;
}
.greeting h2 {
font-family: 'Raleway', sans-serif;
font-weight: lighter;
font-size: 35px;
line-height: 0px;
text-align: center;
margin-top: 0;
}
<div class="greeting">
<h1>Hi.</h1>
<h2>Select a group</h2>
</div>
Just add the following lines
.greeting h1 {
margin:0px;
line-height:35px;
}
.greeting h2 {
margin:0px;
line-height:35px;
}
If you just want you to assign the margin only for this block you do not need to define it globally you can just do the same this using inline CSS
<h1 style="margin-bottom: 0">Hi</h1>
<h2 style="margin-top: 0">Select a group</h2>

My CSS doesn't work now that I used a <!--nextpage--> to split my page

This is what my CSS looks like on the page.
<!DOCTYPE html>
<html>
<head>
<style>
p.addresscenter {
background-color: none;
color: #333;
font-family: Lato, sans-serif;
font-size: 15px;
font-weight: 400;
font-style: normal;
line-height: 1.2;
margin: 0;
text-align: center;
white-space: pre;
}
p.endtagbold {
background-color: none;
color: #000000;
font-family: Lato, sans-serif;
font-size: 16px;
font-weight: 600;
font-style: normal;
line-height: 1.2;
margin: 0;
padding-top:16px;
}
p.hoursofoperationcenter {
background-color: none;
color: #333;
font-family: Lato, sans-serif;
font-size: 15px;
font-weight: 400;
font-style: normal;
line-height: 1.3;
margin: 0;
text-align: center;
white-space: pre;
}
p.infop {
background-color: none;
color: #OOOOOO;
font-family: Lato, sans-serif;
font-size: 16px;
font-weight: normal;
font-style: normal;
line-height: 1.5;
margin: 0;
padding-bottom:30px;
}
p.infostextbox {
background-color: none;
color: #OOOOOO;
font-family: Lato, sans-serif;
font-size: 16px;
font-weight: 550;
font-style: normal;
line-height: 1.5;
margin: 0;
padding-bottom:16px;
}
p.topmenu {
background-color: none;
font-family: Lato, sans-serif;
font-size: 15px;
font-weight: 500;
font-style: normal;
line-height: 1.4;
margin: 0;
text-align: center;
}
p.towncounty {
background-color: none;
color: #000000;
font-family: Lato, sans-serif;
font-size: 16px;
font-weight: 700;
font-style: italic;
line-height: 1.4;
margin: 0;
padding-top:16px;
}
</style>
</head>
<body>
<p class="topmenu">Text with id tags here.</p>
There is a set of columns here made with these tags
<div class="one-half first">Text</div>
<div class="one-half"> Text </div>
Then there is more text which is formulated by <p class=""></p> and then finally the <!--nextpage--> attribute occurs somewhere in the middle.
After the <!--nextpage--> tag I have more text with <p class=""></p>
The entire page ends with
</body>
</html>
On my other pages that are not split the css shows up fine. For whatever reason the css is not showing up on page 2 after the <!--nextpage--> . What do I have to do to make sure the css shows up before and after the <!--nextpage--> attribute.
I'm not sure if I understand everything well, but You should try to place <!--nextpage--> between the tags, and not inside of them.
For example:
<p>asdasd</p><!--nextpage--><p>asdasd</p>
Is ok, while:
<p>asdasd<!--nextpage-->asdasdasd</p>
is not ok. I hope this is the case, if not, please do not downvote and update You question with full code. Then I will try to update my answer.
Few more words. When You click next page, then the paragraph element has started on the page before. So on the actual page there is no paragraph start, but only: asdasdasd</p> which is causing problems, and is not a valid html.
Best regards.

CSS text starting from a wrong place

This might be a stupid question, but it has been troubling me a lot.
I have made 4 boxes and each box should have the text starting from a same line, but sometimes (when the text is less), it starts from the bottom.
Here's the image displaying it:
Ideally, it should start from the top and go till the bottom. Like this:
What changes should I make in my CSS code?
CSS :-
.show-text {
margin-left: 264px;
float: left;
font-size: 15px;
width: 15em;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
line-height: 18px;
color: #606060;
}
.show-text-col-2 {
display: inline-block;
margin-left: 20px;
font-size: 15px;
width: 15em;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
line-height: 18px;
color: #606060;
}
.show-text-col-3 {
display: inline-block;
margin-left: 20px;
font-size: 15px;
width: 15em;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
line-height: 18px;
color: #606060;
}
.show-text-col-4 {
display: inline-block;
margin-left: 20px;
font-size: 15px;
width: 15em;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
line-height: 18px;
color: #606060;
}
My JSFiddle :- http://jsfiddle.net/xa0obvyr/
Because you are using inline-block, you need to specify vertical alignment if the default value doesn't suit you. In this case, you need
show-text-col-4 {vertical-align: top;}
However, your setup is less than ideal. Rather than floating the first time with a large left margin, I'd recommend you use a centered wrapper element instead, and style each of the columns in the same way.
This is what you need? with one CSS class and automatic 1/4 width of each column.
Please check the demo: http://jsfiddle.net/sk1rqxeo/
.show-text-col {
float: left;
font-size: 12px;
font-family: Arial, Helvetica, sans-serif;
line-height: 18px;
color: #606060;
width:24.5%;
display: inline-block;
}
You will need to set width to <p> tag
FIDDLE DEMO
.show-text-col-3 p{
width:200px;
}