From 4b1a9203c547c019fc5398082ae19a3f3d4c3efe Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:41:15 -0500 Subject: initial commit --- files/ar/learn/css/building_blocks/index.html | 90 +++++++++ .../learn/css/building_blocks/selectors/index.html | 223 +++++++++++++++++++++ .../type_class_and_id_selectors/index.html | 119 +++++++++++ files/ar/learn/css/css_layout/index.html | 77 +++++++ files/ar/learn/css/first_steps/index.html | 46 +++++ files/ar/learn/css/index.html | 63 ++++++ 6 files changed, 618 insertions(+) create mode 100644 files/ar/learn/css/building_blocks/index.html create mode 100644 files/ar/learn/css/building_blocks/selectors/index.html create mode 100644 files/ar/learn/css/building_blocks/selectors/type_class_and_id_selectors/index.html create mode 100644 files/ar/learn/css/css_layout/index.html create mode 100644 files/ar/learn/css/first_steps/index.html create mode 100644 files/ar/learn/css/index.html (limited to 'files/ar/learn/css') diff --git a/files/ar/learn/css/building_blocks/index.html b/files/ar/learn/css/building_blocks/index.html new file mode 100644 index 0000000000..8768d600eb --- /dev/null +++ b/files/ar/learn/css/building_blocks/index.html @@ -0,0 +1,90 @@ +--- +title: CSS building blocks +slug: Learn/CSS/Building_blocks +tags: + - Beginner + - CSS + - Learn + - NeedsTranslation + - TopicStub + - building blocks +translation_of: Learn/CSS/Building_blocks +--- +
{{LearnSidebar}}
+ +

This module carries on where CSS first steps left off — now you've gained familiarity with the language and its syntax, and got some basic experience with using it, its time to dive a bit deeper. This module looks at the cascade and inheritance, all the selector types we have available, units, sizing, styling backgrounds and borders, debugging, and lots more.

+ +

The aim here is to provide you with a toolkit for writing competent CSS and help you understand all the essential theory, before moving on to more specific disciplines like text styling and CSS layout.

+ +

Prerequisites

+ +

Before starting this module, you should have:

+ +
    +
  1. Basic familiarity with using computers, and using the Web passively (i.e. just looking at it, consuming the content.)
  2. +
  3. A basic work environment set up as detailed in Installing basic software, and an understanding of how to create and manage files, as detailed in Dealing with files.
  4. +
  5. Basic familiarity with HTML, as discussed in the Introduction to HTML module.
  6. +
  7. An understanding of the basics of CSS, as discussed in the CSS first steps module.
  8. +
+ +
+

Note: If you are working on a computer/tablet/another device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as JSBin or Glitch.

+
+ +

Guides

+ +

This module contains the following articles, which cover the most essential parts of the CSS language. Along the way you'll come across plenty of exercises to allow you to test your understanding.

