diff --git a/docs/CSS/css-basics/Box-Model.md b/docs/CSS/css-basics/Box-Model.md deleted file mode 100644 index b6860e32c..000000000 --- a/docs/CSS/css-basics/Box-Model.md +++ /dev/null @@ -1,57 +0,0 @@ - -# Box Model - -The box model is a foundational concept in CSS (Cascading Style Sheets) used to understand and control the layout of HTML elements on a web page. It defines how the different parts of an element (content, padding, border, and margin) are arranged and interact with each other. - -You can view the box-model : - -![BoxModel](https://tse4.mm.bing.net/th?id=OIP.XbRDNkJ1LH70kC-Pq0EDwgHaFL&pid=Api&P=0&h=180) - -It consists of: -- Content -- Padding -- Borders -- Margins - -**Explanation** - -1. Content : - - This is the innermost part of the box and contains the actual content of the element, such as text or images. - The size of the content box can be controlled using properties like `width` and `height`. - - 2. Padding: - -Padding is the space between the content and the border. -It creates space inside the element, around the content. -The size of the padding can be adjusted using the `padding` property (e.g., `padding: 10px;`), or individual properties for each side (e.g., `padding-top`, `padding-right`, `padding-bottom`, `padding-left`). - - -3. Border: - -The border wraps around the padding (if any) and content. -It is defined by the `border` property (e.g., `border: 1px solid black;`), or individual properties for each side (e.g., `border-top`, `border-right`, `border-bottom`, `border-left`). - -4. Margin: - -Margin is the outermost part of the box and creates space outside the border, between the element and other elements. -It can be set using the `margin` property (e.g., `margin: 10px;`), or individual properties for each side (e.g., `margin-top`, `margin-right`, `margin-bottom`, `margin-left`). - - - -#### Box-Sizing Property -The box-sizing property is used to alter the default CSS box model used to calculate widths and heights of elements. - -content-box: This is the default value. The `width` and `height` properties apply only to the content of the element. Padding and border are added outside the `width` and `height`. - -border-box: The `width` and `height` properties include the padding and border, but not the margin. This makes it easier to set the size of an element, since padding and border are included in the total size. - -```css -.element { - box-sizing: border-box; - width: 200px; - padding: 10px; - border: 5px solid black; -} -``` -In this example, the total width of `.element` would still be 200px because the padding and border are included within the specified width. diff --git a/docs/CSS/css-basics/Colors-and-Backgrounds.md b/docs/CSS/css-basics/Colors-and-Backgrounds.md deleted file mode 100644 index 5472a7393..000000000 --- a/docs/CSS/css-basics/Colors-and-Backgrounds.md +++ /dev/null @@ -1,150 +0,0 @@ -# Colors and Background - -In CSS, controlling colors and background properties is fundamental for styling web pages. This includes setting text colors, background colors, images, gradients, and more. Below are the main properties and techniques for handling colors and backgrounds in CSS. - -**1. Text Color** - -The color property sets the color of the text. Colors can be defined using various formats, such as named colors, HEX codes, RGB, RGBA, HSL, and HSLA. - -Hex - Codes : - -HexCode - -RGB (Red-Green-Blue): - -RGB - -HSL (Hue-Saturation-Lightness): - -HSL - -```css -/* Named color */ -p { - color: red; -} - -/* HEX code */ -h1 { - color: #ff5733; -} - -/* RGB */ -div { - color: rgb(255, 87, 51); -} - -/* RGBA (with opacity) */ -span { - color: rgba(255, 87, 51, 0.8); -} - -/* HSL */ -a { - color: hsl(11, 100%, 60%); -} - -/* HSLA (with opacity) */ -footer { - color: hsla(11, 100%, 60%, 0.8); -} -``` - -**2. Background Color** - -The `background-color` property sets the background color of an element. - -```css -/* Named color */ -body { - background-color: lightblue; -} - -/* HEX code */ -header { - background-color: #333333; -} - -/* RGB */ -section { - background-color: rgb(240, 240, 240); -} - -/* RGBA (with opacity) */ -nav { - background-color: rgba(0, 0, 0, 0.5); -} - -/* HSL */ -article { - background-color: hsl(210, 100%, 95%); -} - -/* HSLA (with opacity) */ -aside { - background-color: hsla(210, 100%, 95%, 0.8); -} -``` - -**3. Background Image** - -The `background-image` property sets an image as the background of an element. You can also control its position, size, repeat behavior, and more. - -```css -/* Background image */ -body { - background-image: url('path/to/image.jpg'); - background-repeat: no-repeat; /* Prevents image from repeating */ - background-size: cover; /* Scales image to cover the entire element */ - background-position: center; /* Centers the image */ -} - -/* Gradient background */ -div { - background-image: linear-gradient(to right, red, yellow); -} -``` - -**4. Background Repeat** - -The `background-repeat` property controls if/how a background image repeats. - -```css -div { - background-image: url('path/to/image.jpg'); - background-repeat: no-repeat; /* Do not repeat the image */ - background-repeat: repeat-x; /* Repeat the image horizontally */ - background-repeat: repeat-y; /* Repeat the image vertically */ - background-repeat: round; /* Repeat the image, but rescale to fit */ - background-repeat: space; /* Repeat the image, but add space between repetitions */ -} -``` - -**5. Background Size** - -The `background-size` property specifies the size of the background image. - -```css -section { - background-image: url('path/to/image.jpg'); - background-size: auto; /* Default, original size */ - background-size: cover; /* Scale the image to cover the element */ - background-size: contain; /* Scale the image to be contained within the element */ - background-size: 100px 200px; /* Specify exact size */ - background-size: 50% 50%; /* Specify size as a percentage */ -} -``` - -**6. Background Position** - -The `background-position` property sets the starting position of the background image. - -```css -header { - background-image: url('path/to/image.jpg'); - background-position: left top; /* Align image to top left */ - background-position: center; /* Center the image */ - background-position: 50% 50%; /* Center the image using percentages */ - background-position: 10px 20px; /* Set position using exact values */ -} -``` diff --git a/docs/CSS/css-basics/Layout-ResponsiveDesign.md b/docs/CSS/css-basics/Layout-ResponsiveDesign.md deleted file mode 100644 index 0ba98f43a..000000000 --- a/docs/CSS/css-basics/Layout-ResponsiveDesign.md +++ /dev/null @@ -1,166 +0,0 @@ ---- -id: layout-responsive-design -title: Layouts and Responsive Design using CSS -sidebar_label: Layouts and Responsive Design using CSS -sidebar_position: 1 -tags: [html, introduction, web development, markup language, hyper text, web pages, career opportunities, personal growth, web-development, web design, web pages, websites, career opportunities, contribute to the web, stay relevant, express yourself, learn other technologies, have fun, how to use html, steps to start using html, set up your development environment, create your first html document, learn html syntax and structure, explore html elements and-attributes] -description: In this tutorial you will learn about layouts in CSS and also responsive design ---- - -1. *Box Model:* The CSS box model describes the rectangular boxes that are generated for elements in the document tree. Each box consists of content, padding, border, and margin areas. The width and height of an element are calculated by adding together the content width/height, padding, and border. - - - -
- This is a div element with a box model -
-
- - -2. *Positioning:* CSS positioning allows you to control the position of elements on a web page. There are different types of positioning: - - - `static`: This is the default positioning. Elements are positioned according to the normal flow of the document. - - `relative`: Elements are positioned relative to their normal position in the document flow. - - `absolute`: Elements are positioned relative to their nearest positioned ancestor, or the containing block. - - `fixed`: Elements are positioned relative to the viewport, so they remain in the same position even when the page is scrolled. - - `sticky`: Elements are positioned relative to the viewport like fixed positioning, but they behave like relative positioning until they reach a specified scroll position. - - -
- Relative positioning -
-
- Absolute positioning -
-
- - - -```css -.relative { - position: relative; - top: 20px; - left: 30px; -} - -.absolute { - position: absolute; - top: 50px; - left: 100px; -} -``` - - -3. *Floats:* Floats are a CSS property that allows an element to be taken out of the normal flow and placed along the left or right side of its container. Other content will wrap around the floated element. - - -
Float left
-
Float right
-
- -```css -.float-left { - float: left; -} - -.float-right { - float: right; -} -``` - -4. *Flexbox:* Flexbox is a one-dimensional layout model that provides an efficient way to distribute space among items in a container and align them in multiple ways. It allows you to create flexible and responsive layouts without relying on floats or positioning hacks. - - ![FlexBox](https://tse1.mm.bing.net/th?id=OIP.nypYMSbR475MUZ0KMDO6kQHaD4&pid=Api&P=0&h=180) - - - -
-
Flex item 1
-
Flex item 2
-
Flex item 3
-
-
- -```css -.flex-container { - display: flex; - justify-content: space-between; -} - -.flex-item { - flex: 1; -} -``` - -5. *Grid:* CSS Grid Layout is a two-dimensional layout system that allows you to create grid-based layouts with rows and columns. It provides precise control over the placement and sizing of elements within the grid container. - - Grid - - -
-
Grid item 1
-
Grid item 2
-
Grid item 3
-
-
- - - -```css -.grid-container { - display: grid; - grid-template-columns: 1fr 2fr 1fr; - grid-gap: 10px; -} - -.grid-item { - background-color: lightblue; - padding: 20px; -} -``` - -The `fr` unit, short for "fraction", is a flexible unit in CSS Grid Layout. It allows you to distribute available space among grid tracks (columns and rows) based on a proportion of the available space in the grid container. - - -# Responsive design - -Responsive design is an approach to web design aimed at creating web pages that provide an optimal viewing experience across a wide range of devices, from desktop computers to smartphones and tablets. The primary goal of responsive design is to ensure that websites adapt fluidly to different screen sizes, resolutions, and orientations, providing users with a consistent and user-friendly experience regardless of the device they're using. - - -**Media Queries:** Media queries are CSS rules that allow you to apply different styles based on various characteristics of the user's device, such as screen width, height, orientation, and resolution. By using media queries, you can create layouts that adjust dynamically to different device sizes and configurations. - - -```css -/* Styles for screens smaller than 768px */ -@media (max-width: 767px) { - .navigation { - display: none; /* Hide navigation menu on small screens */ - } -} - -/* Styles for screens between 768px and 991px */ -@media (min-width: 768px) and (max-width: 991px) { - .sidebar { - display: none; /* Hide sidebar on medium screens */ - } -} - -/* Styles for screens larger than 1200px */ -@media (min-width: 1200px) { - .footer { - width: 100%; /* Expand footer to full width on large screens */ - } -} -``` diff --git a/docs/CSS/css-basics/Pseudo-class-and-Pseudo-elements.md b/docs/CSS/css-basics/Pseudo-class-and-Pseudo-elements.md deleted file mode 100644 index 14f707009..000000000 --- a/docs/CSS/css-basics/Pseudo-class-and-Pseudo-elements.md +++ /dev/null @@ -1,129 +0,0 @@ ---- -id: pseudo-class-and-pseudo-elements -title: Pseudo class and Pseudo elements -sidebar_label: Pseudo class and Pseudo elements -tags: [css, introduction, web development, markup language, hyper text, web pages, career opportunities, personal growth, web-development, web design, web pages, websites, career opportunities, contribute to the web, stay relevant, express yourself, learn other technologies, have fun,pseudo classes,pseudo elements] -description: In this tutorial you will learn about Pseudo classes and Pseudo elements in CSS ---- - -Pseudo-classes are used to define the special states of an element. They are typically prefixed with a colon (`:`). - - -1. `:hover` : Applies when the user designates an element (with a pointing device), but does not activate it. Often used to change the appearance of a button when the mouse pointer is over it. - -```css -button:hover { - background-color: lightblue; -} -``` - - - - - - - -2. `:focus` : Applies when an element has received focus (e.g., when clicked on or tabbed to). - -```css -input:focus { - border-color: blue; -} -``` - - - - - - -3. `:nth-child(n)` : Matches elements based on their position in a group of siblings. - -```css -li:nth-child(2) { - color: green; -} -``` - - - - - - - -4. `:first-child` : Applies to the first child of its parent. - -```css -.container div:first-child { - color: blue; - font-weight: bold; -} -``` - - -
-
Hello
-
World
-
- -
- -5. `:nth-of-type(n)` : Matches elements based on their position among siblings of the same type. - -```css -div:nth-of-type(3) -{ - color: red; -} -``` - -## Pseudo Elements - -1. `::before` : Inserts content before an element's actual content. - -```css -p::before { - content: "Note: "; - font-weight: bold; -} -``` - -2. `::after` : Inserts content after an element's actual content. - -```css -p::after { - content: " - Read more"; - font-style: italic; -} -``` - -3. `::first-line` : Applies styles to the first line of a block-level element. - -```css -p::first-line { - color: red; - font-weight: bold; -} -``` diff --git a/docs/CSS/css-basics/Selectors.md b/docs/CSS/css-basics/Selectors.md deleted file mode 100644 index 139081678..000000000 --- a/docs/CSS/css-basics/Selectors.md +++ /dev/null @@ -1,75 +0,0 @@ -# CSS Selectors - -CSS selectors are patterns used to select and style HTML elements. Selectors target specific elements based on their type, class, ID, attributes, or position in the document. Here are some common types of CSS selectors: - -## 1. Element Selector - -Selects HTML elements based on their element type. - -Example: -```css -p { - color: blue; -} -``` -This will select all `

` elements and make their text blue. -## 2. Class Selector - -Selects elements with a specific class attribute. - -Example: -```css -.my-class { - font-weight: bold; -} -``` -This will select all elements with `class="my-class"` and make their text bold. -## 3. ID Selector - -Selects a single element with a specific ID attribute. - -Example: -```css -#my-id { - background-color: yellow; -} -``` -This will select the element with `id="my-id"` and give it a yellow background. - -## 4. Attribute Selector - -Selects elements based on their attribute values. - -Example: - -```css -input[type="text"] { - border: 1px solid #ccc; -} -``` -This will select all `` elements with `type="text"` and give them a 1px solid border with color #ccc. - -## 5. Pseudo-Classes - -Selects elements based on their state or position. - -Example: -```css -a:hover { - color: red; -} -``` -This will select all `` elements when hovered over and make their text red. - -## 6. Pseudo-elements - -Selects and styles a part of an element. -Example: - -```css - -p::first-line { - font-weight: bold; -} -``` -This will select and make the first line of all `

` elements bold. diff --git a/docs/CSS/css-basics/Typography.md b/docs/CSS/css-basics/Typography.md deleted file mode 100644 index 76e2fca5b..000000000 --- a/docs/CSS/css-basics/Typography.md +++ /dev/null @@ -1,128 +0,0 @@ -# Typography - -Typography in CSS is an essential aspect of web design, as it greatly influences the readability, aesthetics, and overall user experience of a website. Here are the key concepts and properties related to typography in CSS: - -**1. Font Family** - -The `font-family` property specifies the typeface for the text. It can include a specific font name and one or more generic font families. - -```css -body { - font-family: 'Arial', sans-serif; -} -``` - -**2. Font Size** - -The font-size property controls the size of the text. It can be set in various units like pixels (`px`), em units (`em`), rem units (`rem`), percentages (`%`), and more. - -```css -p { - font-size: 16px; -} - -h1 { - font-size: 2em; /* 2 times the current font size */ -} -``` -You can check the relation between units - -| Unit | Description | -| :--------: | :--------: | -| `em` | Calculated relative to the current font size. For example, 2em indicates 2 times larger size than current element's font size. | -| `px` | `px` stands for "pixels." It's a unit of measurement commonly used in digital design and web development to define the size of elements on a screen. | -| `%` | Percentage (`%`) is a relative unit of measurement that expresses a value as a fraction of the parent element's size or the viewport's dimensions.For example, 50% of the width of the container. | -| `rem` | Relative to font size of the root-element. | -| `vw` | Viewport width (`vw`) is a relative unit of measurement that expresses a value as a fraction of the width of the browser viewport. `1vw` is equal to 1% of the width of the viewport. | -| `vh` | Viewport height (`vh`) is a relative unit of measurement that expresses a value as a fraction of the height of the browser viewport. `1vh` is equal to 1% of the height of the viewport. | - - -**3. Font Weight** - -The `font-weight` property defines the thickness of the characters. Common values include `normal`, `bold`, `bolder`, `lighter`, or numerical values ranging from 100 to 900. - -```css -strong { - font-weight: bold; -} - -p.light { - font-weight: 300; -} -``` - -**4. Font Style** - -The `font-style` property allows you to italicize the text. - -```css -em { - font-style: italic; -} - -p.oblique { - font-style: oblique; -} -``` - -**5. Font Variant** - -The `font-variant` property is used for small-caps and other typographic features. - -```css -p { - font-variant: small-caps; -} -``` - -**6. Text Transform** - -The `text-transform` property changes the case of the text. - -```css -h1 { - text-transform: uppercase; -} - -p { - text-transform: capitalize; -} -``` - -**7. Text Alignment** - -The `text-align` property sets the horizontal alignment of the text. - -```css -div { - text-align: center; -} - -p { - text-align: justify; -} -``` - -**8. Text Decoration** - -The `text-decoration` property adds decorations to the text, such as underlines, overlines, and line-throughs. - -```css -a { - text-decoration: none; /* Removes underline from links */ -} - -del { - text-decoration: line-through; -} -``` - -**9. Text Shadow** - -The `text-shadow` property adds a shadow effect to the text. - -```css -h1 { - text-shadow: 2px 2px 5px gray; -} -``` diff --git a/docs/CSS/css-basics/basic-syntax.md b/docs/CSS/css-basics/basic-syntax.md deleted file mode 100644 index 8975c29a9..000000000 --- a/docs/CSS/css-basics/basic-syntax.md +++ /dev/null @@ -1,10 +0,0 @@ -## Basic Syntax - -CSS (Cascading Style Sheets) follows a simple syntax for styling HTML elements. Each CSS rule consists of a selector, followed by a set of declarations enclosed in curly braces. - -Example CSS rule: - -```css -selector { - property: value; -}