Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set font for whole page with ONLY html [closed]

Tags:

html

css

Is there any way to set a global font for a web page using only html. I can't use css cause this is for a school project. Somthing like: <body font = verdana>...content...</body>

like image 679
XD face me Avatar asked Sep 09 '13 19:09

XD face me


People also ask

How do I change the font on an entire HTML page?

How to Change Font Size in HTML. To change font size in HTML, use the CSS font-size property. Set it to the value you want and place it inside a style attribute. Then add this style attribute to an HTML element, like a paragraph, heading, button, or span tag.

How do you set a global font?

Go to Format > Font > Font. + D to open the Font dialog box. Select the font and size you want to use. Select Default, and then select Yes.

Which tag is used to change the font size of entire HTML?

In HTML, you can change the size of text with the <font> tag using the size attribute. The size attribute specifies how large a font will be displayed in either relative or absolute terms.

Which tag will you add to specify a font for your whole page?

The <basefont> tag was used in HTML 4 to specify a default text-color, font-size or font-family for all the text in an HTML document.


1 Answers

The way to do it in HTML with inline styles would be:

<body style="font-family: sans-serif">

This will set the global font to sans-serif

You can also put CSS inside a <style> tag like this:

<style>
    * {
      font-family: sans-serif;
    }
</style>

This will give every element a font of sans-serif

For custom fonts you can use Google Fonts

Edit this is the way to achieve it with pure HTML:

After the <body> tag, add the <font> tag with the face attribute of the font you'd like to use. Example usage:

Fiddle Demo:

http://jsfiddle.net/yHRU7/

HTML:

<body>
    <font face='verdana'>
        <div class='htmlVersion'>No css</div>
    </font>
    <div class='cssVersion'>No Extra Html</div>
</body>

CSS:

.cssVersion {
    font-family: verdana;
}

As you can see there is no difference between the results. I advise that normal stylesheets are used - the method used in the CSS version. This is more maintainable and standard.

like image 53
Hive7 Avatar answered Sep 21 '22 13:09

Hive7