+ +
+
Cascade and inheritance
+
The aim of this lesson is to develop your understanding of some of the most fundamental concepts of CSS — the cascade, specificity, and inheritance — which control how CSS is applied to HTML and how conflicts are resolved.
+
CSS selectors
+
There are a wide variety of CSS selectors available, allowing for fine-grained precision when selecting elements to style. In this article and its sub-articles, we'll run through the different types in great detail, seeing how they work. The sub-articles are as follows: + +
+
The box model
+
Everything in CSS has a box around it, and understanding these boxes is key to being able to create layouts with CSS, or to align items with other items. In this lesson, we will take a proper look at the CSS Box Model, in order that you can move onto more complex layout tasks with an understanding of how it works and the terminology that relates to it.
+
Backgrounds and borders
+
In this lesson we will take a look at some of the creative things you can do with CSS backgrounds and borders. From adding gradients, background images, and rounded corners, backgrounds and borders are the answer to a lot of styling questions in CSS.
+
Handling different text directions
+
In recent years, CSS has evolved in order to better support different directionality of content, including right-to-left but also top-to-bottom content (such as Japanese) — these different directionalities are called writing modes. As you progress in your study and begin to work with layout, an understanding of writing modes will be very helpful to you, therefore we will introduce them in this article.
+
Overflowing content
+
In this lesson we will look at another important concept in CSS — overflow. Overflow is what happens when there is too much content to be contained comfortably inside a box. In this guide, you will learn what it is and how to manage it.
+
CSS values and units
+
Every property used in CSS has a value or set of values that are allowed for that property. In this lesson, we will take a look at some of the most common values and units in use.
+
Sizing items in CSS
+
In the various lessons so far you have come across a number of ways to size items on a web page using CSS. Understanding how big the different features in your design will be is important, and in this lesson, we will summarize the various ways elements get a size via CSS and define a few terms around sizing that will help you in the future.
+
Images, media, and form elements
+
In this lesson we will take a look at how certain special elements are treated in CSS. Images, other media, and form elements behave a little differently in terms of your ability to style them with CSS than regular boxes. Understanding what is and isn't possible can save some frustration, and this lesson will highlight some of the main things that you need to know.
+
Styling tables
+
Styling an HTML table isn't the most glamorous job in the world, but sometimes we all have to do it. This article provides a guide to making HTML tables look good, with some specific table styling techniques highlighted.
+
Debugging CSS
+
Sometimes when writing CSS you will encounter an issue where your CSS doesn't seem to be doing what you expect. This article will give you guidance on how to go about debugging a CSS problem, and show you how the DevTools included in all modern browsers can help you find out what is going on.
+
Organizing your CSS
+
As you start to work on larger stylesheets and big projects you will discover that maintaining a huge CSS file can be challenging. In this article, we will take a brief look at some best practices for writing your CSS to make it easily maintainable, and some of the solutions you will find in use by others to help improve maintainability.
+
+ +

Assessments

+ +

Want to test your CSS skills? The following assessments will test your understanding of the CSS covered in the guides above.

+ +
+
Fundamental CSS comprehension
+
This assessment tests your understanding of basic syntax, selectors, specificity, box model, and more.
+
Creating fancy letterheaded paper
+
If you want to make the right impression, writing a letter on nice letterheaded paper can be a really good start. In this assessment, we'll challenge you to create an online template to achieve such a look.
+
A cool looking box
+
Here you'll get some practice in using background and border styling to create an eye-catching box.
+
+ +

See also

+ +
+
Advanced styling effects
+
This article acts as a box of tricks, providing an introduction to some interesting advanced styling features such as box shadows, blend modes, and filters.
+
diff --git a/files/ar/learn/css/building_blocks/selectors/index.html b/files/ar/learn/css/building_blocks/selectors/index.html new file mode 100644 index 0000000000..9bc86d8abc --- /dev/null +++ b/files/ar/learn/css/building_blocks/selectors/index.html @@ -0,0 +1,223 @@ +--- +title: CSS selectors +slug: Learn/CSS/Building_blocks/Selectors +translation_of: Learn/CSS/Building_blocks/Selectors +--- +
{{LearnSidebar}}{{PreviousMenuNext("Learn/CSS/Building_blocks/Cascade_and_inheritance", "Learn/CSS/Building_blocks/Selectors/Type_Class_and_ID_Selectors", "Learn/CSS/Building_blocks")}}
+ +

In {{Glossary("CSS")}}, selectors are used to target the {{glossary("HTML")}} elements on our web pages that we want to style. There are a wide variety of CSS selectors available, allowing for fine-grained precision when selecting elements to style. In this article and its sub-articles we'll run through the different types in great detail, seeing how they work.

+ + + + + + + + + + + + +
Prerequisites:Basic computer literacy, basic software installed, basic knowledge of working with files, HTML basics (study Introduction to HTML), and an idea of how CSS works (study CSS first steps.)
Objective:To learn how CSS selectors work in detail.
+ +

What is a selector?

+ +

You have met selectors already. A CSS selector is the first part of a CSS Rule. It is a pattern of elements and other terms that tell the browser which HTML elements should be selected to have the CSS property values inside the rule applied to them. The element or elements which are selected by the selector are referred to as the subject of the selector.

+ +

Some code with the h1 highlighted.

+ +

In earlier articles you met some different selectors, and learned that there are selectors that target the document in different ways — for example by selecting an element such as h1, or a class such as .special.

+ +

