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 πŸ‘½

Mahesh πŸ‘½ 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

22 Oct
Cheat Sheets that always save my time during development πŸš€

Thread πŸ‘‡
1️ HTML cheatsheet -
htmlcheatsheet.com
2️⃣ CSS cheat sheet -

htmlcheatsheet.com/css/
Read 10 tweets
8 Oct
Confused About rem and em units in CSS?

Which is better to use in CSS πŸ™„

Let's understand both units ✨

threadπŸ§΅πŸ‘‡
em and rem both are known as relative units in CSS.

You've probably been using em and rem units now for a while already,

but still, you might be confused about which unit is best in which scenario.
1️⃣ What is em?

An em value is equal to the computed font size of the parent of that element.

example if font size of parent element is 20 px then 1em is equal to 20px.
Read 15 tweets
6 Oct
Total 1k Views, 100+ reactions, and 30 comments on my first blog from various platforms. 😎😍

5 things I learned during the creation of that article.

threadπŸ§΅πŸ‘‡
1️⃣ Research before write:-

I chose gradient because I use gradient a lot in my CSS art creation and,

I noticed there are not many well-detailed blogs available on the internet.

So I decided to go with it 🀠
Key point -

1. always do research about your blog topic.

2. Nothing is 100% new but we can improve at least 1% for easy understanding of readers.

3. Don't fall into research hell.

how to avoid research hell thread by @akoskm
Read 10 tweets
2 Oct
Are you using solid color background?πŸ™„

Let's upgrade it with beautiful CSS gradients ✨

Mega threadπŸ§΅πŸ‘‡
1️⃣ What is the gradient?

CSS gradient allows you to create anything from a smooth gradient between two colors, right up to impressive mixing and multiple gradients.

Gradient makes the background more attractive than a solid color.
We all know about Instagram but did you notice that the Instagram logo is also a gradient.

The genius is in its simplicity.✨
Read 29 tweets
2 Oct
Are you using solid color background?πŸ™„

Let's upgrade it with beautiful CSS gradients ✨

Mega threadπŸ§΅πŸ‘‡
1️⃣ What is the gradient?

CSS gradient allows you to create anything from a smooth gradient between two colors, right up to impressive mixing and multiple gradients.

Gradient makes the background more attractive than a solid color.
We all know about Instagram but did you notice that the Instagram logo is also a gradient.

The genius is in its simplicity.✨
Read 20 tweets
30 Sep
We're shifting on web 3.0 or you are still using Div element all along.πŸ™„

That's not fairπŸ€¦β€β™‚οΈπŸ€·β€β™‚οΈ

Let's upgrade Div with Semantic tags. πŸ€―βœ”

threadπŸ§΅πŸ‘‡ Image
1️⃣ Wtf is Semantic?

Semantics refers to the meaning of a piece of code:-

"what purpose or role does that HTML element have".

The semantic element itself conveys some information about the type of content contained between the opening and closing tags.

1/3
Semantic elements increase the:-

- Accessibility
- Improve Search Engine Optimization
- Maintainability

And this makes code more readable for machines and humans too.

2/3
Read 17 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

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

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!

:(