Style Sheet and Fonts Styles in HTML

Style Sheet in HTML

HTML Cascading Style Sheets are a sheets with a sets of rule and properties that tell the browsers how to render HTML using all style specified.

CSS are the ways with which we are styles any web page. CSS have all the properties like backgrounds, colors, fonts, spacing, border, etc. which we can be defined for every elements on the page.
HTML Style Sheet is also used to set the layouts of the pages like where the headers, footers or any other element is to be placed on the pages. and same fonts size all over the pages which doesn’t gives a good looks at all to the user.

How to Use HTML Style Sheets?

Its in the pasts, styles, scripts, HTML everythings were written all overs on the same pages. These are mades the page extremely lengthy and extremely difficults to read and edits. Then cames the way to separates HTML, style, and Javascript.

Way to includes HTML Style Sheet on a Webpages:

Ways to includes HTML Style Sheet on a Webpages:

1. Inline Styling

These are a way of writing style for every elements within HTML itselfs insides an attributes called styles.

This is way of styling are not at all recommended as the HTML looks cluttered and we cannot be followed the approachs “Write Once, Uses at many place”.

2. Internal Styling

These are having style includes in a style tags and placing its within a web pages on top of HTML. This is way of styling is still better than inline styling as we can have to common style clubbed together in case it has be used for multiple element at a time.
At the development stages, its easier to edits the HTML files and we need not every time open corresponding CSS files and edits every time.

3. External Styling

These are the most commons and the best ways of having style for a web pages. This similar to the internal styling but the difference are that the style is write in a separate files with extensions .css and reference to its placed in the head tags of the web pages.

What are the Priority between Inlines, Internals, External Stylings?

Inline style takes more priority than internals and then last priority come for the external stylings.

Inline>Internal>External

Best practices while using CSS:

  • CSS can be to separate into a number of file insteads of just one.
  • Separate CSS file can either be included one by one in a head tags using link tag.
  • Or one CSS files can have multiple imports statement to imports rest of the CSS file. These will be logically separated the CSS but get ultimately all style gets rendered from the same files.

Usage: @import ‘./process.css’;

Style can be to define for any element of the web pages with selector as HTML tag itselfs, class names, ids, any attribute name.These are basically state of the selected element and not really the exact element.

  • When multiplied CSS file is included in the pages, the last one take the highest priority and override the existing style of previous file having the same selectors.
  • Stylesheet should be used before HTML itselfs so that style gets applied while the pages are loading. If includes at the end, HTML would first loads and then slowly style gets applied which give a very bad experience to the users.

Fonts Styles of HTML

Introduction to HTML Fonts Styles

The following articles, HTML Font Styles are provided an outlines of the most commonly uses font styles in HTML. HTML popularly knowns as HyperText Markup Language are one of the most essential and criticals language or the scripts which are essential in creating web application and website. These are likes the backbones of web app developments as all the tag and other feature form the underlying components of its.

All the front end developments are also based on HTML scripting. These can just be to use to provides markup tag and in order to enhance the looks and feels of these tag, we have to another library that, CSS which stands for Cascading Style Sheets. These can be used to implements all kind of styles that is required by the HTML. The fonts and styles form the major parts of the websites and in this article, we is going to provides you a lists of the majority of the HTML font style.

HTML Font styles:

Fonts plays a very major role in making a websites more user-friendly and the one which attract more traffics aparts from increasing contents readability. The font colors and the font faces also depend on the computers and the browsers which are making it is use and the HTML font tags are also used to add the styles, color, size to the text on your websites.

The basefont tag are use to set all the texts which are presents on your websites or inside the div elements to the same size, colors, and faces. The font tags consist of the three attribute namely face colors and sizes which agains form a very critical components of the different fonts style present inside the websites.

Lets us look at some of the basic HTML Font Styles:

  • Setting Font Size: The contents font size can be sets by making use of size attribute. The accepted values of the ranges lie from 1 which are the smallest numbers and it goes till 7 which are the largest numbers. The default sizes of any font types are 3..