In CSS, selectors are defined in the CSS Selectors specification; like any other part of CSS they need to have support in browsers for them to work. The majority of selectors that you will come across are defined in the Level 3 Selectors specification, which is a mature specification, therefore you will find excellent browser support for these selectors.

+ +

Selector lists

+ +

If you have more than one thing which uses the same CSS then the individual selectors can be combined into a selector list so that the rule is applied to all of the individual selectors. For example, if I have the same CSS for an h1 and also a class of .special, I could write this as two separate rules.

+ +
h1 {
+  color: blue;
+}
+
+.special {
+  color: blue;
+} 
+ +

I could also combine these into a selector list, by adding a comma between them.

+ +
h1, .special {
+  color: blue;
+} 
+ +

White space is valid before or after the comma. You may also find the selectors more readable if each is on a new line.

+ +
h1,
+.special {
+  color: blue;
+} 
+ +

In the live example below try combining the two selectors which have identical declarations. The visual display should be the same after combining them.

+ +

{{EmbedGHLiveSample("css-examples/learn/selectors/selector-list.html", '100%', 1000)}} 

+ +

When you group selectors in this way, if any selector is invalid the whole rule will be ignored.

+ +

In the following example, the invalid class selector rule will be ignored, whereas the h1 would still be styled.

+ +
h1 {
+  color: blue;
+}
+
+..special {
+  color: blue;
+} 
+ +

When combined however, neither the h1 nor the class will be styled as the entire rule is deemed invalid.

+ +
h1, ..special {
+  color: blue;
+} 
+ +

Types of selectors

+ +

There are a few different groupings of selectors, and knowing which type of selector you might need will help you to find the right tool for the job. In this article's subarticles we will look at the different groups of selectors in more detail.

+ +

Type, class, and ID selectors

+ +

This group includes selectors that target an HTML element such as an <h1>.

+ +
h1 { }
+ +

It also includes selectors which target a class:

+ +
.box { }
+ +

or, an ID:

+ +
#unique { }
+ +

Attribute selectors

+ +

This group of selectors gives you different ways to select elements based on the presence of a certain attribute on an element:

+ +
a[title] { }
+ +

Or even make a selection based on the presence of an attribute with a particular value:

+ +
a[href="https://example.com"] { }
+ +

Pseudo-classes and pseudo-elements

+ +

This group of selectors includes pseudo-classes, which style certain states of an element. The :hover pseudo-class for example selects an element only when it is being hovered over by the mouse pointer:

+ +
a:hover { }
+ +

It also includes pseudo-elements, which select a certain part of an element rather than the element itself. For example, ::first-line always selects the first line of text inside an element (a <p> in the below case), acting as if a <span> was wrapped around the first formatted line and then selected.

+ +
p::first-line { }
+ +

Combinators

+ +

The final group of selectors combine other selectors in order to target elements within our documents. The following for example selects paragraphs that are direct children of <article> elements using the child combinator (>):

+ +
article > p { }
+ +

Next steps

+ +

You can take a look at the reference table of selectors below for direct links to the various types of selectors in this Learn section or on MDN in general, or continue on to start your journey by finding out about type, class, and ID selectors.

+ +

{{PreviousMenuNext("Learn/CSS/Building_blocks/Cascade_and_inheritance", "Learn/CSS/Building_blocks/Selectors/Type_Class_and_ID_Selectors", "Learn/CSS/Building_blocks")}}

+ +

Reference table of selectors

+ +

The below table gives you an overview of the selectors you have available to use, along with links to the pages in this guide which will show you how to use each type of selector. I have also included a link to the MDN page for each selector where you can check browser support information. You can use this as a reference to come back to when you need to look up selectors later in the material, or as you experiment with CSS generally.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SelectorExampleLearn CSS tutorial
Type selectorh1 {  }Type selectors
Universal selector* {  }The universal selector
Class selector.box {  }Class selectors
id selector#unique { }ID selectors
Attribute selectora[title] {  }Attribute selectors
Pseudo-class selectorsp:first-child { }Pseudo-classes
Pseudo-element selectorsp::first-line { }Pseudo-elements
Descendant combinatorarticle pDescendant combinator
Child combinatorarticle > pChild combinator
Adjacent sibling combinatorh1 + pAdjacent sibling
General sibling combinatorh1 ~ pGeneral sibling
+ +

