Skip to content

width height margin padding #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 22 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,30 @@ Basic concepts of stylesheet
- External : Recommended approach

# CSS Colors
Option 1 : color name
Option 2 : hex code (#RRGGBB) range 00 to ff
Option 3 : RGB range of decimal no. 0 to 255
- Option 1 : color name
- Option 2 : hex code (#RRGGBB) range 00 to ff
- Option 3 : RGB range of decimal no. 0 to 255

# CSS Selectors
type-1 : element selector
type-2 : id selector
type-3 : class selector
type-4 : element group selector
type-5 : descendant selector using
- type-1 : element selector
- type-2 : id selector
- type-3 : class selector
- type-4 : element group selector
- type-5 : descendant selector using
> (direct child) ,
~ (general sibling),
+ (Adjacent sibling)
type-6 : pseudo class
type-7 : attribute selector
type-8 : universal selector
- type-6 : pseudo class
- type-7 : attribute selector
- type-8 : universal selector

# CSS width & height
- Option 1: height & width property
- Option 2: minHeight & maxHeight , minWidth & maxWidth

# CSS margin & padding
- Option 1: short hand only one unit
- Option 2: top bottom
- Option 3: top right bottom
- Option 4: top right bottom left

Empty file added display.css
Empty file.
Empty file added float.css
Empty file.
7 changes: 6 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<meta name='viewport' content='width=device-width, initial-scale=1'>
<link rel='stylesheet' type='text/css' media='screen' href='color-style.css'>
<link rel='stylesheet' type='text/css' media='screen' href='selector-style.css'>
<link rel='stylesheet' type='text/css' media='screen' href='width-height.css'>
<link rel='stylesheet' type='text/css' media='screen' href='margin-padding.css'>
<script src='main.js'></script>
<style>
h2 {
Expand All @@ -22,7 +24,10 @@ <h1 style="color: blueviolet;">Welcome to css</h1>
<!--internal style-->
<h2>Lets Start</h2>
<!--external style-->
<div class="subheader">Please like & subscribe</div>
<div class="subheader-1">Please like & subscribe</div>
<div class="subheader-2">Please like & subscribe</div>
<div class="subheader-3">Please like & subscribe</div>
<div class="subheader-4">Please like & subscribe</div>

<span>Selector</span>
<div>
Expand Down
43 changes: 43 additions & 0 deletions margin-padding.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/* option 1 */
.subheader-1 {
margin: 10px;
padding: 10px;
background-color: aquamarine;
}

/* option 2 */
.subheader-2 {
margin: 10px 20px;
padding: 10px 20px;
background-color: aquamarine;
}

/* option 3 */
.subheader-3 {
margin: 10px 20px 30px;
padding: 10px 20px 30px;
background-color: aquamarine;
}

/* option 4 */
.subheader-4 {
margin: 10px 20px 30px 40px;
padding: 10px 20px 30px 40px;
background-color: aquamarine;
}

/* option 5 */
.subheader-5 {
margin: 10px auto;
padding: 10px auto;
background-color: aquamarine;
}

/* option 6 */
.subheader-6 {
margin-top: auto;
margin-right: auto;
margin-bottom: auto;
margin-left: auto;
background-color: aquamarine;
}
24 changes: 24 additions & 0 deletions width-height.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* option 1 */
.parent {
background-color: blueviolet;
width: 400px;
height: 400px;
}

/* option 2 */
.parent {
background-color: blueviolet;
width: 400px;
height: 400px;
max-width: 100%;
max-height: 100%;
}

/* option 3 */
.parent {
background-color: blueviolet;
width: 400px;
height: 400px;
min-width: 100%;
min-height: 100%;
}