Today: March 29, 2024 1:10 am

Familiarity with CSS language commands


CSS has simple commands and uses a number of English keywords to name different style attributes. A style page contains a list of rules. Each rule or set of rules consists of one or more selectors and a notification block. The purpose of this article is to introduce you to the css language commands. Below is a general example of the main parts of the syntax of this language.

Selector

In CSS, selectors specify which part of the style marker applies by matching tags and attributes to their markup. One of the components of the css language commands are selectors.

Voters may apply the following:

  • All elements that are of a specific type, for example second level h2 headers
  • Elements identified by attributes, in particular:
    • id: A unique identifier in a document, marked with the prefix # for example id #
    • class: An identifier that can annotate several elements in a document, specified by the course prefix, such as classname.
  • The elements depend on how they are positioned relative to the others in the document tree.

Classes and identifiers are case sensitive, start with letters, and can include letters of the alphabet, hyphens, and underscores. A class can be applied to any number of instance elements. The ID may only be used for one element.

سینتکس دستورات css

Declaration block

The notification block is another part of the css language commands. Contains one or more notifications separated by commas.

The notification block contains a list of notifications in parentheses. Each notification itself consists of a property, two dots (:) and a value. If there are multiple notifications in a block, a colon (;) must be entered to separate the notifications. Use of toxic cologne after last notification, or in single notifications is optional.

Properties are defined in the CSS standard. Each attribute contains a set of possible values. Some attributes can affect any type of element, while others apply only to a specific group of elements.

p {
  color: red;
  text-align: center;
}

Example explanation:

  • p Is a selector in CSS (this indicates the HTML element you want to style: <p> ).
  • color Is a feature and red Is the value of the attribute.
  • text-align Is a feature, and center Is the value of the attribute.

How to use css

Before CSS came into being, almost all the features of HTML documents were present in HTML markup. All font colors, background styles, element alignments, margins, and sizes should be explicitly, often frequently, described in HTML. CSS allows authors to transfer large amounts of information to another file (style page). As a result, HTML becomes much simpler.

For example, headings (elements h1), subheadings (h2), subheadings (h3), etc., are structurally defined using HTML. In print and on screen, the choice of font, size, color and emphasis for these elements is dramatic.

Learn how to use it with a few simple examples

Before CSS came into being, document writers wanted such features تایپوگرافی For example, to assign all h2 titles, they had to repeat the HTML display markup for each type of title. This made the documents more complex, larger, with more errors and more difficult to maintain. CSS allows you to separate the appearance of the structure. CSS commands can define color, font, text alignment, size, margins, spacing, layout, and many other typographic features. They can also do this independently for screen and print views. CSS also defines non-intuitive styles such as reading speed and emphasis for audio text readers. The W3C has now abolished the use of all HTML markup provided.

For example, in HTML before CSS, a title element is defined in red text:

<h1><font color="red">Chapter 1.</font></h1>

Using CSS, the same element can be encoded using style attributes instead of HTML display attributes:

<h1 style="color: red;">Chapter 1.</h1>

The benefits of this may not be immediately apparent. But the power of CSS becomes more apparent when style attributes are embedded in an internal style element, or even better, in an external CSS file. For example, suppose this document contains a style element:

<style>
    h1 {
        color: red;
    }
</style>

Then all h1 elements in the document turn red automatically without the need for an explicit code. If the author later wanted to make the h1 elements blue, do so by changing the style element to:

<style>
    h1 {
        color: blue;
    }
</style>

Instead of scrolling through the code and changing the color for each h1 element.

Instead of scrolling through the code and changing the color for each h1 element.

<link href="path/to/file.css" rel="stylesheet" type="text/css">

This further separates the styling from the HTML document and allows multiple documents to be re-edited by simply editing a common external CSS file.

With Alfa Cyber Stay tuned to stay up to date.

, , , ,
0.00 avg. rating (0% score) - 0 votes
Avatar for admin
Avatar for admin
Avatar for admin
3 نظرات
Avatar for admin
Jaden1463 February 14, 2024
| | |
The Beatles - легендарная британская рок-группа, сформированная в 1960 году в Ливерпуле. Их музыка стала символом эпохи и оказала огромное влияние на мировую культуру. Среди их лучших песен: "Hey Jude", "Let It Be", "Yesterday", "Come Together", "Here Comes the Sun", "A Day in the Life", "Something", "Eleanor Rigby" и многие другие. Их творчество отличается мелодичностью, глубиной текстов и экспериментами в звуке, что сделало их одной из самых влиятельных групп в истории музыки. Музыка 2024 года слушать онлайн и скачать бесплатно mp3.
Avatar for admin
Pipe fittings services January 1, 2024
| | |
Hey there, You have done a fantastic job. I will certainly digg it and personally recommend to my friends. I'm confident they'll be benefited from this site.
Avatar for admin
أنابيب uPVC December 21, 2023
| | |
إن تركيبات uPVC التي ينتجها مصنع إيليت بايب Elite Pipe مقاومة للغاية للتآكل ، وتوفر حلولاً موثوقة وخالية من الصيانة لأنظمة الري والسباكة.
en_USEnglish