In this module

+ +
    +
  1. Cascade and inheritance
  2. +
  3. CSS selectors + +
  4. +
  5. The box model
  6. +
  7. Backgrounds and borders
  8. +
  9. Handling different text directions
  10. +
  11. Overflowing content
  12. +
  13. Values and units
  14. +
  15. Sizing items in CSS
  16. +
  17. Images, media, and form elements
  18. +
  19. Styling tables
  20. +
  21. Debugging CSS
  22. +
  23. Organizing your CSS
  24. +
diff --git a/files/ar/learn/css/building_blocks/selectors/type_class_and_id_selectors/index.html b/files/ar/learn/css/building_blocks/selectors/type_class_and_id_selectors/index.html new file mode 100644 index 0000000000..749f576534 --- /dev/null +++ b/files/ar/learn/css/building_blocks/selectors/type_class_and_id_selectors/index.html @@ -0,0 +1,119 @@ +--- +title: 'Type, class, and ID selectors' +slug: Learn/CSS/Building_blocks/Selectors/Type_Class_and_ID_Selectors +translation_of: Learn/CSS/Building_blocks/Selectors/Type_Class_and_ID_Selectors +--- +

{{LearnSidebar}}{{PreviousMenuNext("Learn/CSS/Building_blocks/Selectors", "Learn/CSS/Building_blocks/Selectors/Attribute_selectors", "Learn/CSS/Building_blocks")}}

+ +

In this lesson we will take a look at the simplest selectors that are available, which you will probably use the most in your work.

+ + + + + + + + + + + + +
Prerequisites:Basic computer literacy, basic software installed, basic knowledge of working with files, HTML basics (study Introduction to HTML), and an idea of how CSS works (study CSS first steps.)
Objective:To learn about the different CSS selectors we can use to apply CSS to a document.
+ +

Type selectors

+ +

A type selector is sometimes referred to as a tag name selector or element selector, because it selects an HTML tag/element in your document. In the example below we have used the span, em and strong selectors. All instances of <span>, <em> and <strong> elements are therefore styled accordingly.

+ +

Try adding a CSS rule to select the <h1> element and change its color to blue.

+ +

{{EmbedGHLiveSample("css-examples/learn/selectors/type.html", '100%', 1100)}}

+ +

The universal selector

+ +

The universal selector is indicated by an asterisk (*) and selects everything in the document (or inside the parent element if it is being chained together with another element and a descendant combinator). In the following example we have used the universal selector to remove the margins on all elements. This means that instead of the default styling added by the browser, which spaces out headings and paragraphs with margins, everything is close together and we can't see the different paragraphs easily.

+ +

{{EmbedGHLiveSample("css-examples/learn/selectors/universal.html", '100%', 750)}}

+ +

This kind of behavior can sometimes be seen in "reset stylesheets", which strips out all of the browser styling. Since the universal selector makes global changes, we use it to deal with very specific situations such as the one outlined below.

+ +

Using the universal selector to make your selectors easier to read

+ +

One use of the universal selector is to make selectors easier to read and more obvious in terms of what they are doing. For example, if I wanted to select the first child of any descendant element of <article> , no matter what element it was, and make it bold, I could use the {{cssxref(":first-child")}} selector, which we will learn more about in the lesson on pseudo-classes and pseudo-elements, as a descendant selector along with the <article> element selector: 

+ +
article :first-child {
+
+}
+ +

This could be confused however with article:first-child, which will select any <article> element that is the first child of another element.

+ +

To avoid this confusion we can add the universal selector to the :first-child selector, so it is obvious what the selector is doing. It is selecting any element which is the first-child of any descendant element of <article>:

+ +
article *:first-child {
+
+} 
+ +

Although both do the same thing, the readability is significantly improved.

+ +

Class selectors

+ +

The class selector starts with a full stop (.) character and will select everything in the document with that class applied to it. In the live example below we have created a class called .highlight, and have applied it to several places in my document. All of the elements that have the class applied are highlighted.

+ +

{{EmbedGHLiveSample("css-examples/learn/selectors/class.html", '100%', 750)}}