Example,

<!DOCTYPE html>

<html>

<head>

<title>Setting Basic Font Size<title>

<head>

<body>

<font size = “1”>Font size = “1”<font><br />

<font size = “2”>Font size = “2”>/font><br />

<font size = “3”>Font size = “3”>/font><br />

<font size = “4”>Font size = “4”>/font><br />

<font size = “5”>Font size = “5”>/font><br />

<font size = “6”>Font size = “6”>/font><br />

<font size = “7”>Font size = “7”>/font>

</body>

</html>

  • Relative Font Size: The relative fonts size are used to determines and specify how many size is larger and how many size is smaller than the current fonts size which are actually presents. These can be specified likes :

<font size = “+f”>or by writing

<font size = “−f”>

Example,

<!DOCTYPE html>

<html>

<head>

<title>Relative Font Size</title>

</head>

<body>

<font size = “-1″>Font size = “-1″>/font><br />

<font size = “+1″>Font size = “+1″>/font><br />

<font size = “+2″>Font size = “+2″</font><br />

<font size = “+3″>Font size = “+3″</font><br />

<font size = “+4″>;Font size = “+4″</font>

</body>

</html>

  • Setting Font Face: The others categories after the setting of fonts size and relative fonts size are that of the setting up of font faces. These are form a critical parts of the attribute listed above. These can be sets by making use of faces attribute but its always be kept in mind that if the user who are designated to uses this fonts value doesn’t have these fonts installed in their systems, then they will not be able to see its. .

Example,

<!DOCTYPE html>

<html>

<head>

<title>Font Face</title>

</head>

<body>

<font face = “Times New Roman” size = “5”>

Times New Roman</font><br />

<font face = “Verdana” size = “5”>

Verdana</font><br />

<font face = “Comic sans MS” size =” 5″>

Comic Sans MS</font><br />

<font face = “WildWest” size = “5”>

WildWest</font><br /&gt

<font face = “Bedrock” size = “5”>

Bedrock>/font><br >

</body>

</html>

  • Specify Alternative Font Faces:
    • These are uses to specify various kind of fonts face only if the users have that particular fonts installed on their systems, otherwise, a defaults installed fonts will be visibles. Its possible to mentions more than one, specifically two or more than two fonts face alternative by listing downs the fonts face name which is specifically separated by a comma’s.
    • When the webpages gets loaded, The browsers will be responsibles to displays the first-ever fonts which will gets generated. If none of the provided font is installed in the systems, then the defaults fonts face which are Times New Roman will be displayed successfully.

Example,

<font face = “arial,helvetica”>

<;font face = “Lucida Calligraphy,Comic

Sans MS,Lucida Console”>

  • Setting Font Color: These are another attributes that form the critical parts and components of the HTML fonts and style lists. In these font colors are sets up by making uses of any color attributes, the color which are required could be require by making uses of hexadecimal codes and colors name for the specified colors.

Example,

<!DOCTYPE html>

<html>

<head>

<title>Setting Font Color</title>

</head>

<body>

<font color = “#FF00FF”>This text is in pink

</font><br />

<font color = “red”>This text is red>/font>

</body>

</html>

<basefont>

  • Element:
    • These elements are specifics to HTML languages and are supposed to provides the webpages a defaults font sizes, typefaces, and colors for all the part and component of the document which is not contained inside the font tags.
    • The font tags could be easily to use to overrides the basefont setting.
    • These are tags also make uses of colors, faces and size attribute which will be relatively supports all the fonts setting by providing the sizes of a values of +1 for one sizes greater or -2 for two sizes smaller.

Example,

<!DOCTYPE html>

<html>

<head>

<title>Setting Basefont Color</title>

</head>

<body>

<basefont face = “arial, verdana,

sans-serif” size = “2” color = “#ff0000″>

<p>This is the page’s default font.</p>

<h2>Example of the &lt;basefont&gt; Element

</h2>

</body>,

</html>

Leave a Reply

Your email address will not be published. Required fields are marked *