The size of the text is important for the optimal perception of information by the visitor. A variety of browsers and display devices for web resources require adaptive layout. Designer's ideas can appeal to the transformation of the text for ease of placement or reading.
In all practical situations, the placement of text on an HTML page, its orientation, transformation, font selection and size play an important role in the appearance of the page, visitor comfort and site ranking.
Basic CSS Rules for Text
The main HTML tags that host the text are div and span. These elements are the basic, but not the only bricks from which the web page is built. You can specify the size of the text in HTML and CSS. In the first case, the style tag attribute is used, in the second case, the style rule.
The size of the text is set by choosing the font and its size. In addition, fonts with different letter sizes and strictly proportional fonts are used, in which, for example, the letter i takes up as much space as the letter S.
An example of common rules:
- font-size: 14px;
- font-family: Arial.
These descriptions are defined using the style attribute of the tag or CSS: text size 14 pixels, font name Arial. This description option does not bind the element to the parent, browser window, or adjacent elements.
A simple description of each text element is convenient, but takes up a lot of space. It is not always convenient to use the inheritance of descriptions, but to highlight general rules and clarify the features of each element is a classic, practical and compact style.
Using the values of such rules through:%, em or rem, and allows you to determine the size by resizing the CSS text - the rule of the parent element.
The CSS standard also offers keywords: xx-small, x-small, small, medium, large, x-large and xx-large. However, developers often use a convenient CSS description : the text size is a pixel (px).
Text transformation
CSS rules are neither a dogma nor a guide to action. How to manipulate them is determined by the developer. Experience is of great importance here. The knowledge and skills accumulated over time allow you to quickly and efficiently solve extraordinary tasks.
Typically, the placement of the text is the concern of the project coordinator, designer, but not the developer. The coordinator and designer may not know what CSS and text size is in coding practice.
The choice of the developer determines the ability to create the right site, the formation of the desired design. The developer is the quality of the result and the time to complete the work.
HTML and CSS features
The dynamics of hypertext development is a slow and very inertial process. The practice of creating sites is a significantly higher dynamics. HTML5 and CSS3 are a lot of new features, but another developer can create an ideal design of rules and tags from their own experience, without using new features, and ensure that the web page works perfectly in any browsers, on any devices.
A browser is a DOM (page object tree) and a JavaScript programming language. Creating a modern website is the best combination of HTML, CSS and JavaScript.
The idea is to simply use standard rules and decide only with their help how to change the size of text in CSS and its placement using HTML, a long time ago. Internet programming is not inertial standards of hypertext, it is a rapid movement forward. It is important to gain experience in applying the rules, to create optimal knowledge and skills.
Sometimes it’s useful to spend time exploring new HTML and CSS features, but it’s even more useful to port these new features to familiar “old” constructs. This is necessary not so much in actual practice as the developer needs to create the experience that will be needed in the future.
Mind training is a good idea. Placing text in a quality manner is far from HTML and CSS. This is, first of all, the content of the text, its correct wording, its actual size, distribution of meaning, and only then - a series of rules that will ideally present the desired meaning in the right place on the page to the visitor.
Concentration and the formation of meaning
There has never been and never will be objective reasons to solve a problem as defined by the project manager, customer or other person managing the developer.
Moreover, the project coordinator, like the developer, should understand: CSS rules and text size are completely different concepts. The first is the design into which something can somehow be placed. The second is the dynamics: before the visitor arrives (moving the mouse), this is one text, one content. At the time of updating, completely different content, completely different text should appear in the right place of the browser window.
If you deliberately separate the necessary CSS rules, and determine the size of the text by the moments of demand for the latter, then the site comes to life and the design takes on a dynamic style.
The page opened - the visitor saw the concentration of meaning by category. The visitor drew attention to a certain place on the web page, and she reciprocated: she revealed the specific meaning of the updated category.
Live site and dynamic sense, what more could a visitor want? Is that respect for the developer.