+ +

Targeting classes on particular elements

+ +

You can create a selector that will target specific elements with the class applied. In this next example we will highlight a <span> with a class of highlight differently to an <h1> heading with a class of highlight. We do this by using the type selector for the element I want to target, with the class appended using a dot, with no white space in between.

+ +

{{EmbedGHLiveSample("css-examples/learn/selectors/class-type.html", '100%', 750)}}

+ +

This approach reduces the scope of a rule as the rule will only apply to that particular element  & class combination; so you would need to add another selector if you decided the rule should apply to other elements too.

+ +

Target an element if it has more than one class applied

+ +

You can apply multiple classes to an element and target them individually, or only select the element when all of the classes in the selector are present. This can be helpful when building up components that can be combined in different ways on your site.

+ +

In the example below we have a <div> that contains a note. The grey border is applied when the box has a class of notebox. If it also has a class of warning or danger, we change the {{cssxref("border-color")}}.

+ +

We can tell the browser that we only want to match the element if it has two classes applied by chaining them together with no white space between them. You'll see that the last <div> doesn't get any styling applied, as it only has the danger class; it needs notebox as well to get anything applied.

+ +

{{EmbedGHLiveSample("css-examples/learn/selectors/class-many.html", '100%', 900)}}

+ +

ID Selectors

+ +

An ID selector begins with a # rather than a full stop character, but is basically used in the same way as a class selector. An ID however can be used only once per document. It can select an element that has the id set on it, and you can precede the ID with a type selector to only target the element if both the element and ID match. You can see both of these uses in the following example:

+ +

{{EmbedGHLiveSample("css-examples/learn/selectors/id.html", '100%', 750)}}

+ +
+

Note: As we learned in the lesson on specificity, an ID has high specificity and will overrule most other selectors. This can make them difficult to deal with. In most cases it is preferable to add a class to the element rather than use an ID, however if using the ID is the only way to target the element — perhaps because you do not have access to the markup and so cannot edit it — this will work.

+
+ +

In the next article

+ +

We'll continue exploring selectors by looking at attribute selectors.

+ +

{{PreviousMenuNext("Learn/CSS/Building_blocks/Selectors", "Learn/CSS/Building_blocks/Selectors/Attribute_selectors", "Learn/CSS/Building_blocks")}}

+ +

In this module

+ +
    +
  1. Cascade and inheritance
  2. +
  3. CSS selectors + +
  4. +
  5. The box model
  6. +
  7. Backgrounds and borders
  8. +
  9. Handling different text directions
  10. +
  11. Overflowing content
  12. +
  13. Values and units
  14. +
  15. Sizing items in CSS
  16. +
  17. Images, media, and form elements
  18. +
  19. Styling tables
  20. +
  21. Debugging CSS
  22. +
  23. Organizing your CSS
  24. +
diff --git a/files/ar/learn/css/css_layout/index.html b/files/ar/learn/css/css_layout/index.html new file mode 100644 index 0000000000..a0fadc9403 --- /dev/null +++ b/files/ar/learn/css/css_layout/index.html @@ -0,0 +1,77 @@ +--- +title: تخطيط التصميم في CSS +slug: Learn/CSS/CSS_layout +tags: + - Beginner + - CSS + - Floating + - Grids + - Guide + - Landing + - Layout + - Learn + - Module + - Multiple column + - NeedsTranslation + - Positioning + - TopicStub + - alignment + - flexbox + - float + - table +translation_of: Learn/CSS/CSS_layout +--- +
{{LearnSidebar}}
+ +

At this point we've already looked at CSS fundamentals, how to style text, and how to style and manipulate the boxes that your content sits inside. Now it's time to look at how to place your boxes in the right place in relation to the viewport, and one another. We have covered the necessary prerequisites so we can now dive deep into CSS layout, looking at different display settings, modern layout tools like flexbox, CSS grid, and positioning, and some of the legacy techniques you might still want to know about.

+ +

Prerequisites

+ +

Before starting this module, you should already:

+ +
    +
  1. Have basic familiarity with HTML, as discussed in the Introduction to HTML module.
  2. +
  3. Be comfortable with CSS fundamentals, as discussed in Introduction to CSS.
  4. +
  5. Understand how to style boxes.
  6. +
