Mahesh ALN πŸ‘½ Profile picture
Oct 21, 2021 β€’ 21 tweets β€’ 5 min read β€’ Read on X
Confused between boxes and box model πŸ™„πŸ€”

π˜‰π˜°π˜Ήπ˜¦π˜΄ - π˜‰π˜°π˜Ήπ˜¦π˜΄ 𝘳𝘦𝘀𝘡𝘒𝘯𝘨𝘢𝘭𝘒𝘳 π˜‰π˜°π˜Ήπ˜¦π˜΄ 𝘌𝘷𝘦𝘳𝘺𝘸𝘩𝘦𝘳𝘦 πŸ€·β€β™‚οΈπŸ˜…

Let's learn the most important concept 𝑩𝒐𝒙 𝑴𝒐𝒅𝒆𝒍 π’Šπ’ π‘ͺ𝑺𝑺.

Thread πŸ‘‡ Image
The first thing you need to understand is that,

Everything displayed is just a box.

Everything you see on a web page is made up of rectangles boxes.
on a website, you will see all the content is just a combination of boxes,

Arranged on top to, on next to, bottom, or nested in each other.

Header, nav, footer everything made up with boxes.

Usually, we called it HTML elements instead of rectangles boxes.
π˜‰π˜°π˜Ήπ˜¦π˜΄ - π˜‰π˜°π˜Ήπ˜¦π˜΄ 𝘳𝘦𝘀𝘡𝘒𝘯𝘨𝘢𝘭𝘒𝘳 π˜‰π˜°π˜Ήπ˜¦π˜΄ 𝘌𝘷𝘦𝘳𝘺𝘸𝘩𝘦𝘳𝘦 πŸ˜…

Take a look below πŸ‘‡ Image
Code added by me to see all the boxes πŸ‘‡ Image
1️⃣ What is the Box model in CSS?

Whenever you create an HTML element it is wrapped around in a box, and we are able to modify it using CSS.

this box is built with several different layers such as margin, padding, border, and content.
and with the help of CSS, we can manipulate the size, position, and properties of these boxes.

It is used to develop the design and structure of a web page.
2️⃣ Layers of Box Model:-

- Content Area
- Padding
- Border
- margin

Let's talk about each Layer of Box model. Image
βœ” Content Area:-

The content area contains the real content which is put inside HTML elements such as text, image, etc.

The width and height properties define the width and height of the content box. Image
Also, you can define the width and height of content with other properties such as,

max-width, min-width, max-height, and min-height set constraints and not a fixed size.
if we didn't define height and width then it will calculate based on content,

But we have also the option to set fixed height and width with the given properties.

take a look below πŸ‘‡ ImageImage
βœ” Padding:-

Padding in CSS refers to the space between the border and the element content.

To set padding on top, right, bottom, and left. we have properties such as

- padding-top
- padding-right
- padding-bottom
- padding-left Image
The padding shorthand defines all four sides of an element in one declaration. Image
βœ” Border:-

The border in CSS is between the margin and padding components of the box model.

Usually, we see the border around buttons like this πŸ‘‡ Image
the border shorthand property takes three inputs:

- border size
- border-style : solid/ dashed
- border-color Image
List of border styles we can use πŸ‘‡

βœ” margin:-

margin is nothing but space between the box and surrounding boxes.
To set the margin on the top, right, bottom, and left. we have properties such as

- margin-top
- margin-right
- margin-bottom
- margin-left Image
The margin shorthand defines all four sides of an element in one declaration. Image
This thread does not end here because,

I have something more to share with you so wait for the next thread.

To be continued.. 🧐
If you like this thread, drop a like and retweet, means a lot to me πŸ’›

βœ¨πŸ†β€ Image

β€’ β€’ β€’

Missing some Tweet in this thread? You can try to force a refresh
γ€€

Keep Current with Mahesh ALN πŸ‘½

Mahesh ALN πŸ‘½ Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @Ali6nX404

Jan 9, 2022
If you don't know "How CSS Works",

because of this sometimes it feels like Black Magic πŸͺ„

That's why I'm constantly creating content to simplify complex CSS topics. 🀞

Here is my top creation of 2022 πŸ‘‡πŸ§΅
2️⃣ min/max width and height

Read 7 tweets
Jan 8, 2022
How Positioning works in CSS 🧐

β—Ό static
β—Ό relative
β—Ό absolute
β—Ό fixed
β—Ό sticky

Thread 🧡
Positioning is one of the core concepts of CSS.

It isn’t as easy as it seems.

I think you must have encountered certain things like navbar or sidebar.

We scroll the webpage but they don't move from their position.
πŸ“Œ What is Positioning?

Positioning in CSS means, to set the position of an element in the webpage.

The property used in positioning is CSS position.
Read 16 tweets
Dec 8, 2021
π˜Ύπ™Žπ™Ž π™Žπ™šπ™‘π™šπ™˜π™©π™€π™§π™¨ 𝙂π™ͺπ™žπ™™π™š βœ…πŸ’™

βœ” Universal Selector
βœ” Class selector
βœ” Type selector
βœ” ID selector
βœ” Attribute selector

Many More...

π“π‘π«πžπšπ 🧡
π™ƒπ™šπ™‘π™‘π™€ π™—π™šπ™–π™ͺπ™©π™žπ™›π™ͺ𝙑 𝙃π™ͺ𝙒𝙖𝙣𝙨 πŸ‘‹

In this thread, we are going to cover basic CSS selectors with code examples.

Let's start πŸš€
πŸ“Œ What is CSS Selector?

CSS selector actually selects the content you want to style.

CSS provides different kinds of selectors to do this.
Read 16 tweets
Dec 5, 2021
I wasted 2 months in tutorial hellπŸ˜–πŸ˜«

But WTF is Tutorial Hell? πŸ€·β€β™€οΈ

How to escape it?πŸ™„

Thread πŸ§΅πŸ‘‡
As I started learning to code, I was stuck in tutorial hell. It felt like, I am learning a lot of the stuff.

I have mastered CSS and JS.
After Creating a lot of projects while watching tutorials.

One day I decided to create a project of my own.
Read 21 tweets
Dec 4, 2021
When you read CSS code and find some weird code like :

-webkit-,
-moz-,
-o-,
-ms-

Let's understand about themβš‘πŸ‘‡
What we're going to cover:-

β—Ό What is the vendor prefix.
β—Ό Prefixes used by major browsers
β—Ό Why we Use?
β—Ό property supported by browsers or not
β—Ό How we can use vendor prefixes?
β—Ό automate the vendor prefix writing
πŸ“Œ What is the vendor prefix?

CSS properties starting with -webkit-, -moz-, -ms- or -o- are called vendor prefixes.

These are the vendor-prefixed offered by the relevant rendering engines.
Read 13 tweets
Dec 3, 2021
Level up your CSS With These Generators and tools✨

threadπŸ§΅πŸ‘‡ Image
1️⃣ This is the best generator to design your next project grid layout visually.

Copy the CSS code directly.
grid.layoutit.com
2️⃣ This Generator allows you to create complex shapes easily.

bennettfeely.com/clippy/
Read 11 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(