SuperSimpleDev / html-css-course-2022

1.32k stars 994 forks source link

8d,css and 8e.css input #10

Open kor1998 opened 2 years ago

kor1998 commented 2 years ago

when i am doing exercise in 8d and 8e in CSS why input is there in CSS and is it a kind of CSS specificity like a p element can you explain in video pls so i may more understand about CSS

SuperSimpleDev commented 2 years ago

Good question. There's 2 steps:

  1. First, I used input to style all <input> elements on the page.
  2. Then, I styled some of the inputs individually using classes (because some inputs are wider than others)

An element like <input class="first-name"> will be targeted by both input { ... } AND .first-name { ... } (in CSS multiple sets of styles can be combined together if they target the same element).

SuperSimpleDev commented 2 years ago

CSS specificity is different and is not used in these exercises. CSS specificity is when they have the same property like:

input {
  width: 300px;
}
.first-name {
  width: 500px;
}
Ekimwaki1990 commented 2 years ago

Hi am doing exercise 13g .. How do u format a div to take the shape of another div in it`