+ +
+

Note: If you are working on a computer/tablet/other device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as JSBin or Thimble.

+
+ +

Guides

+ +

These articles will provide instruction on the fundamental layout tools and techniques available in CSS. At the end of the lessons is an assessment to help you check your understanding of layout methods, by laying out a webpage.

+ +
+
Introduction to CSS layout
+
This article will recap some of the CSS layout features we've already touched upon in previous modules — such as different {{cssxref("display")}} values — and introduce some of the concepts we'll be covering throughout this module.
+
Normal Flow
+
Elements on webpages lay themselves out according to normal flow - until we do something to change that. This article explains the basics of normal flow as a grounding for learning how to change it.
+
Flexbox
+
Flexbox is a one-dimensional layout method for laying out items in rows or columns. Items flex to fill additional space and shrink to fit into smaller spaces. This article explains all the fundamentals.
+
Grids
+
CSS Grid Layout is a two-dimensional layout system for the web. It lets you lay content out in rows and columns, and has many feature that make building complex layouts straightforward. This article will give you all you need to know to get started with page layout.
+
Floats
+
Originally for floating images inside blocks of text, the {{cssxref("float")}} property became one of the most commonly used tools for creating multiple column layouts on webpages. With the advent of Flexbox and Grid it has now returned to its original purpose, as this article explains.
+
Positioning
+
Positioning allows you to take elements out of the normal document layout flow, and make them behave differently, for example sitting on top of one another, or always remaining in the same place inside the browser viewport. This article explains the different {{cssxref("position")}} values, and how to use them.
+
Multiple-column layout
+
The multiple-column layout specification gives you a method of laying content out in columns, as you might see in a newspaper. This article explains how to use this feature.
+
Legacy layout methods
+
Grid systems are a very common feature used in CSS layouts, and before CSS Grid Layout they tended to be implemented using floats or other layout features. You imagine your layout as a set number of columns (e.g. 4, 6, or 12), and then fit your content columns inside these imaginary columns. In this article we'll explore how these older methods work, in order that you understand how they were used if you work on an older project.
+
Supporting older browsers
+
+

In this module we recommend using Flexbox and Grid as the main layout methods for your designs. However there will be visitors to your site who use older browsers, or browsers which do not support the methods you have used. This will always be the case on the web — as new features are developed, different browsers will prioritise different things. This article explains how to use modern web techniques without locking out users of older technology.

+
+
Fundamental Layout Comprehension
+
An assessment to test your knowledge of different layout methods by laying out a  webpage.
+
+ +

See also

+ +
+
Practical positioning examples
+
This article shows how to build some real world examples to illustrate what kinds of things you can do with positioning.
+
+
diff --git a/files/ar/learn/css/first_steps/index.html b/files/ar/learn/css/first_steps/index.html new file mode 100644 index 0000000000..34b8e9fefb --- /dev/null +++ b/files/ar/learn/css/first_steps/index.html @@ -0,0 +1,46 @@ +--- +title: CSS first steps +slug: Learn/CSS/First_steps +translation_of: Learn/CSS/First_steps +--- +
{{LearnSidebar}}
+ +

CSS (Cascading Style Sheets) is used to style and lay out web pages — for example, to alter the font, color, size, and spacing of your content, split it into multiple columns, or add animations and other decorative features. This module provides a gentle beginning to your path towards CSS mastery with the basics of how it works, what the syntax looks like, and how you can start using it to add styling to HTML.

+ +

Prerequisites

+ +

Before starting this module, you should have:

+ +
    +
  1. Basic familiarity with using computers, and using the Web passively (i.e. looking at it, consuming the content.)
  2. +
  3. A basic work environment set up as detailed in Installing basic software, and an understanding of how to create and manage files, as detailed in Dealing with files.
  4. +
  5. Basic familiarity with HTML, as discussed in the Introduction to HTML module.
  6. +
+ +
+

Note: If you are working on a computer/tablet/other device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as JSBin or Thimble.

+
+ +

Guides

+ +

This module contains the following articles, which will take you through all the basic theory of CSS, and provide opportunities for you to test out some skills.

