-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Program #27
base: main
Are you sure you want to change the base?
Conversation
Hi, you should add a reviewer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Osei-b4 ,
First of all, nicely done. I've added a small suggestion to make your code more maintainable. You can change your code however you want, but the least different classes, the better. Especially if it isn't nessesary for the functionality of the project. Apart from this, very good job! Looking forward to your future pull requests.
If you have any more questions, feel free to contact me 😄
Cheers!
<nav class="header-nav"> | ||
<a href="url" class="nav-link1"> | ||
<span>THE PROGRAM</span> | ||
</a> | ||
|
||
<a href="url" class="nav-link2"> | ||
<span>VOLUNTEER</span> | ||
</a> | ||
|
||
<a href="url" class="nav-link3"> | ||
<span>DIGITALRNTS</span> | ||
</a> | ||
|
||
<a href="url" class="nav-link4"> | ||
<span>ABOUT</span> | ||
</a> | ||
<a href="" class="nav-link5"> | ||
<span>FAQ</span> | ||
</a> | ||
<a href="url" class="nav-link6"> | ||
<span>SUPPORT US</span> | ||
</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason why you're rewriting the same style over and over again? You can reuse the nav-link class for each <a>-tag.
<nav class="header-nav"> | |
<a href="url" class="nav-link1"> | |
<span>THE PROGRAM</span> | |
</a> | |
<a href="url" class="nav-link2"> | |
<span>VOLUNTEER</span> | |
</a> | |
<a href="url" class="nav-link3"> | |
<span>DIGITALRNTS</span> | |
</a> | |
<a href="url" class="nav-link4"> | |
<span>ABOUT</span> | |
</a> | |
<a href="" class="nav-link5"> | |
<span>FAQ</span> | |
</a> | |
<a href="url" class="nav-link6"> | |
<span>SUPPORT US</span> | |
</a> | |
<nav class="header-nav"> | |
<a href="url" class="nav-link"> | |
<span>THE PROGRAM</span> | |
</a> | |
<a href="url" class="nav-link"> | |
<span>VOLUNTEER</span> | |
</a> | |
<a href="url" class="nav-link"> | |
<span>DIGITALRNTS</span> | |
</a> | |
<a href="url" class="nav-link"> | |
<span>ABOUT</span> | |
</a> | |
<a href="" class="nav-link"> | |
<span>FAQ</span> | |
</a> | |
<a href="url" class="nav-link"> | |
<span>SUPPORT US</span> | |
</a> |
Now you can remove all the styles. This makes your code way more manageable in the long run. I've added a suggestion in the .css file.
.nav-link1 { | ||
display: inline-flex; | ||
-webkit-box-align: center; | ||
align-items: center; | ||
height: 100%; | ||
color: rgb(127, 127, 127); | ||
font-size: 12px; | ||
line-height: 160%; | ||
text-transform: uppercase; | ||
padding: 10px 20px; | ||
font-family: "Work Sans", sans-serif; | ||
} | ||
|
||
.nav-link2 { | ||
display: inline-flex; | ||
-webkit-box-align: center; | ||
align-items: center; | ||
height: 100%; | ||
color: rgb(127, 127, 127); | ||
font-size: 12px; | ||
line-height: 160%; | ||
text-transform: uppercase; | ||
padding: 10px 20px; | ||
font-family: "work sans", sans-serif; | ||
} | ||
|
||
.nav-link3 { | ||
display: inline-flex; | ||
-webkit-box-align: center; | ||
align-items: center; | ||
height: 100%; | ||
color: rgb(127, 127, 127); | ||
font-size: 12px; | ||
line-height: 160%; | ||
text-transform: uppercase; | ||
padding: 10px 20px; | ||
font-family: "Work Sans", sans-serif; | ||
} | ||
|
||
.nav-link4 { | ||
display: inline-flex; | ||
-webkit-box-align: center; | ||
align-items: center; | ||
height: 100%; | ||
color: rgb(127, 127, 127); | ||
font-size: 12px; | ||
line-height: 160%; | ||
text-transform: uppercase; | ||
padding: 10px 20px; | ||
font-family: "Work Sans", sans-serif; | ||
} | ||
|
||
.nav-link5 { | ||
display: inline-flex; | ||
-webkit-box-align: center; | ||
align-items: center; | ||
height: 100%; | ||
color: rgb(127, 127, 127); | ||
font-size: 10px; | ||
line-height: 160%; | ||
text-transform: uppercase; | ||
padding: 10px 20px; | ||
font-family: "Work Sans", sans-serif; | ||
} | ||
|
||
.nav-link6 { | ||
display: inline-flex; | ||
-webkit-box-align: center; | ||
align-items: center; | ||
height: 100%; | ||
color: rgb(127, 127, 127); | ||
font-size: 10px; | ||
line-height: 100%; | ||
text-transform: uppercase; | ||
padding: 10px 20px; | ||
font-family: "Work Sans", sans-serif; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I mentioned before in the .html file, this code can be drastically reduced by maintaining just a single style and reusing this for every link. This reduces your code by almost 75 (repeated) lines.
.nav-link1 { | |
display: inline-flex; | |
-webkit-box-align: center; | |
align-items: center; | |
height: 100%; | |
color: rgb(127, 127, 127); | |
font-size: 12px; | |
line-height: 160%; | |
text-transform: uppercase; | |
padding: 10px 20px; | |
font-family: "Work Sans", sans-serif; | |
} | |
.nav-link2 { | |
display: inline-flex; | |
-webkit-box-align: center; | |
align-items: center; | |
height: 100%; | |
color: rgb(127, 127, 127); | |
font-size: 12px; | |
line-height: 160%; | |
text-transform: uppercase; | |
padding: 10px 20px; | |
font-family: "work sans", sans-serif; | |
} | |
.nav-link3 { | |
display: inline-flex; | |
-webkit-box-align: center; | |
align-items: center; | |
height: 100%; | |
color: rgb(127, 127, 127); | |
font-size: 12px; | |
line-height: 160%; | |
text-transform: uppercase; | |
padding: 10px 20px; | |
font-family: "Work Sans", sans-serif; | |
} | |
.nav-link4 { | |
display: inline-flex; | |
-webkit-box-align: center; | |
align-items: center; | |
height: 100%; | |
color: rgb(127, 127, 127); | |
font-size: 12px; | |
line-height: 160%; | |
text-transform: uppercase; | |
padding: 10px 20px; | |
font-family: "Work Sans", sans-serif; | |
} | |
.nav-link5 { | |
display: inline-flex; | |
-webkit-box-align: center; | |
align-items: center; | |
height: 100%; | |
color: rgb(127, 127, 127); | |
font-size: 10px; | |
line-height: 160%; | |
text-transform: uppercase; | |
padding: 10px 20px; | |
font-family: "Work Sans", sans-serif; | |
} | |
.nav-link6 { | |
display: inline-flex; | |
-webkit-box-align: center; | |
align-items: center; | |
height: 100%; | |
color: rgb(127, 127, 127); | |
font-size: 10px; | |
line-height: 100%; | |
text-transform: uppercase; | |
padding: 10px 20px; | |
font-family: "Work Sans", sans-serif; | |
} | |
.nav-link { | |
display: inline-flex; | |
-webkit-box-align: center; | |
align-items: center; | |
height: 100%; | |
color: rgb(127, 127, 127); | |
font-size: 12px; | |
line-height: 160%; | |
text-transform: uppercase; | |
padding: 10px 20px; | |
font-family: "Work Sans", sans-serif; | |
} |
Another way to tackle this can be by reusing the .css code but with different classes. You can achieve this by doing the following:
.nav-link1 { | |
display: inline-flex; | |
-webkit-box-align: center; | |
align-items: center; | |
height: 100%; | |
color: rgb(127, 127, 127); | |
font-size: 12px; | |
line-height: 160%; | |
text-transform: uppercase; | |
padding: 10px 20px; | |
font-family: "Work Sans", sans-serif; | |
} | |
.nav-link2 { | |
display: inline-flex; | |
-webkit-box-align: center; | |
align-items: center; | |
height: 100%; | |
color: rgb(127, 127, 127); | |
font-size: 12px; | |
line-height: 160%; | |
text-transform: uppercase; | |
padding: 10px 20px; | |
font-family: "work sans", sans-serif; | |
} | |
.nav-link3 { | |
display: inline-flex; | |
-webkit-box-align: center; | |
align-items: center; | |
height: 100%; | |
color: rgb(127, 127, 127); | |
font-size: 12px; | |
line-height: 160%; | |
text-transform: uppercase; | |
padding: 10px 20px; | |
font-family: "Work Sans", sans-serif; | |
} | |
.nav-link4 { | |
display: inline-flex; | |
-webkit-box-align: center; | |
align-items: center; | |
height: 100%; | |
color: rgb(127, 127, 127); | |
font-size: 12px; | |
line-height: 160%; | |
text-transform: uppercase; | |
padding: 10px 20px; | |
font-family: "Work Sans", sans-serif; | |
} | |
.nav-link5 { | |
display: inline-flex; | |
-webkit-box-align: center; | |
align-items: center; | |
height: 100%; | |
color: rgb(127, 127, 127); | |
font-size: 10px; | |
line-height: 160%; | |
text-transform: uppercase; | |
padding: 10px 20px; | |
font-family: "Work Sans", sans-serif; | |
} | |
.nav-link6 { | |
display: inline-flex; | |
-webkit-box-align: center; | |
align-items: center; | |
height: 100%; | |
color: rgb(127, 127, 127); | |
font-size: 10px; | |
line-height: 100%; | |
text-transform: uppercase; | |
padding: 10px 20px; | |
font-family: "Work Sans", sans-serif; | |
} | |
.nav-link1, .nav-link2, .nav-link3, .nav-link4, .nav-link5, .nav-link6 { | |
display: inline-flex; | |
-webkit-box-align: center; | |
align-items: center; | |
height: 100%; | |
color: rgb(127, 127, 127); | |
font-size: 12px; | |
line-height: 160%; | |
text-transform: uppercase; | |
padding: 10px 20px; | |
font-family: "Work Sans", sans-serif; | |
} |
However, I would suggest using the first example. Because there isn't any benefit for using a different class for every link 😄
<main class="mani-container"> | ||
<section class="introduction-section"> | ||
<div class="introduction-container"> | ||
<div class="txet-container"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small typo, your .css class "text-container" won't be linked 😇
Description
A clear and concise description of what the Pull Request is about.
General Checks
main
/master
Markdown
HTML
/index.html
are stored in/pages
style='color: red;'
)<style>
tags with CSS, all styles are hrefsonclick='doSomething()'
)<script>
tags with JS, all JS is in an separate fileid
s are used for JavaScript only, not for CSSCSS