Skip to content

Conversation

@tkkdev
Copy link

@tkkdev tkkdev commented Jun 27, 2019

No description provided.

</head>
<body>
<div id="widget">
<div id="a" class="elem">

Choose a reason for hiding this comment

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

Can you use more verbose names for classes and ids instead of a, b, c... and widget, elem? 😄

<body>
<div id="widget">
<div id="a" class="elem">
<img src="images/chicago.png">

Choose a reason for hiding this comment

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

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

<img src="images/brooklyn_cloud.png">
<span>BROOKLYN / 55&deg;</span>
</div>
<div id="d" class="elem">

Choose a reason for hiding this comment

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

hmm, #a ,#b ,#c, #d #f looks like the similar elements. Can you change <div> to <section> and add some css class like city-card?

Copy link
Author

Choose a reason for hiding this comment

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

you mean I have to change all the divs from class “elem” to sections or add sections which would contain class=“elem” elements and have class=“city-card”?

Choose a reason for hiding this comment

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

yeap - change all the divs from class “elem” to sections (exclude #e element - see another comment) and add to them class city-card

<img src="images/portland.png">
<span>PORTLAND / 27&deg;</span>
</div>
<div id="e" class="elem">

Choose a reason for hiding this comment

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

as for me #e looks like the main part of the widget and you can change <div> to <main>

<img src="images/montue_cloud.png">
<div id="g">
<div id="i">
<div class="row">

Choose a reason for hiding this comment

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

hmm, looks like elements from the next 3 rows below - logically is the one entity ( I mean that here is just 4 entities like <span>MON</span><img/><span>22&deg;</span> if I'm correct you need to change this markup to something like
<ul class=row>
<li class="something with display: flex and flex-direction: column">
<span>MON</span><img/><span>22&deg;</span>
</li> and so on

margin: 0;
}

#widget{

Choose a reason for hiding this comment

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

It's not good idea to use id selector for styling your markup. This selector has big specifity and it will be hard to override it if needed (see https://developer.mozilla.org/ru/docs/Web/CSS/Specificity). In general, you should use classes for this purpose.

height: 70px;
margin-left: 20px;
margin-top: 15px;
display: flex;

Choose a reason for hiding this comment

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

try to use some ordering for your css properties - there is good example http://codeguide.academy/html-css.html. Order should be consistent for all css rules (if in one you add display before width - do the same for other rules as well)

padding-inline-start: 0;
margin-block-start: 0;
margin-block-end: 0;
}
Copy link
Author

@tkkdev tkkdev Jul 4, 2019

Choose a reason for hiding this comment

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

The .city-card-schedule__days-list element's padding and margins styles have to be changed in order to be properly displayed on IE/Edge

Choose a reason for hiding this comment

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

you can use padding: 0; and margin: 0; for this purposes. It should overwrite padding-inline-start and margin-block-start, margin-block-end in modern browsers and will work for old

Copy link
Author

Choose a reason for hiding this comment

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

It works! Thank you

</head>
<body>
<div class="weather-widget"><!-- Widget -->
<section class="weather-widget__city-card city-card-chicago"><!-- First card "Chicago" (img and name of the city) -->
Copy link

@milkiwayRN milkiwayRN Jul 4, 2019

Choose a reason for hiding this comment

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

I think comments in html are excessive. In general, other developers should understand your markup by semantic (using suitable html tags, verbose class names, good naming for custom elements).

Copy link
Author

Choose a reason for hiding this comment

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

Are class names that I've chosen correct and verbose enough? I mean, there was an issue with first version of names and I would like to know how good it is done now.

Choose a reason for hiding this comment

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

I think it's good now 😄 - for now I pretty easily can understand what you do in this file)

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