+ +
+
What is CSS?
+
{{Glossary("CSS")}} (Cascading Style Sheets) allows you to create great-looking web pages, but how does it work under the hood? This article explains what CSS is, with a simple syntax example, and also covers some key terms about the language.
+
Getting started with CSS
+
In this article we will take a simple HTML document and apply CSS to it, learning some practical things about the language along the way.
+
How CSS is structured
+
Now that you have an idea about what CSS is and the basics of using it, it is time to look a little deeper into the structure of the language itself. We have already met many of the concepts discussed here; you can return to this one to recap if you find any later concepts confusing.
+
How CSS works
+
We have learned the basics of CSS, what it is for and how to write simple stylesheets. In this lesson we will take a look at how a browser takes CSS and HTML and turns that into a webpage.
+
Using your new knowledge
+
With the things you have learned in the last few lessons you should find that you can format simple text documents using CSS, to add your own style to them. This article gives you a chance to do that.
+
+ +

See also

+ +
+
Intermediate Web Literacy 1: Intro to CSS
+
An excellent Mozilla foundation course that explores and tests a lot of the skills talked about in the Introduction to CSS module. Learn about styling HTML elements on a webpage, CSS selectors, attributes, and values.
+
diff --git a/files/ar/learn/css/index.html b/files/ar/learn/css/index.html new file mode 100644 index 0000000000..3a56c01335 --- /dev/null +++ b/files/ar/learn/css/index.html @@ -0,0 +1,63 @@ +--- +title: CSS +slug: Learn/CSS +tags: + - Beginner + - CSS + - CodingScripting + - Debugging + - Landing + - NeedsContent + - NeedsTranslation + - Topic + - TopicStub + - length + - specificity +translation_of: Learn/CSS +--- +

الترجمة الحرفية للـ {{glossary("CSS")}} لن تفيدك كثيراً ولكن من باب العلم بها فمعناها (أوراق النمط المتعاقب)، لكن دعنا نتعرف أكثر ما هي الـ CSS وما الذي تقوم به، هي التقنية الأولى من تقنيات الويب التي يجب أن تبدأ بها رحلتك في تعلم تطوير الويب، في حين تقوم بإستخدام الـ HTML في إنشاء العناصر الأساسية للصفحة (هيكلة صفحة الويب)، تقوم بإستخدام الـ CSS في إضفاء الشكل الجمالي لصفحات الويب من خلال إضافة الألوان والمساحات وأماكن العناصر المختلفة، أو إضافة تأثيرات الحركة على بعض العناصر في صفحة الويب.

+ +

مسار التعلم المتبع

+ +

يجب عليك تعلم اساسيات HTML أولاً قبل الشروع في تعلم الـ CSS، فكيف تقوم بإضافة الجماليات على صفحة ويب لم يتم إنشاءها بعد؟ لذلك ننصحك بتعمل أساسيات الـ HTML من هنا مقدمة في الـ HTML بعد ذلك يمكنك تعلم:

+ + + +

مباشرةً عندما تجد نفسك مستوعباً لأساسيات الـ HTML, ننصحك بتعلم الـ HTML والـ CSS بشكل متزامن (في نفس الوقت) لانك غالباً ستحتاج إلى تطوير نفسك في كليهما بشكل مستمر. وأيضاً لان الـ HTML شيقة في التعلم لسهولة تطبيقها خلال رحلة تعلمك، وستجد أنك تستوعبها سريعاً، وستجد أيضاً انها اكثر متعه عندما تقوم بتطبيق ما تعلمته من الـ CSS. وتذكر دائماً انك لن تستطيع تعلم الـ CSS بدون معرفة الـ HTML.

+ +

قبل البداية في تعمل هذه التقنية، لابد من تعلم أساسيات التعامل مع الحاسب وإستخدام الويب، أيضاً لابد من تهيئة بيئة العمل التي تحتاجها لإنشاء صفحات الويب كما تم شرحها في تنصيب البرامج المستخدمة في بيئة العمل، وكيفية إنشاء وإدارة الملفات كما تم شرحنا في التعامل مع الملفات، هذين المقالين أجزاء من ملف شرح البداية في تعلم الويب للمبتدئين.

