Skip to content

Conversation

@TigranKirakosov
Copy link

@TigranKirakosov TigranKirakosov commented Jun 27, 2019

Completed Homework#1

@TigranKirakosov TigranKirakosov changed the title Первый ПР Tokyo Weather Widget Markup&Layout Jun 27, 2019
<div class="weather-container_widget">
<div class="weather-container_first-half">
<div class="current-weather__state"><img class="current-weather__state_image" src="/assets/images/icons/sun-ico.png"></div>
<div class="current-weather__desc">Sunny</div>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use <p> for elements with text instead of <div>?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I'll do that!

<div class="weather-container_first-half">
<div class="current-weather__state"><img class="current-weather__state_image" src="/assets/images/icons/sun-ico.png"></div>
<div class="current-weather__desc">Sunny</div>
<div class="current-weather__date">Tokyo - Wednesday, July 31</div>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the same

<div class="current-weather__date">Tokyo - Wednesday, July 31</div>
</div>
<div class="weather-container_second-half">
<div class="current-weather__temperature">28 &deg;C</div>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the same

<div class="weather-container_second-half">
<div class="current-weather__temperature">28 &deg;C</div>
<div class="current-weather__graph"><img class="current-weather__graph_image" src="/assets/images/graph.png"></div>
<div class="current-weather__next-days">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like list of similar elements - can you use <ul> and <li> instead of <div>?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll rethink the approach I'm using. Definitely, I should use ul/li here

<div class="current-weather__graph"><img class="current-weather__graph_image" src="/assets/images/graph.png"></div>
<div class="current-weather__next-days">
<div class="day">
<img class="day_symb" src="/assets/images/icons/sunny.png"><div class="current-weather__day day-props">Thu</div><div class="day-props">28 &deg;C</div><div class="night-props">18 &deg;C</div>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<img> tag has two required attributes - src and alt https://www.w3schools.com/tags/tag_img.asp

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I should always keep these alt attributes in mind. Though it seemed to be unnecessary for me, and if that is required - so be it

align-items: center;
}
.current-weather__day {
border-bottom: 1px solid #7b1f27;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that in general you use the good approach for ordering css properties - it's cool :) but try to not break it - border-bottom shouldn't be before width if you are not sure about some cases - there is good example http://codeguide.academy/html-css.html

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you 👍
And thanks for the example - it's a very useful and informative tip!

.current-weather__day {
border-bottom: 1px solid #7b1f27;
width: 45px;
text-align: center;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the same - text-align should be after any padding

.weather-container_first-half {
display: flex;
flex-direction: column;
text-align: center;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the same about ordering

background-image: url("/assets/images/bg/Tokyo-bg.png");
border-radius: 10px;
color: white;
cursor: default;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just out of curiosity - isn't cursor: default for <article>?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I did it in order to prevent cursor change on text hovering. I feel like its better for a user not to think about widget like its something common to the rest of the environment, but instead something different. I may be wrong, but for me, it feels right

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, actually I don't have any concerns about that 👍

}
/* Highier level containers states */
.weather-container_main {
padding: 80px 110px;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the same about ordering

Copy link
Author

@TigranKirakosov TigranKirakosov Jul 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed something. What was that previous note about ordering?...
upd: If it's about ordering css props, I'll fix that

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeap - it's about css properties

<ul class="weather-container_second-half">
<li class="current-weather__temperature"><p>28 &deg;C</p></li>
<li class="current-weather__graph"><img class="current-weather__graph_image" src="./assets/images/graph.png" alt="weather graph"></li>
<ul class="current-weather__next-days">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, that's what I meant 👍

<p class="current-weather__desc">Sunny</p>
<p class="current-weather__date">Tokyo - Wednesday, July 31</p>
</div>
<ul class="weather-container_second-half">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this ul is overhead - you have 3 absolutely different items inside (in general list items should be quite similar), but it's rather about semantic than some technical issue. more important - third element of list is <ul> - by specification children of <ul> should be just <li> elements (https://stackoverflow.com/questions/12242041/allowed-child-elements-of-ul)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, the first <ul> looks kinda weird and has no certain reason.
Well, I'll keep in mind the fact <ul> must contain nothing but <li> child elements.

@TigranKirakosov TigranKirakosov changed the title Tokyo Weather Widget Markup&Layout Homework#1 [Done] Aug 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants