Испытание: взломанный котопрофайл [18/18]

Это я понял,в задании 18/18 (взломанный котопрофайл) css прописаны прямо в html (без style) ,какой в таком случае у css приоритет?

Можно считать, что одинаковый.

спасибо

3-часа ушло на это чудо) на последок нервы :triumph:сдали и посмотрел код других участников,но заметил что я делал все как надо,просто не мог картинки в линию поставить.Всего два !important :slightly_smiling_face: и код кароче,кажется.
Вот как я его решил;

html,
body {
margin: 0;
padding: 0;
}

body {
width: 550px;
height: 300px;
font-size: 12px;
font-family: Tahoma, Arial, sans-serif;
}

.profile {
padding: 5px 10px;
}

.profile img {
display: block;
padding: 10px;
border: 2px solid #34495e;
border-radius: 8px;
}

.profile .photo {
float: left;
width: 152px;
}

.profile .info {
float: left;
width: 368px;
margin-left: 10px;
}

#info-title, .profile h2 {
margin: 0!important;
padding: 10px!important;
font-weight: normal;
font-size: 12px;
color: #ffffff;
background: #34495e;
border-radius: 4px;
}

.profile div .fact {
padding: 10px;
background: white;
}

.fact:nth-child(odd) {
background: #ecf0f1;
}

.fact::after {
content: “”;
display: table;
clear: both;
}

.info .fact .title {
float: left;
width: 120px;
text-align: right;
color: #7f8c8d;
}

.info .fact .value {
margin-left: 140px;
color: #34495e;
}

.albums {
margin-top: 5px;
}

.albums img, #miska {
float: left;
margin-right: 5px;
}

.albums img:last-child {
margin-right: 0;
}

.profile .button {
display: block;
height: 30px;
margin: 5px 0;
line-height: 30px;
text-align: center;
color: #ffffff;
border-radius: 4px;
}

.profile .stroke {
background: #3498db;
}

.profile .feed {
background: #2ecc71;
}

.profile .startle {
background: #e74c3c;
}

Дорогой KaiINBishkek!
Я посмотрела ваш код.
Отличный, сделан на 97%.
Вы сказали:

Всего два !important

Но если добавить еще один, вот тут:

.fact:nth-child(odd) {
background: #ecf0f1 !important;

То будет 100%

Если добавить еще один, задание будет провалено не смотря на 100%, потому что больше двух !important там не нужно, учитесь решать задания нормальным путем, а не с использованием кучи !important.

Можно сделать его вариант решения так же 100% без третьего !important. Просто будет не вот так:

.fact:nth-child(odd) {
background: #ecf0f1 !important;

А вот так:

div .fact:nth-child(odd) {
background: #ecf0f1
}

вот правилной ответь на здоровие))))
html, body{
margin:0;
padding:0;
}
body{
font-family:Tahoma, Arial, sans-serif;
font-size:12px;
width:550px;
height:300px;
}
.profile{
padding:5px 10px;
}
.profile img{
display:block;
padding:10px;
border: 2px solid #34495e;
border-radius:8px;
}
.profile .photo{
float:left;
width:152px;
}
.profile .info{
float:left;
width:368px;
margin-left:10px;
}

h2,
#info-title {
margin: 0 !important;
padding: 10px !important;
font-weight: normal;
font-size: 12px;
color: #ffffff !important;
background: #34495e;
border-radius: 4px;
}
.fact div{
padding:10px;
background:white;
}
.fact:nth-child(odd) div{
background:#ecf0f1;
}
.fact:after{
content:"";
clear:both;
display:table;
}
.fact .title{
float:left;
width:120px;
text-align:right;
color:#7f8c8d !important;
}
.fact .value{
margin-left:140px;
color:#34495e !important;
}
.albums{
float:left;
margin-top:5px;
}
.albums img, #miska{
float:left;
margin-right:5px;
}
.albums img:last-child{
margin-right:0;
float:left;

}
.button{
display:block;
height:30px;
margin:5px 0 ;
text-align:center;
line-height:20px ;
color:#fff;
border-radius:4px;

}
.button.stroke{
background:#3498db;
text-align:center;
margin:5px 0;

}
.button.feed{
background:#2ecc71;
text-align:center;
margin:5px 0;

}
.button.startle{
background:#e74c3c;
text-align:center;
margin:5px 0;
}
span{
padding:5px;
margin:5px;

}

в задании нужно увеличив специфичность и приоритетность испорченных CSS-правил, а у вас
много переписанного кода и много !important, что в корне не верно. в данной главе курса надо “поиграться” и научится расставлять приоритетность

Мой вариант! Всего 2 important(без них никак), в самих стилях ничего не меняла.

html,
body {
margin: 0;
padding: 0;
}

body {
width: 550px;
height: 300px;
font-size: 12px;
font-family: “Tahoma”, “Arial”, sans-serif;
}

.profile {
padding: 5px 10px;
}

.profile img {
display: block;
padding: 10px;
border: 2px solid #34495e;
border-radius: 8px;
}

.profile .photo {
float: left;
width: 152px;
}

.profile .info {
float: left;
width: 368px;
margin-left: 10px;
}

#info-title, .info h2 {
margin: 0 !important;
padding: 10px !important;

font-weight: normal;
font-size: 12px;
color: #ffffff;
background: #34495e;
border-radius: 4px;
}

.profile div.fact {
padding: 10px;
background: white;
}

.profile .info .fact:nth-child(odd){
background: #ecf0f1;
}

.fact::after {
content: “”;
display: table;
clear: both;
}

.info .fact .title {
float: left;
width: 120px;
text-align: right;
color: #7f8c8d;
}

.info .fact .value {
margin-left: 140px;
color: #34495e;
}

.albums {
margin-top: 5px;
}

.albums img, #miska{
width: 64px;
height: 64px;
float: left;
margin-right: 5px;
}

.albums img:last-child {
margin-right: 0;
}

.profile .button {
display: block;
height: 30px;
margin: 5px 0;

line-height: 30px;
text-align: center;
color: #ffffff;
border-radius: 4px;
text-decoration: none;
}

.button.stroke {
background: #3498db;
}

.button.feed {
background: #2ecc71;
}

.button.startle {
background: #e74c3c;
}