+ +

وننصحك أيضاً أن تقوم بتعلم البداية في تعلم الويب قبل الشروع في هذا المقال، على كل حال هذا ليس ضرورياً للغاية، كثيرا مما تم شرحه في أساسيات CSS تم شرحه أيضاً في مقدمة CSS ولكن بشكل أكثر تفصيلاً.

+ +

العناصر

+ +

هذا الموضوع يحتوى على العناصر التالية، نقترح عليك أن تبدأ في تعلمهم بهذا الترتيب، ويجب عليك بشكل مؤكد أن تبدأ بالعنصر الأول لأهميته.

+ +
+
مقدمة في CSS
+
في هذا الجزء سنبدأ في تعلم أساسيات كيفية عمل الـ CSS وسنقوم بشرح المحددات (Selectors) والخصائص (Properties) وكيفية كتاب قواعد الـ CSS وكيفية تطبيق CSS على عناصر HTML، كيف تحدد الطول واللون والوحدات الأخرى في CSS وسنقوم أيضاً بشرح وراثة القيم وأساسيات العناصر الأساسية في الصفحة (Box Model) وكيفية معالجة الأخطاء في CSS.
+
تنسيق/شكل الخطوط
+
هنا ، ننظر إلى أساسيات تصميم النصوص ، بما في ذلك ضبط الخط ، السماكة ، والميول ; الخط والمسافات بين الحروف 
+
هنا نلقي نظرة على أساسيات تصميم النص ، بما في ذلك تعيين الخط والخط الجريء والخط المائل وتباعد الأسطر والحروف والظلال المسقطة وميزات النص الأخرى. ننهي الوحدة من خلال النظر في تطبيق الخطوط المخصصة على صفحتك وقوائم التصميم والروابط.
+
Styling boxes
+
بعد ذلك ، نلقي نظرة على مربعات التصميم ، وهي إحدى الخطوات الأساسية نحو تخطيط صفحة الويب. في هذه الوحدة ، نلخص نموذج الصندوق ثم ننظر إلى التحكم في تخطيطات الصندوق عن طريق تعيين المساحة المتروكة والحدود والهوامش ، وتعيين ألوان خلفية مخصصة وصور وميزات أخرى ، وميزات فاخرة مثل الظلال المسقطة والمرشحات على الصناديق.
+
CSS layout
+
في هذه المرحلة ، اطلعنا بالفعل على أساسيات CSS ، وكيفية تصميم النص ، وكيفية تصميم ومعالجة المربعات الموجودة في المحتوى الخاص بك. حان الوقت الآن للنظر في كيفية وضع مربعاتك في المكان المناسب بالنسبة إلى إطار العرض ، وبعضها البعض. لقد قمنا بتغطية المتطلبات الأساسية اللازمة حتى تتمكن الآن من التعمق في تخطيط CSS ، والنظر في إعدادات العرض المختلفة ، وطرق التخطيط التقليدية التي تتضمن العوامة وتحديد المواقع ، وأدوات التخطيط الجديدة المتشعبة مثل flexbox.
+
Responsive design (TBD)
+
مع وجود العديد من الأنواع المختلفة من الأجهزة التي يمكنها تصفح الويب هذه الأيام ،responsive web design (RWD) أصبحت مهارة تطوير الويب الأساسية. ستغطي هذه الوحدة المبادئ والأدوات الأساسية لـ RWD ، وتشرح كيفية تطبيق CSS مختلفة على مستند اعتمادًا على ميزات الجهاز مثل عرض الشاشة ، والتوجيه ، والدقة ، واستكشاف التقنيات المتاحة لتقديم الفيديو والصور المختلفة اعتمادًا على هذه الميزات.
+
+ +

Solving common CSS problems

+ +

Use CSS to solve common problems provides links to sections of content explaining how to use CSS to solve very common problems when creating a webpage.

+ +

See also

+ +
+
CSS on MDN
+
The main entry point for CSS documentation on MDN, where you'll find detailed reference documentation for all features of the CSS language. Want to know all the values a property can take? This is a good place to go.
+
-- cgit v1.2.3-54-g00ecf